8

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 :-)

Elmi
  • 5,899
  • 15
  • 72
  • 143
  • 1
    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! – Micka Sep 02 '14 at 08:54
  • for the 2nd idea, look for "structured light" (kyle McDonald has done some nice work on that!). and you need 3 images for that. – berak Sep 02 '14 at 09:03
  • 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 object – biquette Sep 02 '14 at 09:50

3 Answers3

6

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.

rs_
  • 433
  • 4
  • 12
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!

JoeCodeCreations
  • 660
  • 2
  • 6
  • 19
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.