[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57140] trunk/blender/extern/libmv: Remove files unused by blender's tracker

Sergey Sharybin sergey.vfx at gmail.com
Thu May 30 14:05:21 CEST 2013


Revision: 57140
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57140
Author:   nazgul
Date:     2013-05-30 12:05:20 +0000 (Thu, 30 May 2013)
Log Message:
-----------
Remove files unused by blender's tracker

They were giving compilation error with msvc2012,
and instead of having workaround in them let's
drop them away form blender (they're not used even).

Modified Paths:
--------------
    trunk/blender/extern/libmv/CMakeLists.txt
    trunk/blender/extern/libmv/ChangeLog
    trunk/blender/extern/libmv/files.txt
    trunk/blender/extern/libmv/libmv/tracking/track_region.h

Removed Paths:
-------------
    trunk/blender/extern/libmv/libmv/tracking/esm_region_tracker.cc
    trunk/blender/extern/libmv/libmv/tracking/esm_region_tracker.h
    trunk/blender/extern/libmv/libmv/tracking/lmicklt_region_tracker.cc
    trunk/blender/extern/libmv/libmv/tracking/lmicklt_region_tracker.h

Modified: trunk/blender/extern/libmv/CMakeLists.txt
===================================================================
--- trunk/blender/extern/libmv/CMakeLists.txt	2013-05-30 11:51:21 UTC (rev 57139)
+++ trunk/blender/extern/libmv/CMakeLists.txt	2013-05-30 12:05:20 UTC (rev 57140)
@@ -75,10 +75,8 @@
 		libmv/simple_pipeline/resect.cc
 		libmv/simple_pipeline/tracks.cc
 		libmv/tracking/brute_region_tracker.cc
-		libmv/tracking/esm_region_tracker.cc
 		libmv/tracking/hybrid_region_tracker.cc
 		libmv/tracking/klt_region_tracker.cc
-		libmv/tracking/lmicklt_region_tracker.cc
 		libmv/tracking/pyramid_region_tracker.cc
 		libmv/tracking/retrack_region_tracker.cc
 		libmv/tracking/track_region.cc
@@ -134,10 +132,8 @@
 		libmv/simple_pipeline/resect.h
 		libmv/simple_pipeline/tracks.h
 		libmv/tracking/brute_region_tracker.h
-		libmv/tracking/esm_region_tracker.h
 		libmv/tracking/hybrid_region_tracker.h
 		libmv/tracking/klt_region_tracker.h
-		libmv/tracking/lmicklt_region_tracker.h
 		libmv/tracking/pyramid_region_tracker.h
 		libmv/tracking/region_tracker.h
 		libmv/tracking/retrack_region_tracker.h

Modified: trunk/blender/extern/libmv/ChangeLog
===================================================================
--- trunk/blender/extern/libmv/ChangeLog	2013-05-30 11:51:21 UTC (rev 57139)
+++ trunk/blender/extern/libmv/ChangeLog	2013-05-30 12:05:20 UTC (rev 57140)
@@ -1,3 +1,12 @@
+commit f61b8198b9bddd8d2fa53feae7924aa23df48cbd
+Author: Sergey Sharybin <sergey.vfx at gmail.com>
+Date:   Thu May 30 18:00:03 2013 +0600
+
+    Code cleanup
+    
+    - Made some arguments passing to detector const.
+    - Remove unneeded include from track_region header.
+
 commit 61ac890908a397860cabc60207500039876532cc
 Author: Sergey Sharybin <sergey.vfx at gmail.com>
 Date:   Mon May 13 04:44:14 2013 +0600
@@ -624,13 +633,3 @@
     refining are much more usable than it were before.
     
     Thanks to Keir for the help and code review!
-
-commit 5d6c2e7a27bdd1a1b23bf289d70a9b8f62514c9a
-Author: Sergey Sharybin <sergey.vfx at gmail.com>
-Date:   Fri Mar 1 17:37:35 2013 +0600
-
-    Increase verbosity level for reprojected markers info
-    
-    This information is useful, but in cases when you, say,
-    working on a bundler it's annoying to scroll all the
-    information up.

Modified: trunk/blender/extern/libmv/files.txt
===================================================================
--- trunk/blender/extern/libmv/files.txt	2013-05-30 11:51:21 UTC (rev 57139)
+++ trunk/blender/extern/libmv/files.txt	2013-05-30 12:05:20 UTC (rev 57140)
@@ -62,14 +62,10 @@
 libmv/simple_pipeline/tracks.h
 libmv/tracking/brute_region_tracker.cc
 libmv/tracking/brute_region_tracker.h
-libmv/tracking/esm_region_tracker.cc
-libmv/tracking/esm_region_tracker.h
 libmv/tracking/hybrid_region_tracker.cc
 libmv/tracking/hybrid_region_tracker.h
 libmv/tracking/klt_region_tracker.cc
 libmv/tracking/klt_region_tracker.h
-libmv/tracking/lmicklt_region_tracker.cc
-libmv/tracking/lmicklt_region_tracker.h
 libmv/tracking/pyramid_region_tracker.cc
 libmv/tracking/pyramid_region_tracker.h
 libmv/tracking/region_tracker.h

Deleted: trunk/blender/extern/libmv/libmv/tracking/esm_region_tracker.cc
===================================================================
--- trunk/blender/extern/libmv/libmv/tracking/esm_region_tracker.cc	2013-05-30 11:51:21 UTC (rev 57139)
+++ trunk/blender/extern/libmv/libmv/tracking/esm_region_tracker.cc	2013-05-30 12:05:20 UTC (rev 57140)
@@ -1,313 +0,0 @@
-// Copyright (c) 2007, 2008, 2009, 2011 libmv authors.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to
-// deal in the Software without restriction, including without limitation the
-// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-// IN THE SOFTWARE.
-
-/* needed for M_E when building with msvc */
-#define _USE_MATH_DEFINES
-
-#include "libmv/tracking/esm_region_tracker.h"
-
-#include "libmv/logging/logging.h"
-#include "libmv/image/image.h"
-#include "libmv/image/convolve.h"
-#include "libmv/image/correlation.h"
-#include "libmv/image/sample.h"
-#include "libmv/numeric/numeric.h"
-#include "libmv/tracking/track_region.h"
-
-namespace libmv {
-
-// TODO(keir): Reduce duplication between here and the other region trackers.
-static bool RegionIsInBounds(const FloatImage &image1,
-                      double x, double y,
-                      int half_window_size) {
-  // Check the minimum coordinates.
-  int min_x = floor(x) - half_window_size - 1;
-  int min_y = floor(y) - half_window_size - 1;
-  if (min_x < 0.0 ||
-      min_y < 0.0) {
-    LG << "Out of bounds; min_x: " << min_x << ", min_y: " << min_y;
-    return false;
-  }
-
-  // Check the maximum coordinates.
-  int max_x = ceil(x) + half_window_size + 1;
-  int max_y = ceil(y) + half_window_size + 1;
-  if (max_x > image1.cols() ||
-      max_y > image1.rows()) {
-    LG << "Out of bounds; max_x: " << max_x << ", max_y: " << max_y
-       << ", image1.cols(): " << image1.cols()
-       << ", image1.rows(): " << image1.rows();
-    return false;
-  }
-
-  // Ok, we're good.
-  return true;
-}
-
-/* Ugly but necessary fix for compilation on VS2012
- * this file causes an Internal Compiler Error */
-// TODO: check regularly if ICE is fixed by MS!
-#if defined(_MSC_VER) && defined(_WIN64) && (_MSC_VER >= 1700)
-#pragma optimize("s", on)
-#endif
-
-// This is implemented from "Lukas and Kanade 20 years on: Part 1. Page 42,
-// figure 14: the Levenberg-Marquardt-Inverse Compositional Algorithm".
-bool EsmRegionTracker::Track(const FloatImage &image1,
-                             const FloatImage &image2,
-                             double  x1, double  y1,
-                             double *x2, double *y2) const {
-  if (!RegionIsInBounds(image1, x1, y1, half_window_size)) {
-    LG << "Fell out of image1's window with x1=" << x1 << ", y1=" << y1
-       << ", hw=" << half_window_size << ".";
-    return false;
-  }
-
-  // XXX
-  // TODO(keir): Delete the block between the XXX's once the planar tracker is
-  // integrated into blender.
-  //
-  // For now, to test, replace the ESM tracker with the Ceres tracker in
-  // translation mode. In the future, this should get removed and alloed to
-  // co-exist, since Ceres is not as fast as the ESM implementation since it
-  // specializes for translation.
-  double xx1[4], yy1[4];
-  double xx2[4], yy2[4];
-  // Clockwise winding, starting from the "origin" (top-left).
-  xx1[0] = xx2[0] = x1 - half_window_size;
-  yy1[0] = yy2[0] = y1 - half_window_size;
-
-  xx1[1] = xx2[1] = x1 + half_window_size;
-  yy1[1] = yy2[1] = y1 - half_window_size;
-
-  xx1[2] = xx2[2] = x1 + half_window_size;
-  yy1[2] = yy2[2] = y1 + half_window_size;
-
-  xx1[3] = xx2[3] = x1 - half_window_size;
-  yy1[3] = yy2[3] = y1 + half_window_size;
-
-  TrackRegionOptions options;
-  options.mode = TrackRegionOptions::TRANSLATION;
-  options.max_iterations = 20;
-  options.sigma = sigma;
-  options.use_esm = true;
-
-  TrackRegionResult result;
-  TrackRegion(image1, image2, xx1, yy1, options, xx2, yy2, &result);
-
-  *x2 = xx2[0] + half_window_size;
-  *y2 = yy2[0] + half_window_size;
-
-  return true;
-
-  // XXX
-  int width = 2 * half_window_size + 1;
-
-  // TODO(keir): Avoid recomputing gradients for e.g. the pyramid tracker.
-  Array3Df image_and_gradient1;
-  Array3Df image_and_gradient2;
-  BlurredImageAndDerivativesChannels(image1, sigma, &image_and_gradient1);
-  BlurredImageAndDerivativesChannels(image2, sigma, &image_and_gradient2);
-
-  // Step -1: Resample the template (image1) since it is not pixel aligned.
-  //
-  // Take a sample of the gradient of the pattern area of image1 at the
-  // subpixel position x1, x2. This is reused for each iteration, so
-  // precomputing it saves time.
-  Array3Df image_and_gradient1_sampled;
-  SamplePattern(image_and_gradient1, x1, y1, half_window_size, 3,
-                &image_and_gradient1_sampled);
-
-  // Step 0: Initialize delta = 0.01.
-  //
-  // Ignored for my "normal" LM loop.
-
-  // Step 1: Warp I with W(x, p) to compute I(W(x; p).
-  //
-  // Use two images for accepting / rejecting updates.
-  // XXX is this necessary?
-  int current_image = 0, new_image = 1;
-  Array3Df image_and_gradient2_sampled[2];
-  SamplePattern(image_and_gradient2, *x2, *y2, half_window_size, 3,
-                &image_and_gradient2_sampled[current_image]);
-
-  // Step 2: Compute the squared error I - J.
-  double error = 0;
-  for (int r = 0; r < width; ++r) {
-    for (int c = 0; c < width; ++c) {
-      double e = image_and_gradient1_sampled(r, c, 0) -
-                 image_and_gradient2_sampled[current_image](r, c, 0);
-      error += e*e;
-    }
-  }
-
-  // Step 3: Evaluate the gradient of the template.
-  //
-  // This is done above when sampling the template (step -1).
-
-  // Step 4: Evaluate the jacobian dw/dp at (x; 0).
-  //
-  // The jacobian between dx,dy and the warp is constant 2x2 identity, so it
-  // doesn't have to get computed. The Gauss-Newton Hessian matrix computation
-  // below would normally have to include a multiply by the jacobian.
-
-  // Step 5: Compute the steepest descent images of the template.
-  //
-  // Since the jacobian of the position w.r.t. the sampled template position is
-  // the identity, the steepest descent images are the same as the gradient.
-
-  // Step 6: Compute the Gauss-Newton Hessian for the template (image1).
-  //
-  // This could get rolled into the previous loop, but split it for now for
-  // clarity.
-  Mat2 H_image1 = Mat2::Zero();
-  for (int r = 0; r < width; ++r) {
-    for (int c = 0; c < width; ++c) {

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list