[Bf-blender-cvs] [5cbddd4] master: Bye-bye FAST!

Sergey Sharybin noreply at git.blender.org
Thu Feb 6 13:16:44 CET 2014


Commit: 5cbddd4ca47b4b2b45ae7284129db5b83d1a948c
Author: Sergey Sharybin
Date:   Thu Feb 6 18:13:12 2014 +0600
https://developer.blender.org/rB5cbddd4ca47b4b2b45ae7284129db5b83d1a948c

Bye-bye FAST!

FAST detector has been replaced with fancier Harris,
so no need to keep FAST library in the sources now.

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

M	extern/libmv/CMakeLists.txt
M	extern/libmv/ChangeLog
M	extern/libmv/SConscript
M	extern/libmv/bundle.sh
M	extern/libmv/files.txt
M	extern/libmv/libmv/simple_pipeline/detect.cc
D	extern/libmv/third_party/fast/LICENSE
D	extern/libmv/third_party/fast/README
D	extern/libmv/third_party/fast/README.libmv
D	extern/libmv/third_party/fast/fast.c
D	extern/libmv/third_party/fast/fast.h
D	extern/libmv/third_party/fast/fast_10.c
D	extern/libmv/third_party/fast/fast_11.c
D	extern/libmv/third_party/fast/fast_12.c
D	extern/libmv/third_party/fast/fast_9.c
D	extern/libmv/third_party/fast/nonmax.c

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

diff --git a/extern/libmv/CMakeLists.txt b/extern/libmv/CMakeLists.txt
index ef7e49b..6c716b5 100644
--- a/extern/libmv/CMakeLists.txt
+++ b/extern/libmv/CMakeLists.txt
@@ -40,6 +40,7 @@ if(WITH_LIBMV)
 		-DWITH_LIBMV
 		-DWITH_LIBMV_GUARDED_ALLOC
 		-DGOOGLE_GLOG_DLL_DECL=
