[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39101] branches/soc-2011-tomato/extern/ libmv/patches: Commiting patches needed for bundling libmv.

Sergey Sharybin g.ulairi at gmail.com
Sat Aug 6 16:49:01 CEST 2011


Revision: 39101
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39101
Author:   nazgul
Date:     2011-08-06 14:49:01 +0000 (Sat, 06 Aug 2011)
Log Message:
-----------
Commiting patches needed for bundling libmv.

I've used git where patch files were in gitignore, that's why
this files were missed in repo.

Added Paths:
-----------
    branches/soc-2011-tomato/extern/libmv/patches/bundle_tweaks.patch
    branches/soc-2011-tomato/extern/libmv/patches/fast.patch
    branches/soc-2011-tomato/extern/libmv/patches/max_image.patch
    branches/soc-2011-tomato/extern/libmv/patches/max_track.patch
    branches/soc-2011-tomato/extern/libmv/patches/snrptinf_fix.patch
    branches/soc-2011-tomato/extern/libmv/patches/v3d_verbosity.patch

Added: branches/soc-2011-tomato/extern/libmv/patches/bundle_tweaks.patch
===================================================================
--- branches/soc-2011-tomato/extern/libmv/patches/bundle_tweaks.patch	                        (rev 0)
+++ branches/soc-2011-tomato/extern/libmv/patches/bundle_tweaks.patch	2011-08-06 14:49:01 UTC (rev 39101)
@@ -0,0 +1,122 @@
+diff --git a/src/libmv/logging/logging.h b/src/libmv/logging/logging.h
+index 067da52..af86c4b 100644
+--- a/src/libmv/logging/logging.h
++++ b/src/libmv/logging/logging.h
+@@ -21,7 +21,7 @@
+ #ifndef LIBMV_LOGGING_LOGGING_H
+ #define LIBMV_LOGGING_LOGGING_H
+ 
+-#include "third_party/glog/src/glog/logging.h"
++#include "glog/logging.h"
+ 
+ #define LG LOG(INFO)
+ #define V0 LOG(INFO)
+diff --git a/src/third_party/glog/src/glog/logging.h b/src/third_party/glog/src/glog/logging.h
+index 57615ef..a58d478 100644
+--- a/src/third_party/glog/src/glog/logging.h
++++ b/src/third_party/glog/src/glog/logging.h
+@@ -33,6 +33,7 @@
+ // Pretty much everybody needs to #include this file so that they can
+ // log various happenings.
+ //
++
+ #ifndef _LOGGING_H_
+ #define _LOGGING_H_
+ 
+diff --git a/src/third_party/glog/src/logging.cc b/src/third_party/glog/src/logging.cc
+index 868898f..1bb3867 100644
+--- a/src/third_party/glog/src/logging.cc
++++ b/src/third_party/glog/src/logging.cc
+@@ -58,8 +58,8 @@
+ #include <errno.h>                   // for errno
+ #include <sstream>
+ #include "base/commandlineflags.h"        // to get the program name
+-#include "glog/logging.h"
+-#include "glog/raw_logging.h"
++#include <glog/logging.h>
++#include <glog/raw_logging.h>
+ #include "base/googleinit.h"
+ 
+ #ifdef HAVE_STACKTRACE
+@@ -1232,7 +1232,9 @@ void LogMessage::RecordCrashReason(
+ }
+ 
+ static void logging_fail() {
+-#if defined(_DEBUG) && defined(_MSC_VER)
++// #if defined(_DEBUG) && defined(_MSC_VER)
++// doesn't work for my laptop (sergey)
++#if 0
+   // When debugging on windows, avoid the obnoxious dialog and make
+   // it possible to continue past a LOG(FATAL) in the debugger
+   _asm int 3
+diff --git a/src/third_party/glog/src/raw_logging.cc b/src/third_party/glog/src/raw_logging.cc
+index 50c6a71..b179a1e 100644
+--- a/src/third_party/glog/src/raw_logging.cc
++++ b/src/third_party/glog/src/raw_logging.cc
+@@ -42,8 +42,8 @@
+ #include <fcntl.h>                 // for open()
+ #include <time.h>
+ #include "config.h"
+-#include "glog/logging.h"          // To pick up flag settings etc.
+-#include "glog/raw_logging.h"
++#include <glog/logging.h>          // To pick up flag settings etc.
++#include <glog/raw_logging.h>
+ #include "base/commandlineflags.h"
+ 
+ #ifdef HAVE_STACKTRACE
+diff --git a/src/third_party/glog/src/utilities.h b/src/third_party/glog/src/utilities.h
+index ee54f94..2d4e99e 100644
+--- a/src/third_party/glog/src/utilities.h
++++ b/src/third_party/glog/src/utilities.h
+@@ -79,7 +79,7 @@
+ #endif
+ 
+ #include "config.h"
+-#include "glog/logging.h"
++#include <glog/logging.h>
+ 
+ // There are three different ways we can try to get the stack trace:
+ //
+diff --git a/src/third_party/glog/src/vlog_is_on.cc b/src/third_party/glog/src/vlog_is_on.cc
+index ee0e412..ed88514 100644
+--- a/src/third_party/glog/src/vlog_is_on.cc
++++ b/src/third_party/glog/src/vlog_is_on.cc
+@@ -40,8 +40,8 @@
+ #include <cstdio>
+ #include <string>
+ #include "base/commandlineflags.h"
+-#include "glog/logging.h"
+-#include "glog/raw_logging.h"
++#include <glog/logging.h>
++#include <glog/raw_logging.h>
+ #include "base/googleinit.h"
+ 
+ // glog doesn't have annotation
+diff --git a/src/third_party/glog/src/windows/config.h b/src/third_party/glog/src/windows/config.h
+index 114762e..682a1b9 100755
+--- a/src/third_party/glog/src/windows/config.h
++++ b/src/third_party/glog/src/windows/config.h
+@@ -19,7 +19,7 @@
+ #undef HAVE_LIBUNWIND_H
+ 
+ /* define if you have google gflags library */
+-#undef HAVE_LIB_GFLAGS
++#define HAVE_LIB_GFLAGS 1
+ 
+ /* define if you have libunwind */
+ #undef HAVE_LIB_UNWIND
+diff --git a/src/third_party/glog/src/windows/glog/logging.h b/src/third_party/glog/src/windows/glog/logging.h
+index 7a6df74..de51586 100755
+--- a/src/third_party/glog/src/windows/glog/logging.h
++++ b/src/third_party/glog/src/windows/glog/logging.h
+@@ -82,8 +82,8 @@
+ #include <inttypes.h>           // a third place for uint16_t or u_int16_t
+ #endif
+ 
+-#if 0
+-#include <gflags/gflags.h>
++#if 1
++#include "third_party/gflags/gflags.h"
+ #endif
+ 
+ namespace google {

Added: branches/soc-2011-tomato/extern/libmv/patches/fast.patch
===================================================================
--- branches/soc-2011-tomato/extern/libmv/patches/fast.patch	                        (rev 0)
+++ branches/soc-2011-tomato/extern/libmv/patches/fast.patch	2011-08-06 14:49:01 UTC (rev 39101)
@@ -0,0 +1,24 @@
+diff --git a/src/third_party/fast/fast.h b/src/third_party/fast/fast.h
+index 2b3825a..06fa90e 100644
+--- a/src/third_party/fast/fast.h
++++ b/src/third_party/fast/fast.h
+@@ -1,6 +1,10 @@
+ #ifndef FAST_H
+ #define FAST_H
+ 
++#ifdef __cplusplus
++extern "C" {
++#endif
++
+ typedef struct { int x, y; } xy; 
+ typedef unsigned char byte;
+ 
+@@ -28,4 +32,8 @@ xy* fast12_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b
+ xy* nonmax_suppression(const xy* corners, const int* scores, int num_corners, int* ret_num_nonmax);
+ 
+ 
++#ifdef __cplusplus
++}
++#endif
++
+ #endif

Added: branches/soc-2011-tomato/extern/libmv/patches/max_image.patch
===================================================================
--- branches/soc-2011-tomato/extern/libmv/patches/max_image.patch	                        (rev 0)
+++ branches/soc-2011-tomato/extern/libmv/patches/max_image.patch	2011-08-06 14:49:01 UTC (rev 39101)
@@ -0,0 +1,13 @@
+diff --git a/src/libmv/simple_pipeline/pipeline.cc b/src/libmv/simple_pipeline/pipeline.cc
+index 652d70c..cf3d9e6 100644
+--- a/src/libmv/simple_pipeline/pipeline.cc
++++ b/src/libmv/simple_pipeline/pipeline.cc
+@@ -72,7 +72,7 @@ void CompleteReconstruction(const Tracks &tracks,
+ 
+     // Do all possible resections.
+     num_resects = 0;
+-    for (int image = 0; image < max_image; ++image) {
++    for (int image = 0; image <= max_image; ++image) {
+       if (reconstruction->CameraForImage(image)) {
+         LG << "Skipping frame: " << image;
+         continue;

Added: branches/soc-2011-tomato/extern/libmv/patches/max_track.patch
===================================================================
--- branches/soc-2011-tomato/extern/libmv/patches/max_track.patch	                        (rev 0)
+++ branches/soc-2011-tomato/extern/libmv/patches/max_track.patch	2011-08-06 14:49:01 UTC (rev 39101)
@@ -0,0 +1,13 @@
+diff --git a/src/libmv/simple_pipeline/pipeline.cc b/src/libmv/simple_pipeline/pipeline.cc
+index 652d70c..a60ba40 100644
+--- a/src/libmv/simple_pipeline/pipeline.cc
++++ b/src/libmv/simple_pipeline/pipeline.cc
+@@ -42,7 +42,7 @@ void CompleteReconstruction(const Tracks &tracks,
+   while (num_resects != 0 || num_intersects != 0) {
+     // Do all possible intersections.
+     num_intersects = 0;
+-    for (int track = 0; track < max_track; ++track) {
++    for (int track = 0; track <= max_track; ++track) {
+       if (reconstruction->PointForTrack(track)) {
+         LG << "Skipping point: " << track;
+         continue;

Added: branches/soc-2011-tomato/extern/libmv/patches/snrptinf_fix.patch
===================================================================
--- branches/soc-2011-tomato/extern/libmv/patches/snrptinf_fix.patch	                        (rev 0)
+++ branches/soc-2011-tomato/extern/libmv/patches/snrptinf_fix.patch	2011-08-06 14:49:01 UTC (rev 39101)
@@ -0,0 +1,15 @@
+diff --git a/src/libmv/simple_pipeline/pipeline.cc b/src/libmv/simple_pipeline/pipeline.cc
+index 652d70c..25cd2c2 100644
+--- a/src/libmv/simple_pipeline/pipeline.cc
++++ b/src/libmv/simple_pipeline/pipeline.cc
+@@ -28,6 +28,10 @@
+ #include "libmv/simple_pipeline/tracks.h"
+ #include "libmv/simple_pipeline/camera_intrinsics.h"
+ 
++#ifdef _MSC_VER
++#  define snprintf _snprintf
++#endif
++
+ namespace libmv {
+ 
+ void CompleteReconstruction(const Tracks &tracks,

Added: branches/soc-2011-tomato/extern/libmv/patches/v3d_verbosity.patch
===================================================================
--- branches/soc-2011-tomato/extern/libmv/patches/v3d_verbosity.patch	                        (rev 0)
+++ branches/soc-2011-tomato/extern/libmv/patches/v3d_verbosity.patch	2011-08-06 14:49:01 UTC (rev 39101)
@@ -0,0 +1,12 @@
+diff --git a/src/libmv/simple_pipeline/bundle.cc b/src/libmv/simple_pipeline/bundle.cc
+index 310660d..f819603 100644
+--- a/src/libmv/simple_pipeline/bundle.cc
++++ b/src/libmv/simple_pipeline/bundle.cc
+@@ -141,7 +141,6 @@ void Bundle(const Tracks &tracks, Reconstruction *reconstruction) {
+   v3d_distortion.p2 = 0;
+ 
+   // Finally, run the bundle adjustment.
+-  V3D::optimizerVerbosenessLevel = 1;
+   double const inlierThreshold = 500000.0;
+   V3D::CommonInternalsMetricBundleOptimizer opt(V3D::FULL_BUNDLE_METRIC,
+                                                 inlierThreshold,




More information about the Bf-blender-cvs mailing list