-1

I have to do 3D reconstruction from 2D images. My teacher told me that the first step is to get the camera matrix, by taking some pictures to a chessboard. I have already these photos and I am using OpenCV to get the camera matrix. The matrix has this form:

Camera Matrix

What should I do now? My teacher told me I have to get some features from the images and then match them... But how do I use this matrix? I read about Structure-from-motion but I didn't find anything about using this matrix. Which is the process once I have the matches from the images?

  • *Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results* – Manu343726 Dec 08 '13 at 17:24
  • To be honest, if you don't know what the internal camera calibration matrix is or does, you have *a lot* of studying to do before you can solve this problem. – Hannes Ovrén Dec 08 '13 at 17:29
  • @Manu343726, That quote is irrelevant here since the OP is not asking for code. – Anish Ramaswamy Dec 08 '13 at 20:37
  • @kigurai I do know that this matrix gives me the focal length and the image centers. I do know that this matrix represents intrinsic parameters. My question is about how should I use this matrix, since according to the articles I read, authors mention another matrix: the fundamental matrix. So maybe I'm wrong and I don't need this matrix. Thanks – user3080294 Dec 08 '13 at 22:04

1 Answers1

9

If you are going down the structure from motion route, what you are trying to do is far from trivial, so make sure you and your teacher understand that.

This matrix is called the camera calibration matrix (or in photogrammetric terms, the interior orientation). Generally Structure from Motion algorithms require this for each camera, from there, you must determine the exterior orientation of each camera frame. The exerior orentation includes the X,Y,Z position in space as well as a description of the pointing direction for the camera (often described in euler angles). This can be done using the matching features. Once you have the exterior orentation, you can use that information with the features to do triangulation of the matching features.

So to recap the general SfM process:

  1. Calibrate camera (you have this done).
  2. Collect images across scene.
  3. Find and Match features between each image (Look at OpenCV's feature2d module).
  4. Using matching features to estimate camera pose of each frame
  5. Use camera pose and matching features to triangulate 3D structure for each matching point

The final step in most SfM processes use a Bundle Adjustment to optimize the structure (and camera pose) for the scene. This is generally very complicated to code, so it is worth looking at pre-existing implementations such as Lourakis' SBA.

If you want to look at popular existing SfM implementations check out Bundler written by Noah Snavley. Also, for dense 3d reconstruction, look at PMVS. Finally for a comprehensive workflow, check out VisualSfM.

If what you are looking for is more like a stereo camera based 3d reconstruction, there are lots of tutorials online about using OpenCV for that.

David Nilosek
  • 1,422
  • 9
  • 13
  • Thank you so much..I just talked with my teacher and he explains me that I must try to use a stereo-camera approach, but with a simple camera, and using this approach, try to get a dense reconstruction. Is there any complication by not using a stereo camera? – user3080294 Dec 08 '13 at 22:34
  • A stereo camera gives you a significant advantage, because you know the configuration of the two cameras relative to each other. When you try and use a single camera from multiple views, you now have to solve for the position of each view, which becomes a far more difficult problem. – David Nilosek Dec 09 '13 at 00:29