官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 吉安市| 高阳县| 马尔康县| 雅安市| 土默特右旗| 马尔康县| 麟游县| 卢湾区| 平顶山市| 鹤庆县| 沧州市| 荆州市| 莱芜市| 赤壁市| 博爱县| 通许县| 洪湖市| 灯塔市| 庆元县| 红安县| 板桥市| 农安县| 苗栗市| 韶山市| 余姚市| 孟连| 南溪县| 渑池县| 凤城市| 怀集县| 洪泽县| 西畴县| 罗源县| 长宁县| 阿拉善盟| 淮北市| 禹州市| 陆良县| 抚顺县| 万山特区| 晋中市|