[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60780] trunk/blender: Get rid of Allow Fallback option

Sergey Sharybin sergey.vfx at gmail.com
Tue Oct 15 17:21:41 CEST 2013


Revision: 60780
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60780
Author:   nazgul
Date:     2013-10-15 15:21:41 +0000 (Tue, 15 Oct 2013)
Log Message:
-----------
Get rid of Allow Fallback option

It was rather confusing from the user usage point
of view and didn't get so much improvement after
new bundle adjuster was added.

In the future we might want to switch resection
to PPnP algorithm, which could also might be a
nice alternative to fallback option.

Modified Paths:
--------------
    trunk/blender/extern/libmv/libmv/multiview/euclidean_resection.cc
    trunk/blender/extern/libmv/libmv/multiview/euclidean_resection.h
    trunk/blender/extern/libmv/libmv/simple_pipeline/pipeline.cc
    trunk/blender/extern/libmv/libmv/simple_pipeline/pipeline.h
    trunk/blender/extern/libmv/libmv/simple_pipeline/reconstruction.h
    trunk/blender/extern/libmv/libmv/simple_pipeline/resect.cc
    trunk/blender/extern/libmv/libmv/simple_pipeline/resect.h
    trunk/blender/extern/libmv/libmv-capi.cc
    trunk/blender/extern/libmv/libmv-capi.h
    trunk/blender/release/scripts/startup/bl_ui/space_clip.py
    trunk/blender/source/blender/blenkernel/intern/tracking.c
    trunk/blender/source/blender/blenloader/intern/readfile.c
    trunk/blender/source/blender/makesdna/DNA_tracking_types.h
    trunk/blender/source/blender/makesrna/intern/rna_tracking.c

