3D scanning possible with OpenCV?
Asked Answered
S

3

9

this is a general question where I'm just looking for a starting point, not for a complete solution.

I plan to do some 3D-scanning, means checking a surface and generationg a 3D model out of it. AFAIK there are two methods for it: one with a laser raster-scanning the whole surface and one with a camera where a grid is projected over the surface (not sure if one picture with this grid is enough or if more of it have to be done).

My question: does OpenCV support the second method using the camera? If yes: which classes/functions are involved?

All hints are welcome :-)

Silvasilvain answered 2/9, 2014 at 8:47 Comment(3)
afaik openCV doesn't support the method, but it has some functionality that might help you implementing it. Matrix operations, camera calibration etc. Another existing method btw is stereo imaging. OpenCV has some stereo vision methods!Precise
for the 2nd idea, look for "structured light" (kyle McDonald has done some nice work on that!). and you need 3 images for that.Trimble
The second idea is indeed structured light. But there exist methods that can works with a single image. Look this paper for example :Dense 3D reconstruction method using a single pattern for fast moving objectGoodly
M
7

The second method would need a projector and a camera. There is a third class of algorithms called structure-from-motion that allows you to capture 3D (sparse point clouds) from multiple images. The sparse point cloud can later be converted to a dense surface using multi-view stereo and a mesh model can be reconstructed using Poisson Surface Reconstruction. Though you can implement the above things using OpenCV, I would recommend existing softwares.

Sparse 3D Reconstruction

Bundler : http://www.cs.cornell.edu/~snavely/bundler/

VisualSFM : http://ccwu.me/vsfm/

Multiview Stereo (MVS)

CMVS : http://www.di.ens.fr/cmvs/

Fusion : http://www.gris.informatik.tu-darmstadt.de/projects/multiscale-depthmap-fusion/

If you have access to a machine with a GPU, I would highly recommend VisualSFM, as it integrates Sparse Reconstruction with MVS.

Megara answered 15/8, 2015 at 21:40 Comment(0)
I
3

Look into Kanade, optical flow.

You basically can take goodFeaturesToTrack and find features in frame 1, then in frame 2 you can find the same features. depending on their displacement you can find depth or 3D.

Hope this helps!

Illustrator answered 22/1, 2015 at 20:13 Comment(0)
S
0

I done a stereo vision project and while 3d scanning wasn't the aim the calibration files generated using the chessboard. Just for fun i put the point clouds into a 3rd party 3d modelling software and although the image was pretty bad you could make out some depth. Cameras were in a very low resolution like 640 x 480.

So i think it's possible but you need to use as high a resolution as possible and you have to calibrate each camera and also use a formula that takes into account camera properties and distance between both cameras.

Sensor answered 3/3, 2022 at 20:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.