[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46037] branches/soc-2011-tomato: Camera tracking: small improvements to tripod solver"

Sergey Sharybin sergey.vfx at gmail.com
Sat Apr 28 16:40:38 CEST 2012


Revision: 46037
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46037
Author:   nazgul
Date:     2012-04-28 14:40:37 +0000 (Sat, 28 Apr 2012)
Log Message:
-----------
Camera tracking: small improvements to tripod solver"

- Disable camera refirement due to it's not only refines camera intrinsics
  but also adjusts camera position which isn't necessary here
- Detect rigid transformation between initial frame and current instead
  of detecting it between two neighbour frames.
  This prevents accumulation of error and seems to be working better
  in footages i've tested.

Modified Paths:
--------------
    branches/soc-2011-tomato/extern/libmv/libmv/simple_pipeline/modal_solver.cc
    branches/soc-2011-tomato/extern/libmv/libmv-capi.cpp
    branches/soc-2011-tomato/extern/libmv/libmv-capi.h
    branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py
    branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c

Modified: branches/soc-2011-tomato/extern/libmv/libmv/simple_pipeline/modal_solver.cc
===================================================================
--- branches/soc-2011-tomato/extern/libmv/libmv/simple_pipeline/modal_solver.cc	2012-04-28 13:37:44 UTC (rev 46036)
+++ branches/soc-2011-tomato/extern/libmv/libmv/simple_pipeline/modal_solver.cc	2012-04-28 14:40:37 UTC (rev 46037)
@@ -91,19 +91,15 @@
 
           ProjectMarkerOnSphere(marker, X);
 
-          points.push_back(R * point->X);
+          points.push_back(point->X);
           reference_points.push_back(X);
         }
       }
     }
 
     if (points.size()) {
-      Mat3 dR = Mat3::Identity();
-
-      // Find rigid delta transformation from previous image to current image
-      RigidRegistration(reference_points, points, dR);
-
-      R *= dR;
+      // Find rigid delta transformation to current image
+      RigidRegistration(reference_points, points, R);
     }
 
     reconstruction->InsertCamera(image, R, Vec3::Zero());

Modified: branches/soc-2011-tomato/extern/libmv/libmv-capi.cpp
===================================================================
--- branches/soc-2011-tomato/extern/libmv/libmv-capi.cpp	2012-04-28 13:37:44 UTC (rev 46036)
+++ branches/soc-2011-tomato/extern/libmv/libmv-capi.cpp	2012-04-28 14:40:37 UTC (rev 46037)
@@ -460,7 +460,7 @@
 	return (libmv_Reconstruction *)libmv_reconstruction;
 }
 
-struct libmv_Reconstruction *libmv_solveModal(struct libmv_Tracks *tracks, int refine_intrinsics, double focal_length,
+struct libmv_Reconstruction *libmv_solveModal(struct libmv_Tracks *tracks, double focal_length,
 			double principal_x, double principal_y, double k1, double k2, double k3,
 			reconstruct_progress_update_cb progress_update_callback, void *callback_customdata)
 {
@@ -488,11 +488,6 @@
 
 	libmv::ModalSolver(normalized_tracks, reconstruction, &update_callback);
 
-	if (refine_intrinsics) {
-		libmv_solveRefineIntrinsics((libmv::Tracks *)tracks, intrinsics, reconstruction,
-			refine_intrinsics, progress_update_callback, callback_customdata);
-	}
-
 	progress_update_callback(callback_customdata, 1.0, "Finishing solution");
 	libmv_reconstruction->tracks = *(libmv::Tracks *)tracks;
 	libmv_reconstruction->error = libmv::EuclideanReprojectionError(*(libmv::Tracks *)tracks, *reconstruction, *intrinsics);

Modified: branches/soc-2011-tomato/extern/libmv/libmv-capi.h
===================================================================
--- branches/soc-2011-tomato/extern/libmv/libmv-capi.h	2012-04-28 13:37:44 UTC (rev 46036)
+++ branches/soc-2011-tomato/extern/libmv/libmv-capi.h	2012-04-28 14:40:37 UTC (rev 46037)
@@ -68,7 +68,7 @@
 struct libmv_Reconstruction *libmv_solveReconstruction(struct libmv_Tracks *tracks, int keyframe1, int keyframe2,
 			int refine_intrinsics, double focal_length, double principal_x, double principal_y, double k1, double k2, double k3,
 			reconstruct_progress_update_cb progress_update_callback, void *callback_customdata);
-struct libmv_Reconstruction *libmv_solveModal(struct libmv_Tracks *tracks, int refine_intrinsics, double focal_length,
+struct libmv_Reconstruction *libmv_solveModal(struct libmv_Tracks *tracks, double focal_length,
 			double principal_x, double principal_y, double k1, double k2, double k3,
 			reconstruct_progress_update_cb progress_update_callback, void *callback_customdata);
 int libmv_reporojectionPointForTrack(struct libmv_Reconstruction *libmv_reconstruction, int track, double pos[3]);

Modified: branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py	2012-04-28 13:37:44 UTC (rev 46036)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py	2012-04-28 14:40:37 UTC (rev 46037)
@@ -256,7 +256,7 @@
         col.prop(settings, "keyframe_b")
 
         col = layout.column(align=True)
-        col.active = tracking_object.is_camera
+        col.active = tracking_object.is_camera and not settings.use_tripod_solver
         col.label(text="Refine:")
         col.prop(settings, "refine_intrinsics", text="")
 

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c	2012-04-28 13:37:44 UTC (rev 46036)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/tracking.c	2012-04-28 14:40:37 UTC (rev 46037)
@@ -1902,7 +1902,6 @@
 
 	if (context->motion_flag & TRACKING_MOTION_MODAL) {
 		context->reconstruction = libmv_solveModal(context->tracks,
-			context->refine_flags,
 			context->focal_length,
 			context->principal_point[0], context->principal_point[1],
 			context->k1, context->k2, context->k3,




More information about the Bf-blender-cvs mailing list