Notices


Reply
Thread Tools
Posts: 1,522 | Thanked: 379 times | Joined on Jul 2010 @ São Paulo, Brazil
#1
Using the main camera, by measuring the focus at different points (scanning in a grid of the desired output resolution), it should be possible to acquire the data for generating an approximate depth map of the scene (obviouslly only inside the range of focus that can be measured)


If any points can't have its focus measured at any exposure, interpolate the value from the surrounding poihts.


Ideally, besides the depth map, also capture a visible image of the scene (even better if you make it have superfocus, compositing the best focus for each section together into a final image where everything is in focus)



I know the depth map will not have anywhere near professional grade depth resolution and precision, but even just an aproximate rough map will already be awesome.
 

The Following 2 Users Say Thank You to TiagoTiago For This Useful Post:
ndi's Avatar
Posts: 2,050 | Thanked: 1,420 times | Joined on Dec 2009 @ Bucharest
#2
There is a thread already about using focus to measure stuff - a measurement device. Like I said in the thread, focus on an N900 is very unprecise, basically it does one meter or over 5, which is insuficcient for any usable mapping, not to mention it doesn't reliably lock every time.

I think you need DSLR grade focusing to get what you want, if I understand what you want correctly.
__________________
N900 dead and Nokia no longer replaces them. Thanks for all the fish.

Keep the forums clean: use "Thanks" button instead of the thank you post.
 

The Following User Says Thank You to ndi For This Useful Post:
Posts: 931 | Thanked: 616 times | Joined on Jun 2010 @ Low Earth Orbit
#3
Now that usb host mode is somewhat working, just plugin a 3D laser range finder mapper.
 

The Following User Says Thank You to kureyon For This Useful Post:
Posts: 1,522 | Thanked: 379 times | Joined on Jul 2010 @ São Paulo, Brazil
#4
Like i said, even a rough approximation would already be awesome, and for the spots that will not lock you can interpolate the values from the surrounding spots the did lock.
 

The Following User Says Thank You to TiagoTiago For This Useful Post:
Posts: 1,522 | Thanked: 379 times | Joined on Jul 2010 @ São Paulo, Brazil
#5
Btw, what if instead of using the builtin autofocus, you do a sweep of every focus notch saving an image for each, then use some algorithm to measure the sharpness at each part of the image on each notch, and for each part of the image, identify at which notch it is at its sharpest and use that as the measured depth for that part?
 

The Following User Says Thank You to TiagoTiago For This Useful Post:
Posts: 1,178 | Thanked: 1,102 times | Joined on Mar 2010
#6
This would be cool. I would like to ask if it would be possible to callibrate the depth the depth of an area/object by using the old motion capture trick of using golf balls or the like?

Ok I admit that may not produce the desired effect but the data captured may be used in other programs such as Gimp, Shoop or any other CAD program?
 

The Following User Says Thank You to MINKIN2 For This Useful Post:
Posts: 1,522 | Thanked: 379 times | Joined on Jul 2010 @ São Paulo, Brazil
#7
Measuring depth by calculating the visible size of an object you know the actual measurements can be done with any image regardless of source (though in some cases you would need to also take a picture of a calibration grid with the same imaging device in order to correct for any distortions)
 

The Following User Says Thank You to TiagoTiago For This Useful Post:
ndi's Avatar
Posts: 2,050 | Thanked: 1,420 times | Joined on Dec 2009 @ Bucharest
#8
The focus steps for camera are somewhere along the lines of 50 cm, 1 m, and >5m. At this kind of precision, the depth map is basically 2 cubes.

It could be usable for closer imaging, like macro, but frankly it's not all that useful to depth-map a pen or a box of matches, save for a proof of concept.

And each-step capture with postprocessing is a good idea in theory but it will do you no good if the camera steps in what is basically "here, there and everything else".

I don't think onboard camera will produce anything useful by its own. You can glue a laser pointer to it and make sure it has a divergent beam. Measuring the size of the dot and the intensity could provide with a crude depth perception but it will have high resolution.

It could be done with additional hardware, say, via interference or by using an emitter-receiver and linking it to the device.

The focus mechanism is basically locked on to "end of line" for anything over 1 meter away, sometimes even less. For example, locking on to an image that is 60 cm away gives 2-3/5 a 60 cm, and 4/5 something in the order of 40-80. At this kind of precision, your map will be unreliable beyond help.

You could use 2 N900s. A stereoscopic image from 2 shots could determine depth to an amazing degree. If you know the resolution and distance between cameras you are basically limited by the quality of the shot alone. You could have precision as high as one meter up to -say- 30 meters away. A true depth map.
__________________
N900 dead and Nokia no longer replaces them. Thanks for all the fish.

Keep the forums clean: use "Thanks" button instead of the thank you post.
 

The Following 2 Users Say Thank You to ndi For This Useful Post:
Posts: 1,522 | Thanked: 379 times | Joined on Jul 2010 @ São Paulo, Brazil
#9
How bad the scan of a face would be for example?
 

The Following User Says Thank You to TiagoTiago For This Useful Post:
ndi's Avatar
Posts: 2,050 | Thanked: 1,420 times | Joined on Dec 2009 @ Bucharest
#10
Originally Posted by TiagoTiago View Post
How bad the scan of a face would be for example?
Even at very close range, the focus of the camera is in 10 cm steps. With perfect focusing and perfect calibration, you need 10 cm high features to register. Your face will be flat. Also, because the face loses contours as you go away from center, it will probably have one more lock point at the edge and then it would be "background".

I'm guessing it'll be a round disk, 10 cm high, sitting on a background that is "far away".

Oh, and, there's also the issue of not every scan actually having sharp edges. The tip of the nose, e.g., has no edges unless you can detect imperfections of the skin of the tip of the nose. You can't do that with an N900 camera. Even a DSLR would have trouble with that. The next centimeter will lock to the eyes, likely. Next few centimeters will also lock to the eyes. Further away, it will lock on hair, ear contour, etc. So even with a DSLR and 1-cm locking precision, you're unlikely to get anything over 5 levels out of a face. Think LEGO, but with big blocks.

And then there's the issue of the DOF (Depth of field). At 50 cm, DOF is at least 20 cm with a camera the size of N900's. That means that the whole face will be in focus. And with no physical aperture control, DOF can't be controlled.

At the said range, a DSLR with a high aperture would be lucky to get 3 shots that have a different focus line. Multi-focus techniques (focus stacking) for snapping angled (45 deg) miniatures rely on a 3-shot baseline. So even with true equipment, it's unlikely. The aperture necessary to get DOF in the order of centimeters at a decent distance is well outside camera range. We're talking flatbed scanners.

All this ignores the fact that it's not useful if you have to hold the camera in contact with a person's nose. To get their head in the frame, you need at least 30 cm distance. This limits your focusing ability to 40 and 50 cm before there is nothing to measure.
__________________
N900 dead and Nokia no longer replaces them. Thanks for all the fish.

Keep the forums clean: use "Thanks" button instead of the thank you post.

Last edited by ndi; 2010-11-15 at 02:21.
 

The Following 2 Users Say Thank You to ndi For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 14:06.