Permalink
Browse files

Preliminary code for preventing compilation of some FAST detectors.

To have only FAST-9, do:

--enable-missingfast=7,8,10,11,12

--without and --disable to not allow arguments.
  • Loading branch information...
1 parent fd621bb commit 5c46a74d6c656c4b40c10c98bb6c308ac9f01cd3 edrosten committed Jul 25, 2007
Showing with 3,055 additions and 4,716 deletions.
  1. +31 −12 Makefile.in
  2. +2,962 −4,703 configure
  3. +42 −0 configure.in
  4. +7 −0 cvd_src/fast_corner.cxx
  5. +13 −1 cvd_src/faster_corner.cxx
View
43 Makefile.in
@@ -103,22 +103,41 @@ CVD_OBJS= cvd_src/cvd_timer.o \
cvd_src/nonmax_suppression.o \
cvd_src/timeddiskbuffer.o \
cvd_src/videosource.o \
- cvd_src/fast/fast_7_detect.o \
- cvd_src/fast/fast_7_score.o \
- cvd_src/fast/fast_8_detect.o \
- cvd_src/fast/fast_8_score.o \
- cvd_src/fast/fast_9_detect.o \
- cvd_src/fast/fast_9_score.o \
- cvd_src/fast/fast_10_detect.o \
- cvd_src/fast/fast_10_score.o \
- cvd_src/fast/fast_11_detect.o \
- cvd_src/fast/fast_11_score.o \
- cvd_src/fast/fast_12_detect.o \
- cvd_src/fast/fast_12_score.o \
#cvd_src/fast/7_@fast_pointers@_@fast_force@.o \
#cvd_src/fast/8_@fast_pointers@_@fast_force@.o \
#cvd_src/fast/11_@fast_pointers@_@fast_force@.o \
+
+
+################################################################################
+#
+# Allow disabling of FAST detectors
+#
+ifeq (@have_FAST_7@,yes)
+ CVD_OBJS+=cvd_src/fast/fast_7_detect.o \
+ cvd_src/fast/fast_7_score.o
+endif
+ifeq (@have_FAST_8@,yes)
+ CVD_OBJS+=cvd_src/fast/fast_8_detect.o \
+ cvd_src/fast/fast_8_score.o
+endif
+ifeq (@have_FAST_9@,yes)
+ CVD_OBJS+=cvd_src/fast/fast_9_detect.o \
+ cvd_src/fast/fast_9_score.o
+endif
+ifeq (@have_FAST_10@,yes)
+ CVD_OBJS+=cvd_src/fast/fast_10_detect.o \
+ cvd_src/fast/fast_10_score.o
+endif
+ifeq (@have_FAST_11@,yes)
+ CVD_OBJS+=cvd_src/fast/fast_11_detect.o \
+ cvd_src/fast/fast_11_score.o
+endif
+ifeq (@have_FAST_12@,yes)
+ CVD_OBJS+=cvd_src/fast/fast_12_detect.o \
+ cvd_src/fast/fast_12_score.o
+endif
+
################################################################################
#
# Stuff requiring TooN
View
7,665 configure
2,962 additions, 4,703 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
42 configure.in
@@ -1120,6 +1120,48 @@ echo --------------------------------
echo Checking for extra build options
echo --------------------------------
+AC_MSG_CHECKING("FAST detectors")
+
+allfasts="7 8 9 10 11 12"
+AC_ARG_ENABLE(missingfast, [ --enable-missingfast=7,8,... compile without certain FAST detectors. ])
+wfasts="`echo $enable_missingfast | sed -e's/,/ /g'`"
+fasts="`echo $allfasts $wfasts | tr ' ' '\n' | sort -n | uniq -u | tr '\n' ' '`"
+
+AC_MSG_RESULT([$fasts])
+
+if echo $fasts | grep -q 7
+then
+ AC_SUBST(have_FAST_7, yes)
+ AC_DEFINE(CVD_HAVE_FAST_7)
+fi
+if echo $fasts | grep -q 8
+then
+ AC_SUBST(have_FAST_8, yes)
+ AC_DEFINE(CVD_HAVE_FAST_8)
+fi
+if echo $fasts | grep -q 9
+then
+ AC_SUBST(have_FAST_9, yes)
+ AC_DEFINE(CVD_HAVE_FAST_9)
+fi
+if echo $fasts | grep -q 10
+then
+ AC_SUBST(have_FAST_10, yes)
+ AC_DEFINE(CVD_HAVE_FAST_10)
+fi
+if echo $fasts | grep -q 11
+then
+ AC_SUBST(have_FAST_11, yes)
+ AC_DEFINE(CVD_HAVE_FAST_11)
+fi
+if echo $fasts | grep -q 12
+then
+ AC_SUBST(have_FAST_12, yes)
+ AC_DEFINE(CVD_HAVE_FAST_12)
+fi
+
+
+
AC_CHECK_PROG(docs, doxygen, docs, no)
if test "$cpu" == ""
View
7 cvd_src/fast_corner.cxx
@@ -1,6 +1,7 @@
#include <cvd/fast_corner.h>
#include <cvd/nonmax_suppression.h>
#include "cvd_src/fast/prototypes.h"
+#include "cvd/config.h"
using namespace CVD;
using namespace std;
@@ -104,19 +105,25 @@ void fast_corner_detect_9_nonmax(const BasicImage<byte>& I, std::vector<ImageRef
nonmax_suppression(c, s, corners);
}
+#ifdef CVD_HAVE_FAST_7
void fast_corner_detect_7(const BasicImage<byte>& I, std::vector<ImageRef>& corners, int barrier)
{
fast_corner_detect_plain_7(I, corners, barrier);
}
+#endif
+#ifdef CVD_HAVE_FAST_8
void fast_corner_detect_8(const BasicImage<byte>& I, std::vector<ImageRef>& corners, int barrier)
{
fast_corner_detect_plain_8(I, corners, barrier);
}
+#endif
+#ifdef CVD_HAVE_FAST_11
void fast_corner_detect_11(const BasicImage<byte>& I, std::vector<ImageRef>& corners, int barrier)
{
fast_corner_detect_plain_11(I, corners, barrier);
}
+#endif
}
View
14 cvd_src/faster_corner.cxx
@@ -66,7 +66,9 @@ namespace CVD
template <bool Aligned> inline __m128i load_si128(const void* addr) { return _mm_loadu_si128((const __m128i*)addr); }
template <> inline __m128i load_si128<true>(const void* addr) { return _mm_load_si128((const __m128i*)addr); }
-
+
+ #ifdef CVD_HAVE_FAST_12
+
template <bool Aligned> void faster_corner_detect_12(const BasicImage<byte>& I, std::vector<ImageRef>& corners, int barrier)
{
const int w = I.size().x;
@@ -130,6 +132,7 @@ namespace CVD
}
}
+
void fast_corner_detect_12(const BasicImage<byte>& I, std::vector<ImageRef>& corners, int barrier)
{
if (I.size().x < 22) {
@@ -143,6 +146,9 @@ namespace CVD
else
faster_corner_detect_12<false>(I, corners, barrier);
}
+ #endif
+
+ #ifdef CVD_HAVE_FAST_10
template <bool Aligned> void faster_corner_detect_10(const BasicImage<byte>& I, std::vector<ImageRef>& corners, const int barrier)
{
@@ -312,6 +318,10 @@ namespace CVD
faster_corner_detect_10<false>(I, corners, barrier);
}
+ #endif
+
+ #ifdef CVD_HAVE_FAST_9
+
template <bool Aligned> void faster_corner_detect_9(const BasicImage<byte>& I, std::vector<ImageRef>& corners, const int barrier)
{
const int w = I.size().x;
@@ -533,6 +543,8 @@ namespace CVD
faster_corner_detect_9<false>(I, corners, barrier);
}
+ #endif
+
}
#endif

0 comments on commit 5c46a74

Please sign in to comment.