+		-DLIBMV_NO_FAST_DETECTOR=
 	)
 
 	list(APPEND INC
@@ -86,12 +87,6 @@ if(WITH_LIBMV)
 		libmv/tracking/track_region.cc
 		libmv/tracking/trklt_region_tracker.cc
 
-		third_party/fast/fast_10.c
-		third_party/fast/fast_11.c
-		third_party/fast/fast_12.c
-		third_party/fast/fast_9.c
-		third_party/fast/fast.c
-		third_party/fast/nonmax.c
 		third_party/gflags/gflags.cc
 		third_party/gflags/gflags_completions.cc
 		third_party/gflags/gflags_reporting.cc
@@ -145,7 +140,6 @@ if(WITH_LIBMV)
 		libmv/tracking/track_region.h
 		libmv/tracking/trklt_region_tracker.h
 
-		third_party/fast/fast.h
 		third_party/gflags/config.h
 		third_party/gflags/gflags/gflags_completions.h
 		third_party/gflags/gflags/gflags_declare.h
diff --git a/extern/libmv/ChangeLog b/extern/libmv/ChangeLog
index 1a87097..641d251 100644
--- a/extern/libmv/ChangeLog
+++ b/extern/libmv/ChangeLog
@@ -1,3 +1,14 @@
+commit b1381540305d69c702eb2f051bd543fb5c1c3e2c
+Author: Sergey Sharybin <sergey.vfx at gmail.com>
+Date:   Thu Feb 6 18:01:58 2014 +0600
+
+    Made FAST detector optional
+    
+    This way it's possible to bundle Libmv sources subset
+    to applications which doesn't need FAST detector.
+    
+    Mainly this is done for Blender integration.
+
 commit da4607f010bca0b3532cd4444afbb10bc774fc32
 Author: Sergey Sharybin <sergey.vfx at gmail.com>
 Date:   Tue Jan 28 18:32:39 2014 +0600
@@ -680,21 +691,3 @@ Date:   Sun Apr 7 21:53:23 2013 +0600
     usage pipeline. Anyway, deprecation shall not
     happen spontaneously as a part of other changes.
     And for sure shall not break anything.
-
-commit c9eb9d36bb1ca5d3037ce66633d812a224f77958
-Author: Sergey Sharybin <sergey.vfx at gmail.com>
-Date:   Sat Apr 6 20:49:05 2013 +0600
-
-    Revert "Change libmv's bilinear sampling to assume the same"
-    
-    Revert changes to bilinear sampler which were originally
-    aimed to match blender's pixel center (where integer coord
-    is a left-bottom corner, x.5 coords are centers.
-    
-    The reason of revert is changing this assumption in only
-    sampler didn't work well and lead to wrong results of
-    BlurredImageAndDerivativesChannels for example.
-    
-    Discovered when was doing unit-tests for brute region tracker.
-    
-    This reverts commit daa354c0735b954b0cd7725626e9a3d67416d46b.
diff --git a/extern/libmv/SConscript b/extern/libmv/SConscript
index 6926b36..544e5fd 100644
--- a/extern/libmv/SConscript
+++ b/extern/libmv/SConscript
@@ -16,6 +16,7 @@ if env['WITH_BF_LIBMV']:
     defs.append('GOOGLE_GLOG_DLL_DECL=')
     defs.append('WITH_LIBMV')
     defs.append('WITH_LIBMV_GUARDED_ALLOC')
+    defs.append('LIBMV_NO_FAST_DETECTOR')
 
     src = env.Glob("libmv-capi.cc")
     src += env.Glob('libmv/image/*.cc')
@@ -23,7 +24,6 @@ if env['WITH_BF_LIBMV']:
     src += env.Glob('libmv/numeric/*.cc')
     src += env.Glob('libmv/simple_pipeline/*.cc')
     src += env.Glob('libmv/tracking/*.cc')
-    src += env.Glob('third_party/fast/*.c')
     src += env.Glob('third_party/gflags/*.cc')
 
     incs += ' ../Eigen3 third_party/ceres/include ../../intern/guardedalloc'
diff --git a/extern/libmv/bundle.sh b/extern/libmv/bundle.sh
index 5f7251e..48d6843 100755
--- a/extern/libmv/bundle.sh
+++ b/extern/libmv/bundle.sh
@@ -128,6 +128,7 @@ if(WITH_LIBMV)
 		-DWITH_LIBMV
 		-DWITH_LIBMV_GUARDED_ALLOC
 		-DGOOGLE_GLOG_DLL_DECL=
+		-DLIBMV_NO_FAST_DETECTOR=
 	)
 
 	list(APPEND INC
@@ -231,6 +232,7 @@ if env['WITH_BF_LIBMV']:
     defs.append('GOOGLE_GLOG_DLL_DECL=')
     defs.append('WITH_LIBMV')
     defs.append('WITH_LIBMV_GUARDED_ALLOC')
+    defs.append('LIBMV_NO_FAST_DETECTOR')
 
     src = env.Glob("libmv-capi.cc")
 $src
diff --git a/extern/libmv/files.txt b/extern/libmv/files.txt
index a639ea3..cb6546a 100644
--- a/extern/libmv/files.txt
+++ b/extern/libmv/files.txt
@@ -76,16 +76,6 @@ libmv/tracking/track_region.cc
 libmv/tracking/track_region.h
 libmv/tracking/trklt_region_tracker.cc
 libmv/tracking/trklt_region_tracker.h
-third_party/fast/fast_10.c
-third_party/fast/fast_11.c
-third_party/fast/fast_12.c
-third_party/fast/fast_9.c
-third_party/fast/fast.c
-third_party/fast/fast.h
-third_party/fast/LICENSE
-third_party/fast/nonmax.c
-third_party/fast/README
-third_party/fast/README.libmv
 third_party/gflags/AUTHORS
 third_party/gflags/ChangeLog
 third_party/gflags/config.h
diff --git a/extern/libmv/libmv/simple_pipeline/detect.cc b/extern/libmv/libmv/simple_pipeline/detect.cc
index 09adfcc..4039c83 100644
--- a/extern/libmv/libmv/simple_pipeline/detect.cc
+++ b/extern/libmv/libmv/simple_pipeline/detect.cc
@@ -25,7 +25,6 @@
 #include <stdlib.h>
 #include <memory.h>
 #include <queue>
-#include <third_party/fast/fast.h>
 
 #include "libmv/base/scoped_ptr.h"
 #include "libmv/image/array_nd.h"
@@ -34,6 +33,10 @@
 #include "libmv/logging/logging.h"
 #include "libmv/simple_pipeline/detect.h"
 
+#ifndef LIBMV_NO_FAST_DETECTOR
+#  include <third_party/fast/fast.h>
+#endif
+
 #ifdef __SSE2__
 #  include <emmintrin.h>
 #endif
@@ -92,6 +95,7 @@ void FilterFeaturesByDistance(const vector<Feature> &all_features,
 void DetectFAST(const FloatImage &grayscale_image,
                 const DetectOptions &options,
                 vector<Feature> *detected_features) {
+#ifndef LIBMV_NO_FAST_DETECTOR
   const int min_distance = options.min_distance;
   const int min_trackness = options.fast_min_trackness;
   const int margin = options.margin;
@@ -140,6 +144,12 @@ void DetectFAST(const FloatImage &grayscale_image,
   }
   free(scores);
   free(nonmax);
+#else
+  (void) grayscale_image;  // Ignored.
+  (void) options;  // Ignored.
+  (void) detected_features;  // Ignored.
+  LOG(FATAL) << "FAST detector is disabled in this build.";
+#endif
 }
 
 #ifdef __SSE2__
diff --git a/extern/libmv/third_party/fast/LICENSE b/extern/libmv/third_party/fast/LICENSE
deleted file mode 100644
index f347008..0000000
--- a/extern/libmv/third_party/fast/LICENSE
+++ /dev/null
@@ -1,30 +0,0 @@
-Copyright (c) 2006, 2008 Edward Rosten
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-
-	*Redistributions of source code must retain the above copyright
-	 notice, this list of conditions and the following disclaimer.
-
-	*Redistributions in binary form must reproduce the above copyright
-	 notice, this list of conditions and the following disclaimer in the
-	 documentation and/or other materials provided with the distribution.
-
-	*Neither the name of the University of Cambridge nor the names of 
-	 its contributors may be used to endorse or promote products derived 
-	 from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/extern/libmv/third_party/fast/README b/extern/libmv/third_party/fast/README
deleted file mode 100644
index 77017078..0000000
--- a/extern/libmv/third_party/fast/README
+++ /dev/null
@@ -1,31 +0,0 @@
-FAST feature detectors in C Version 2.0
----------------------------------------
-
-The files are valid C and C++ code, and have no special requirements for
-compiling, and they do not depend on any libraries. Just compile them along with
-the rest of your project. 
-
-To use the functions, #include "fast.h"
-
-The corner detectors have the following prototype (where X is 9, 10, 11 or 12):
-
-xy* fastX_detect_nonmax(const unsigned char * data, int xsize, int ysize, int stride, int threshold, int* numcorners)
-
-Where xy is the following simple struct typedef:
-
-typedef struct 
-{
-	int x, y;
-} xy;
-
-The image is passed in as a block of data and dimensions, and the list of
-corners is returned as an array of xy structs, and an integer (numcorners)
-with the number of corners returned.  The data can be deallocated with free().
-Nonmaximal suppression is performed on the corners. Note that the stride 
-is the number of bytes between rows. If your image has no padding, then this
-is the same as xsize.
-
-The detection, scoring and nonmaximal suppression are available as individual
-functions.  To see how to use the individual functions, see fast.c
-
-
diff --git a/extern/libmv/third_party/fast/README.libmv b/extern/libmv/third_party/fast/README.libmv
deleted file mode 100644
index 2110976..0000000
--- a/extern/libmv/third_party/fast/README.libmv
+++ /dev/null
@@ -1,9 +0,0 @@
-Project: FAST (FAST Corner Detection)
-URL: http://mi.eng.cam.ac.uk/~er258/work/fast-C-src/
-License: BSD
-Upstream version: 2.1, released 12-Jan-2009
-
-Local modifications:
-- Created CMakeLists.txt for CMake build.
-- Update CMakeLists to be sure that the library is a compatible with C++ linkage.
-- Update CMakeLists to not include fast.h to compile fast library with VS2005.
diff --git a/extern/libmv/third_party/fast/fast.c b/extern/libmv/third_party/fast/fast.c
deleted file mode 100644
index c675f0af8..0000000
--- a/extern/libmv/third_party/fast/fast.c
+++ /dev/null
@@ -1,71 +0,0 @@
-#include <stdlib.h>
-#include "fast.h"
-
-
-xy* fast9_detect_nonmax(const byte* im, int xsize, int ysize, int stride, int b, int* ret_num_corners)
-{
-	xy* corners;
-	int num_corners;
-	int* scores;
-	xy* nonmax;
-
-	corners = fast9_detect(im, xsize, ysize, stride, b, &num_corners);
-	scores = 

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list