[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59944] branches/soc-2013-motion_track/ extern/libmv/libmv/simple_pipeline: Code cleanup: modal solver explicitly single-camera

Joseph Mansfield sftrabbit at gmail.com
Mon Sep 9 11:42:37 CEST 2013


Revision: 59944
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59944
Author:   sftrabbit
Date:     2013-09-09 09:42:37 +0000 (Mon, 09 Sep 2013)
Log Message:
-----------
Code cleanup: modal solver explicitly single-camera

Non-functional change to the modal solver to explicitly document it as being a single-camera algorithm, working with only camera 0.

Modified Paths:
--------------
    branches/soc-2013-motion_track/extern/libmv/libmv/simple_pipeline/modal_solver.cc
    branches/soc-2013-motion_track/extern/libmv/libmv/simple_pipeline/modal_solver.h

Modified: branches/soc-2013-motion_track/extern/libmv/libmv/simple_pipeline/modal_solver.cc
===================================================================
--- branches/soc-2013-motion_track/extern/libmv/libmv/simple_pipeline/modal_solver.cc	2013-09-09 09:33:34 UTC (rev 59943)
+++ branches/soc-2013-motion_track/extern/libmv/libmv/simple_pipeline/modal_solver.cc	2013-09-09 09:42:37 UTC (rev 59944)
@@ -99,6 +99,7 @@
 void ModalSolver(const Tracks &tracks,
                  EuclideanReconstruction *reconstruction,
                  ProgressUpdateCallback *update_callback) {
+  static const int MODAL_CAMERA = 0;
   int max_image = tracks.MaxImage();
   int max_track = tracks.MaxTrack();
 
@@ -111,7 +112,7 @@
   ceres::AngleAxisToQuaternion(&zero_rotation(0), &quaternion(0));
 
   for (int image = 0; image <= max_image; ++image) {
-    vector<Marker> all_markers = tracks.MarkersInImage(0, image);
+    vector<Marker> all_markers = tracks.MarkersInImage(MODAL_CAMERA, image);
 
     ModalSolverLogProress(update_callback, (float) image / max_image);
 
@@ -124,7 +125,6 @@
     // STEP 1: Estimate rotation analytically.
     Mat3 current_R;
     ceres::QuaternionToRotation(&quaternion(0), &current_R(0, 0));
-
     // Construct point cloud for current and previous images,
     // using markers appear at current image for which we know
     // 3D positions.
@@ -218,7 +218,7 @@
     // Convert quaternion to rotation matrix.
     Mat3 R;
     ceres::QuaternionToRotation(&quaternion(0), &R(0, 0));
-    reconstruction->InsertView(0, image, R, Vec3::Zero());
+    reconstruction->InsertView(MODAL_CAMERA, image, R, Vec3::Zero());
 
     // STEP 3: reproject all new markers appeared at image
 
@@ -226,7 +226,7 @@
     // and reproject them on sphere to obtain 3D position/
     for (int track = 0; track <= max_track; ++track) {
       if (!reconstruction->PointForTrack(track)) {
-        Marker marker = tracks.MarkerInImageForTrack(0, image, track);
+        Marker marker = tracks.MarkerInImageForTrack(MODAL_CAMERA, image, track);
 
         if (marker.image == image) {
           // New track appeared on this image,

Modified: branches/soc-2013-motion_track/extern/libmv/libmv/simple_pipeline/modal_solver.h
===================================================================
--- branches/soc-2013-motion_track/extern/libmv/libmv/simple_pipeline/modal_solver.h	2013-09-09 09:33:34 UTC (rev 59943)
+++ branches/soc-2013-motion_track/extern/libmv/libmv/simple_pipeline/modal_solver.h	2013-09-09 09:42:37 UTC (rev 59944)
@@ -29,15 +29,16 @@
 
 /*!
     This solver solves such camera motion as tripod rotation, reconstructing
-    only camera motion itself. Bundles are not reconstructing properly, they're
-    just getting projected onto sphere.
+    only camera motion itself. Bundles are not reconstructing properly; they're
+    projected onto sphere.
 
-    Markers from tracks object would be used for recosntruction, and algorithm
-    assumes thir's positions are undistorted already and they're in nnormalized
-    space.
+    Markers from tracks object are used for reconstruction. The algorithm
+    assumes their positions are undistorted already and that they're in
+    normalized space.
 
-    Reconstructed cameras and projected bundles would be added to reconstruction
-    object.
+    Reconstructed cameras and projected bundles are added to the given
+    reconstruction object. Only camera 0 is reconstructed, using only the
+    markers associated with camera 0.
 */
 void ModalSolver(const Tracks &tracks,
                  EuclideanReconstruction *reconstruction,




More information about the Bf-blender-cvs mailing list