libcvd-members
[Top][All Lists]
Advanced

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

[libcvd-members] libcvd/cvd_src fast_corner.cxx


From: Georg Klein
Subject: [libcvd-members] libcvd/cvd_src fast_corner.cxx
Date: Tue, 25 Jul 2006 12:54:41 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    libcvd
Changes by:     Georg Klein <georgklein>        06/07/25 12:54:41

Modified files:
        cvd_src        : fast_corner.cxx 

Log message:
        fast_nonmax used to discard the first and last corners, and all corners
        if fewer than five. Trivially fix that behaviour. May have introduced 
some 
        bugs, and adds two extra `ifs' per corner.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd_src/fast_corner.cxx?cvsroot=libcvd&r1=1.12&r2=1.13

Patches:
Index: fast_corner.cxx
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd_src/fast_corner.cxx,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- fast_corner.cxx     4 May 2006 00:46:52 -0000       1.12
+++ fast_corner.cxx     25 Jul 2006 12:54:41 -0000      1.13
@@ -360,7 +360,7 @@
 template<class ReturnType, class Collector>
 inline void fast_nonmax_t(const BasicImage<byte>& im, const vector<ImageRef>& 
corners, int barrier, vector<ReturnType>& nonmax_corners)
 {
-  if(corners.size() < 5)
+  if(corners.size() < 1)
     return;
   
   ImageRef size = im.size();
@@ -406,16 +406,18 @@
   
   const unsigned int sz = corners.size(); 
   
-  for(unsigned int i=1; i < sz-1; i++)
+  for(unsigned int i=0; i < sz; i++)
     {
       int score = scores[i];
       ImageRef pos = corners[i];
       
       //Check left
+      if(i > 0)
       if(corners[i-1] == pos-ImageRef(1,0) && scores[i-1] > score)
        continue;
       
       //Check right
+      if(i < (sz - 1))
       if(corners[i+1] == pos+ImageRef(1,0) && scores[i+1] > score)
        continue;
       
@@ -427,8 +429,7 @@
          
          //Make point above point to the first of the pixels above the current 
point,
     //if it exists.
-         for(; corners[point_above].y < pos.y &&
-        corners[point_above].x < pos.x - 1; point_above++);
+         for(; corners[point_above].y < pos.y && corners[point_above].x < 
pos.x - 1; point_above++);
          
          
          for(int i=point_above; corners[i].y < pos.y && corners[i].x <= pos.x 
+ 1; i++)




reply via email to

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