From: <bl...@us...> - 2009-08-06 15:28:18
|
Revision: 4178 http://hugin.svn.sourceforge.net/hugin/?rev=4178&view=rev Author: blimbo Date: 2009-08-06 15:28:09 +0000 (Thu, 06 Aug 2009) Log Message: ----------- Fixed sorting issue Modified Paths: -------------- hugin/branches/gsoc2009_lenscalibration/src/lens_calibrate/ProcessImage.cpp Modified: hugin/branches/gsoc2009_lenscalibration/src/lens_calibrate/ProcessImage.cpp =================================================================== --- hugin/branches/gsoc2009_lenscalibration/src/lens_calibrate/ProcessImage.cpp 2009-08-06 15:00:12 UTC (rev 4177) +++ hugin/branches/gsoc2009_lenscalibration/src/lens_calibrate/ProcessImage.cpp 2009-08-06 15:28:09 UTC (rev 4178) @@ -59,6 +59,9 @@ } bool compare_yx (const vigra::Point2D i,const vigra::Point2D j){ + + //return (j->y<i->y); + if(j->x == i->x){ return (j->y>i->y); }else{ @@ -68,10 +71,12 @@ bool compare_xy (const vigra::Point2D i,const vigra::Point2D j){ - if(i->x == j->x){ - return (i->y>j->y); + //return (i->x<j->x); + + if(i->y == j->y){ + return (i->x>j->x); }else{ - return (i->x<j->x); + return (i->y<j->y); } } @@ -1336,8 +1341,10 @@ int i_y_min = min_y_index(joined_segs); if(abs(i_x_max - i_x_min) > abs(i_y_max - i_y_min)){ length_sq = point_line_length_squared(joined_segs[i_x_max],joined_segs[i_x_min]); + sort(joined_segs.begin(), joined_segs.end(), compare_yx); }else{ length_sq = point_line_length_squared(joined_segs[i_y_max],joined_segs[i_y_min]); + sort(joined_segs.begin(), joined_segs.end(), compare_yx); } if(length_sq >= min_line_length_squared){ //plot_inliers(jseg, image, joined_segs, js); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |