libcvd-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcvd-members] libcvd Makefile.in configure configure.in test/...


From: Edward Rosten
Subject: [libcvd-members] libcvd Makefile.in configure configure.in test/...
Date: Wed, 22 Aug 2007 23:43:14 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    libcvd
Changes by:     Edward Rosten <edrosten>        07/08/22 23:43:14

Modified files:
        .              : Makefile.in configure configure.in 
Added files:
        test           : fast_test.cxx 
        test/fast_test_image: noise.pgm 

Log message:
        FAST test rig.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/Makefile.in?cvsroot=libcvd&r1=1.58&r2=1.59
http://cvs.savannah.gnu.org/viewcvs/libcvd/configure?cvsroot=libcvd&r1=1.97&r2=1.98
http://cvs.savannah.gnu.org/viewcvs/libcvd/configure.in?cvsroot=libcvd&r1=1.98&r2=1.99
http://cvs.savannah.gnu.org/viewcvs/libcvd/test/fast_test.cxx?cvsroot=libcvd&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/libcvd/test/fast_test_image/noise.pgm?cvsroot=libcvd&rev=1.1

Patches:
Index: Makefile.in
===================================================================
RCS file: /cvsroot/libcvd/libcvd/Makefile.in,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -b -r1.58 -r1.59
--- Makefile.in 22 Aug 2007 22:29:30 -0000      1.58
+++ Makefile.in 22 Aug 2007 23:43:13 -0000      1.59
@@ -328,6 +328,10 @@
 @docs@:
        doxygen Doxyfile
 
+test-fast:test/fast_test
+       test/fast_test test/fast_test_image/noise.pgm
+
+
 #If the mandir is older than the lib, then remake. A bit of a hack
 man: libcvd.a
        doxygen Doxyfile

Index: configure
===================================================================
RCS file: /cvsroot/libcvd/libcvd/configure,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -b -r1.97 -r1.98
--- configure   22 Aug 2007 23:17:17 -0000      1.97
+++ configure   22 Aug 2007 23:43:13 -0000      1.98
@@ -9224,12 +9224,24 @@
 
 fi;
 
-echo $enable_ssefast
-
 if test "$enable_ssefast" = yes
 then
+       if test "$sse2" = no
+       then
+               { echo "$as_me:$LINENO: WARNING: \"SSE2 is disabled. The FAST 
test program will be useless.\"" >&5
+echo "$as_me: WARNING: \"SSE2 is disabled. The FAST test program will be 
useless.\"" >&2;}
+       fi
+
+       echo
+       echo -------------------------------------------------------------------
+       echo Run ldd on fast_test to make sure it\'s linked to the right 
library!
+       echo -------------------------------------------------------------------
+       echo
+
        have_faster=yes
 
+
+       hidden_options="$hidden_options faster_test";
 fi
 
 echo "$as_me:$LINENO: checking \"FAST detectors\"" >&5
@@ -9370,6 +9382,7 @@
 echo $options $D_PROGS > foo
 
 T_PROGS='
+test/fast_test                                 videodisplay faster_test sse2
 test/diskbuffer2                                       videodisplay
 test/dvbuffer_mono                             videodisplay dvbuffer
 test/dvbuffer_yuvrgb                   videodisplay dvbuffer
@@ -9382,7 +9395,7 @@
 test/v4l1buffer_bayer                  videodisplay v4l1buffer
 test/v4l1buffer_rgb                    videodisplay v4l1buffer
 test/qtbuffer_yuvrgb            videodisplay qtbuffer '
-testprogs="`echo $options $T_PROGS | $AWK -v stub=test -f 
make/prog_dependencies.awk`"
+testprogs="`echo $simd_options $hidden_options $options $T_PROGS | $AWK -v 
stub=test -f make/prog_dependencies.awk`"
 testprogs=$testprogs
 
 

Index: configure.in
===================================================================
RCS file: /cvsroot/libcvd/libcvd/configure.in,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -b -r1.98 -r1.99
--- configure.in        22 Aug 2007 23:17:17 -0000      1.98
+++ configure.in        22 Aug 2007 23:43:13 -0000      1.99
@@ -1124,11 +1124,22 @@
 
 AC_ARG_ENABLE(ssefast, [  --enable-ssefast        Enable currently broken SSE 
FAST detectors])
 
-echo $enable_ssefast
-
 if test "$enable_ssefast" = yes
 then
+       if test "$sse2" = no
+       then
+               AC_MSG_WARN("SSE2 is disabled. The FAST test program will be 
useless.")
+       fi
+
+       echo
+       echo -------------------------------------------------------------------
+       echo Run ldd on fast_test to make sure it\'s linked to the right 
library!
+       echo -------------------------------------------------------------------
+       echo 
+
        AC_SUBST(have_faster,yes)
+
+       hidden_options="$hidden_options faster_test";
 fi
 
 AC_MSG_CHECKING("FAST detectors")
@@ -1202,6 +1213,7 @@
 echo $options $D_PROGS > foo
 
 T_PROGS='
+test/fast_test                                 videodisplay faster_test sse2
 test/diskbuffer2                                       videodisplay
 test/dvbuffer_mono                             videodisplay dvbuffer
 test/dvbuffer_yuvrgb                   videodisplay dvbuffer
@@ -1214,7 +1226,7 @@
 test/v4l1buffer_bayer                  videodisplay v4l1buffer 
 test/v4l1buffer_rgb                    videodisplay v4l1buffer
 test/qtbuffer_yuvrgb            videodisplay qtbuffer '
-testprogs="`echo $options $T_PROGS | $AWK -v stub=test -f 
make/prog_dependencies.awk`"
+testprogs="`echo $simd_options $hidden_options $options $T_PROGS | $AWK -v 
stub=test -f make/prog_dependencies.awk`"
 AC_SUBST(testprogs,$testprogs)
 
 AC_OUTPUT(Makefile)

Index: test/fast_test.cxx
===================================================================
RCS file: test/fast_test.cxx
diff -N test/fast_test.cxx
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ test/fast_test.cxx  22 Aug 2007 23:43:14 -0000      1.1
@@ -0,0 +1,99 @@
+#include <cvd/fast_corner.h>
+#include <cvd/image_io.h>
+#include <cvd/gl_helpers.h>
+#include <cvd/videodisplay.h>
+#include <utility>
+#include <algorithm>
+#include <iterator>
+#include <iostream>
+
+
+using namespace std;
+namespace CVD
+{
+       void fast_corner_detect_plain_9(const SubImage<byte>& i, 
vector<ImageRef>& corners, int b);
+       void fast_corner_detect_plain_10(const SubImage<byte>& i, 
vector<ImageRef>& corners, int b);
+       void fast_corner_detect_plain_12(const SubImage<byte>& i, 
vector<ImageRef>& corners, int b);
+}
+
+using namespace CVD;
+
+template<class A, class B> void test(const Image<byte>& i, A funcf, B funcp)
+{
+       cout << "Size: " << i.size() << endl;
+
+       vector<ImageRef> faster, normal;
+
+       funcp(i, normal, 1);
+       funcf(i, faster, 1);
+
+       cout << normal.size() << " " << faster.size() << endl;
+
+
+       sort(normal.begin(), normal.end());
+       sort(faster.begin(), faster.end());
+
+       VideoDisplay d(i.size(), 2);
+       
+       vector<ImageRef> extra_in_normal, extra_in_faster;
+
+       set_difference(normal.begin(), normal.end(), faster.begin(), 
faster.end(), back_inserter(extra_in_normal));
+       set_difference(faster.begin(), faster.end(), normal.begin(), 
normal.end(), back_inserter(extra_in_faster));
+
+       glDrawPixels(i);
+       glPointSize(3);
+       glBegin(GL_POINTS);
+       glColor3f(1, 0, 0);
+       glVertex(extra_in_normal);
+       glColor3f(0, 1, 0);
+       glVertex(extra_in_faster);
+       glEnd();
+       glFlush();
+       cin.get();
+}
+
+template<class A, class B> void test_images(const Image<byte>& im, A funcf, B 
funcp)
+{
+       ImageRef one(1,1);
+       ImageRef zero(0,0);
+
+       for(int i=0; i < 16; i++)
+       {
+               ImageRef size = im.size() - i * one;
+
+               Image<byte> part(size);
+               SubImage<byte> s = im.sub_image(zero, size);
+               copy(s.begin(), s.end(),part.begin());
+
+               test(part, funcf, funcp);
+       }
+}
+
+
+int main(int argc, char** argv)
+{
+       if(argc != 2)
+               return 1;
+
+
+
+       try{
+               Image<byte> im= img_load(argv[1]);
+
+               cout << "*************************FAST-9\n";
+               test_images(im, fast_corner_detect_9, 
fast_corner_detect_plain_9);
+
+               cout << "*************************FAST-10\n";
+               test_images(im, fast_corner_detect_10, 
fast_corner_detect_plain_10);
+
+               cout << "*************************FAST-12\n";
+               test_images(im, fast_corner_detect_12, 
fast_corner_detect_plain_12);
+               
+       }
+       catch(Exceptions::All e)
+       {
+               cerr << "Error: " << e.what << endl;
+       }
+
+       return 0;
+}

Index: test/fast_test_image/noise.pgm
===================================================================
RCS file: test/fast_test_image/noise.pgm
diff -N test/fast_test_image/noise.pgm
Binary files /dev/null and /tmp/cvsQMyAlc differ




reply via email to

[Prev in Thread] Current Thread [Next in Thread]