Modified: trunk/blender/extern/libmv/libmv/multiview/euclidean_resection.cc
===================================================================
--- trunk/blender/extern/libmv/libmv/multiview/euclidean_resection.cc	2013-10-15 15:21:33 UTC (rev 60779)
+++ trunk/blender/extern/libmv/libmv/multiview/euclidean_resection.cc	2013-10-15 15:21:41 UTC (rev 60780)
@@ -37,23 +37,21 @@
   
 bool EuclideanResectionPPnP(const Mat2X &x_camera,
                             const Mat3X &X_world,
-                            Mat3 *R, Vec3 *t,
-                            double tolerance);
+                            Mat3 *R, Vec3 *t);
 
 bool EuclideanResection(const Mat2X &x_camera,
                         const Mat3X &X_world,
                         Mat3 *R, Vec3 *t,
-                        ResectionMethod method,
-                        double success_threshold) {
+                        ResectionMethod method) {
   switch (method) {
     case RESECTION_ANSAR_DANIILIDIS:
       EuclideanResectionAnsarDaniilidis(x_camera, X_world, R, t);
       break;
     case RESECTION_EPNP:
-      return EuclideanResectionEPnP(x_camera, X_world, R, t, success_threshold);
+      return EuclideanResectionEPnP(x_camera, X_world, R, t);
       break;
     case RESECTION_PPNP:
-      return EuclideanResectionPPnP(x_camera, X_world, R, t, success_threshold);
+      return EuclideanResectionPPnP(x_camera, X_world, R, t);
       break;
     default:
       LOG(FATAL) << "Unknown resection method.";
@@ -444,8 +442,7 @@
 
 bool EuclideanResectionEPnP(const Mat2X &x_camera,
                             const Mat3X &X_world,
-                            Mat3 *R, Vec3 *t,
-                            double success_threshold) {
+                            Mat3 *R, Vec3 *t) {
   CHECK(x_camera.cols() == X_world.cols());
   CHECK(x_camera.cols() > 3);
   size_t num_points = X_world.cols();
@@ -553,14 +550,8 @@
   //
   // TODO(keir): Decide if setting this to infinity, effectively disabling the
   // check, is the right approach. So far this seems the case.
-  //
-  // TODO(sergey): Made it an option for now, in some cases it makes sense to
-  // still fallback to reprojection solution
-  // For details see bug [#32765] from Blender bug tracker
+   double kSuccessThreshold = std::numeric_limits<double>::max();
 
-  // double kSuccessThreshold = std::numeric_limits<double>::max();
-  double kSuccessThreshold = success_threshold;
-
   // Find the first possible solution for R, t corresponding to:
   // Betas          = [b00 b01 b11 b02 b12 b22 b03 b13 b23 b33]
   // Betas_approx_1 = [b00 b01     b02         b03]
@@ -728,8 +719,7 @@
 // other hand, it did work on the first try.
 bool EuclideanResectionPPnP(const Mat2X &x_camera,
                             const Mat3X &X_world,
-                            Mat3 *R, Vec3 *t,
-                            double tolerance) {
+                            Mat3 *R, Vec3 *t) {
   int n = x_camera.cols();
   Mat Z = Mat::Zero(n, n);
   Vec e = Vec::Ones(n);
@@ -750,7 +740,7 @@
   Mat E(n, 3);
   
   int iteration = 0;
-  tolerance = 1e-5;
+  double tolerance = 1e-5;
   // TODO(keir): The limit of 100 can probably be reduced, but this will require
   // some investigation.
   while (error > tolerance && iteration < 100) {

Modified: trunk/blender/extern/libmv/libmv/multiview/euclidean_resection.h
===================================================================
--- trunk/blender/extern/libmv/libmv/multiview/euclidean_resection.h	2013-10-15 15:21:33 UTC (rev 60779)
+++ trunk/blender/extern/libmv/libmv/multiview/euclidean_resection.h	2013-10-15 15:21:41 UTC (rev 60780)
@@ -49,14 +49,11 @@
  * \param R         Solution for the camera rotation matrix
  * \param t         Solution for the camera translation vector
  * \param method    The resection method to use.
- * \param success_threshold  Threshold of an error which is still considered a success
- *                           (currently used by EPnP algorithm only)
  */
 bool EuclideanResection(const Mat2X &x_camera,
                         const Mat3X &X_world,
                         Mat3 *R, Vec3 *t,
-                        ResectionMethod method = RESECTION_EPNP,
-                        double success_threshold = 1e-3);
+                        ResectionMethod method = RESECTION_EPNP);
 
 /**
  * Computes the extrinsic parameters, R and t for a calibrated camera
@@ -117,7 +114,6 @@
  * \param X_world 3D points in the world coordinate system
  * \param R       Solution for the camera rotation matrix
  * \param t       Solution for the camera translation vector
- * \param success_threshold  Threshold of an error which is still considered a success
  *
  * This is the algorithm described in:
  * "{EP$n$P: An Accurate $O(n)$ Solution to the P$n$P Problem", by V. Lepetit
@@ -126,8 +122,7 @@
  */
 bool EuclideanResectionEPnP(const Mat2X &x_camera,
                             const Mat3X &X_world,
-                            Mat3 *R, Vec3 *t,
-                            double success_threshold = 1e-3);
+                            Mat3 *R, Vec3 *t);
 
 }  // namespace euclidean_resection
 }  // namespace libmv

Modified: trunk/blender/extern/libmv/libmv/simple_pipeline/pipeline.cc
===================================================================
--- trunk/blender/extern/libmv/libmv/simple_pipeline/pipeline.cc	2013-10-15 15:21:33 UTC (rev 60779)
+++ trunk/blender/extern/libmv/libmv/simple_pipeline/pipeline.cc	2013-10-15 15:21:41 UTC (rev 60780)
@@ -51,10 +51,9 @@
     EuclideanBundle(tracks, reconstruction);
   }
 
-  static bool Resect(const ReconstructionOptions &options,
-                     const vector<Marker> &markers,
+  static bool Resect(const vector<Marker> &markers,
                      EuclideanReconstruction *reconstruction, bool final_pass) {
-    return EuclideanResect(options, markers, reconstruction, final_pass);
+    return EuclideanResect(markers, reconstruction, final_pass);
   }
 
   static bool Intersect(const vector<Marker> &markers,
@@ -90,10 +89,8 @@
     ProjectiveBundle(tracks, reconstruction);
   }
 
-  static bool Resect(const ReconstructionOptions &options,
-                     const vector<Marker> &markers,
+  static bool Resect(const vector<Marker> &markers,
                      ProjectiveReconstruction *reconstruction, bool final_pass) {
-    (void) options;  // Ignored.
     (void) final_pass;  // Ignored.
 
     return ProjectiveResect(markers, reconstruction);
@@ -144,7 +141,6 @@
 
 template<typename PipelineRoutines>
 void InternalCompleteReconstruction(
-    const ReconstructionOptions &options,
     const Tracks &tracks,
     typename PipelineRoutines::Reconstruction *reconstruction,
     ProgressUpdateCallback *update_callback = NULL) {
@@ -217,7 +213,7 @@
       if (reconstructed_markers.size() >= 5) {
         CompleteReconstructionLogProgress(update_callback,
                                           (double)tot_resects/(max_image));
-        if (PipelineRoutines::Resect(options, reconstructed_markers,
+        if (PipelineRoutines::Resect(reconstructed_markers,
                                      reconstruction, false)) {
           num_resects++;
           tot_resects++;
@@ -254,7 +250,7 @@
     if (reconstructed_markers.size() >= 5) {
       CompleteReconstructionLogProgress(update_callback,
                                         (double)tot_resects/(max_image));
-      if (PipelineRoutines::Resect(options, reconstructed_markers,
+      if (PipelineRoutines::Resect(reconstructed_markers,
                                    reconstruction, true)) {
         num_resects++;
         LG << "Ran final Resect() for image " << image;
@@ -341,21 +337,17 @@
                                                                intrinsics);
 }
 
-void EuclideanCompleteReconstruction(const ReconstructionOptions &options,
-                                     const Tracks &tracks,
+void EuclideanCompleteReconstruction(const Tracks &tracks,
                                      EuclideanReconstruction *reconstruction,
                                      ProgressUpdateCallback *update_callback) {
-  InternalCompleteReconstruction<EuclideanPipelineRoutines>(options,
-                                                            tracks,
+  InternalCompleteReconstruction<EuclideanPipelineRoutines>(tracks,
                                                             reconstruction,
                                                             update_callback);
 }
 
-void ProjectiveCompleteReconstruction(const ReconstructionOptions &options,
-                                      const Tracks &tracks,
+void ProjectiveCompleteReconstruction(const Tracks &tracks,
                                       ProjectiveReconstruction *reconstruction) {
-  InternalCompleteReconstruction<ProjectivePipelineRoutines>(options,
-                                                             tracks,
+  InternalCompleteReconstruction<ProjectivePipelineRoutines>(tracks,
                                                              reconstruction);
 }
 

Modified: trunk/blender/extern/libmv/libmv/simple_pipeline/pipeline.h
===================================================================
--- trunk/blender/extern/libmv/libmv/simple_pipeline/pipeline.h	2013-10-15 15:21:33 UTC (rev 60779)
+++ trunk/blender/extern/libmv/libmv/simple_pipeline/pipeline.h	2013-10-15 15:21:41 UTC (rev 60780)
@@ -39,9 +39,6 @@
     repeated until all points and cameras are estimated. Periodically, bundle
     adjustment is run to ensure a quality reconstruction.
 
-    \a options are used to define some specific befaviours based on settings
-    see documentation for ReconstructionOptions
-
     \a tracks should contain markers used in the reconstruction.
     \a reconstruction should contain at least some 3D points or some estimated
     cameras. The minimum number of cameras is two (with no 3D points) and the
@@ -50,7 +47,6 @@
     \sa EuclideanResect, EuclideanIntersect, EuclideanBundle
 */
 void EuclideanCompleteReconstruction(
-        const ReconstructionOptions &options,
         const Tracks &tracks,
         EuclideanReconstruction *reconstruction,
         ProgressUpdateCallback *update_callback = NULL);
@@ -68,9 +64,6 @@
     repeated until all points and cameras are estimated. Periodically, bundle
     adjustment is run to ensure a quality reconstruction.
 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list