maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Multimedia (https://talk.maemo.org/forumdisplay.php?f=32)
-   -   [Request] 3D Scanner / Depthmap generator (https://talk.maemo.org/showthread.php?t=65601)

TiagoTiago 2010-11-14 09:55

[Request] 3D Scanner / Depthmap generator
 
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.

ndi 2010-11-14 11:17

Re: [Request] 3D Scanner / Depthmap generator
 
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.

kureyon 2010-11-14 11:21

Re: [Request] 3D Scanner / Depthmap generator
 
Now that usb host mode is somewhat working, just plugin a 3D laser range finder mapper.

TiagoTiago 2010-11-14 23:21

Re: [Request] 3D Scanner / Depthmap generator
 
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.

TiagoTiago 2010-11-15 00:04

Re: [Request] 3D Scanner / Depthmap generator
 
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?

MINKIN2 2010-11-15 00:06

Re: [Request] 3D Scanner / Depthmap generator
 
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?

TiagoTiago 2010-11-15 00:11

Re: [Request] 3D Scanner / Depthmap generator
 
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)

ndi 2010-11-15 02:02

Re: [Request] 3D Scanner / Depthmap generator
 
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.

TiagoTiago 2010-11-15 02:03

Re: [Request] 3D Scanner / Depthmap generator
 
How bad the scan of a face would be for example?

ndi 2010-11-15 02:14

Re: [Request] 3D Scanner / Depthmap generator
 
Quote:

Originally Posted by TiagoTiago (Post 873586)
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.


All times are GMT. The time now is 07:01.

vBulletin® Version 3.8.8