Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top