Structure from Motion concepts
The first discrimination we should make is the difference between stereo (or indeed any multiview) and 3D reconstruction using calibrated rigs and SfM. A rig of two or more cameras assumes that we already know the motion between the cameras, while in SfM, we don't know what this motion is and we wish to find it. Calibrated rigs, from a simplistic point of view, allow a much more accurate reconstruction of 3D geometry because there is no error in estimating the distance and rotation between the cameras, it is already known. The first step in implementing an SfM system is finding the motion between the cameras. OpenCV may help us in a number of ways to obtain this motion, specifically using the findFundamentalMat and findEssentialMat functions.
Let's think for one moment of the goal behind choosing an SfM algorithm. In most cases, we wish to obtain the geometry of the scene, for example, where objects are in relation to the camera and what their form is. Having found the motion between the cameras picturing the same scene, from a reasonably similar point of view, we would now like to reconstruct the geometry. In Computer Vision jargon, this is known as triangulation, and there are plenty of ways to go about it. It may be done by way of ray intersection, where we construct two rays-one from each camera's center of projection and a point on each of the image planes. The intersection of these rays in space will, ideally, intersect at one 3D point in the real world that is imaged in each camera, as shown in the following diagram:

In reality, ray intersection is highly unreliable; H&Z recommend against it. This is because the rays usually do not intersect, making us fall back to using the middle point on the shortest segment connecting the two rays. OpenCV contains a simple API for a more accurate form of triangulation--the triangulatePoints function--so we do not need to code this part on our own.
After you learn how to recover 3D geometry from two views, we will see how we can incorporate more views of the same scene to get an even richer reconstruction. At that point, most SfM methods try to optimize the bundle of estimated positions of our cameras and 3D points by means of Bundle Adjustment, in the Refinement of the reconstruction section. OpenCV contains the means for Bundle Adjustment in its new Image Stitching Toolbox. However, the beauty of working with OpenCV and C++ is the abundance of external tools that can be easily integrated into the pipeline. We will, therefore, see how to integrate an external bundle adjuster, the Ceres nonlinear optimization package.
Now that we have sketched an outline of our approach to SfM using OpenCV, we will see how each element can be implemented.
- Android Wearable Programming
- 玩轉(zhuǎn)Scratch少兒趣味編程
- Redis入門指南(第3版)
- 架構(gòu)不再難(全5冊)
- 高級C/C++編譯技術(shù)(典藏版)
- Learning Python Design Patterns(Second Edition)
- Python編程從0到1(視頻教學版)
- Vue.js應(yīng)用測試
- Orleans:構(gòu)建高性能分布式Actor服務(wù)
- 愛上C語言:C KISS
- Python數(shù)據(jù)分析與挖掘?qū)崙?zhàn)(第2版)
- ServiceDesk Plus 8.x Essentials
- Mastering MeteorJS Application Development
- HTML+CSS+JavaScript前端開發(fā)(慕課版)
- Hands-On Full Stack Development with Angular 5 and Firebase