Commit: 5977d05b55a590600a4894d80466bb3d0d8c201f
Author: Tianwei Shen
Date:   Wed Jun 8 17:31:03 2016 +0800
Branches: soc-2016-multiview
https://developer.blender.org/rB5977d05b55a590600a4894d80466bb3d0d8c201f

intermediate result, ready to move into libmv

===================================================================

M       intern/libmv/intern/reconstructionN.cc
M       intern/libmv/intern/reconstructionN.h
M       source/blender/blenkernel/intern/tracking_correspondence.c

===================================================================

diff --git a/intern/libmv/intern/reconstructionN.cc 
b/intern/libmv/intern/reconstructionN.cc
index d73362d..6a1fd7e 100644
--- a/intern/libmv/intern/reconstructionN.cc
+++ b/intern/libmv/intern/reconstructionN.cc
@@ -19,7 +19,7 @@
  * All rights reserved.
  *
  * Contributor(s): Blender Foundation,
- *                 Sergey Sharybin
+ *                 Tianwei Shen
  *
  * ***** END GPL LICENSE BLOCK *****
  */
@@ -55,3 +55,14 @@ struct libmv_ReconstructionN {
   double error;
   bool is_valid;
 };
+
+libmv_ReconstructionN** libmv_solveMultiviewReconstruction(
+        const int clip_num,
+        const libmv_TracksN **all_libmv_tracks,
+        const libmv_CameraIntrinsicsOptions *libmv_camera_intrinsics_options,
+        libmv_ReconstructionOptions *libmv_reconstruction_options,
+        reconstruct_progress_update_cb progress_update_callback,
+        void* callback_customdata)
+{
+       return (libmv_ReconstructionN**) NULL;
+}
diff --git a/intern/libmv/intern/reconstructionN.h 
b/intern/libmv/intern/reconstructionN.h
index 0908e3d..a885ed9 100644
--- a/intern/libmv/intern/reconstructionN.h
+++ b/intern/libmv/intern/reconstructionN.h
@@ -19,13 +19,15 @@
  * All rights reserved.
  *
  * Contributor(s): Blender Foundation,
- *                 Sergey Sharybin
+ *                 Tianwei Shen
  *
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#ifndef LIBMV_C_API_RECONSTRUCTION_H_
-#define LIBMV_C_API_RECONSTRUCTION_H_
+#ifndef LIBMV_C_API_RECONSTRUCTIONN_H_
+#define LIBMV_C_API_RECONSTRUCTIONN_H_
+
+#include "intern/reconstruction.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -33,8 +35,16 @@ extern "C" {
 
 typedef struct libmv_ReconstructionN libmv_ReconstructionN;
 
+libmv_ReconstructionN** libmv_solveMultiviewReconstruction(
+        const int clip_num,
+        const struct libmv_TracksN **all_libmv_tracks,
+        const libmv_CameraIntrinsicsOptions *libmv_camera_intrinsics_options,
+        libmv_ReconstructionOptions* libmv_reconstruction_options,
+        reconstruct_progress_update_cb progress_update_callback,
+        void* callback_customdata);
+
 #ifdef __cplusplus
 }
 #endif
 
-#endif   // LIBMV_C_API_RECONSTRUCTION_H_
+#endif   // LIBMV_C_API_RECONSTRUCTIONN_H_
diff --git a/source/blender/blenkernel/intern/tracking_correspondence.c 
b/source/blender/blenkernel/intern/tracking_correspondence.c
index 7f4a462..7f67b2e 100644
--- a/source/blender/blenkernel/intern/tracking_correspondence.c
+++ b/source/blender/blenkernel/intern/tracking_correspondence.c
@@ -314,28 +314,30 @@ void 
BKE_tracking_multiview_reconstruction_solve(MovieMultiviewReconstructContex
        progressdata.stats_message = stats_message;
        progressdata.message_size = message_size;
 
-       //reconstructionOptionsFromContext(&reconstruction_options, context);
-
-       //if (context->motion_flag & TRACKING_MOTION_MODAL) {
-       //      context->reconstruction = libmv_solveModal(context->tracks,
-       //                                                 
&context->camera_intrinsics_options,
-       //                                                 
&reconstruction_options,
-       //                                                 
multiview_reconstruct_update_solve_cb, &progressdata);
-       //}
-       //else {
-       //      context->reconstruction = 
libmv_solveReconstruction(context->tracks,
-       //                                                          
&context->camera_intrinsics_options,
-       //                                                          
&reconstruction_options,
-       //                                                          
multiview_reconstruct_update_solve_cb, &progressdata);
-
-       //      if (context->select_keyframes) {
-       //              /* store actual keyframes used for reconstruction to 
update them in the interface later */
-       //              context->keyframe1 = reconstruction_options.keyframe1;
-       //              context->keyframe2 = reconstruction_options.keyframe2;
-       //      }
-       //}
+       reconstructionOptionsFromContext(&reconstruction_options, context);
+
+       if (context->motion_flag & TRACKING_MOTION_MODAL) {
+               // TODO(tianwei): leave tracking solve object for now
+               //context->reconstruction = libmv_solveModal(context->tracks,
+               //                                           
&context->camera_intrinsics_options,
+               //                                           
&reconstruction_options,
+               //                                           
multiview_reconstruct_update_solve_cb, &progressdata);
+       }
+       else {
+               context->all_reconstruction = 
libmv_solveMultiviewReconstruction(context->clip_num,
+                                                                               
 context->all_tracks,
+                                                                               
 context->all_camera_intrinsics_options,
+                                                                               
 &reconstruction_options,
+                                                                               
 multiview_reconstruct_update_solve_cb, &progressdata);
+
+               if (context->select_keyframes) {
+                       /* store actual keyframes used for reconstruction to 
update them in the interface later */
+                       context->keyframe1 = reconstruction_options.keyframe1;
+                       context->keyframe2 = reconstruction_options.keyframe2;
+               }
+       }
 
-       //error = libmv_reprojectionError(context->reconstruction);
+       //error = libmv_reprojectionError(context->all_reconstruction);
 
        //context->reprojection_error = error;
        context->reprojection_error = 0;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to