From: <ste...@us...> - 2007-07-17 18:25:48
|
Revision: 2283 http://hugin.svn.sourceforge.net/hugin/?rev=2283&view=rev Author: stereo_sl Date: 2007-07-17 11:25:39 -0700 (Tue, 17 Jul 2007) Log Message: ----------- - added additional bins in the orientation assignment Modified Paths: -------------- gsoc07_featuredetection/Descriptor.cpp gsoc07_featuredetection/Descriptor.h Modified: gsoc07_featuredetection/Descriptor.cpp =================================================================== --- gsoc07_featuredetection/Descriptor.cpp 2007-07-17 17:57:31 UTC (rev 2282) +++ gsoc07_featuredetection/Descriptor.cpp 2007-07-17 18:25:39 UTC (rev 2283) @@ -47,12 +47,21 @@ int pointX; int pointY; - //double angles[NR_ANGLE_BINS]; - //double angles[NR_ANGLE_BINS][2]; - +/* +S0: if dx>0 and dy>0 and |dy|>|dx| +S1: if dx>0 and dy>0 and |dy|<=|dx| +S2: if dx>0 and dy<=0 and |dy|<=|dx| +S3: if dx>0 and dy<=0 and |dy|>|dx| +S4: if dx<=0 and dy<=0 and |dy|>|dx| +S5: if dx<=0 and dy<=0 and |dy|<=|dx| +S6: if dx<=0 and dy>0 and |dy|<=|dx| +S7: if dx<=0 and dy>0 and |dy|>|dx| + */ double Sx[NR_ANGLE_BINS]; double Sy[NR_ANGLE_BINS]; + + double dx; double dy; @@ -102,19 +111,39 @@ if(dx>0) { if(dy>0) { - Sx[0]+=dx; - Sy[0]+=dy; + if(fabs(dy)>fabs(dx)) { + Sx[0]+=dx; + Sy[0]+=dy; + } else { + Sx[1]+=dx; + Sy[1]+=dy; + } } else { - Sx[1]+=dx; - Sy[1]+=dy; + if(fabs(dy)<=fabs(dx)) { + Sx[2]+=dx; + Sy[2]+=dy; + } else { + Sx[3]+=dx; + Sy[3]+=dy; + } } } else { - if(dy>0) { - Sx[3]+=dx; - Sy[3]+=dy; + if(dy<=0) { + if(fabs(dy)>fabs(dx)) { + Sx[4]+=dx; + Sy[4]+=dy; + } else { + Sx[5]+=dx; + Sy[5]+=dy; + } } else { - Sx[2]+=dx; - Sy[2]+=dy; + if(fabs(dy)<=fabs(dx)) { + Sx[6]+=dx; + Sy[6]+=dy; + } else { + Sx[7]+=dx; + Sy[7]+=dy; + } } } Modified: gsoc07_featuredetection/Descriptor.h =================================================================== --- gsoc07_featuredetection/Descriptor.h 2007-07-17 17:57:31 UTC (rev 2282) +++ gsoc07_featuredetection/Descriptor.h 2007-07-17 18:25:39 UTC (rev 2283) @@ -23,7 +23,7 @@ #include "Image.h" #include "HessianDetector.h" -#define NR_ANGLE_BINS 4 +#define NR_ANGLE_BINS 8 class Descriptor { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |