Skip to content
Browse files

Merge pull request #5 from ritsz/master

Sort call by reference and Max/Min Removed.
  • Loading branch information...
2 parents d43b876 + 0792485 commit 3df1ce2438497531bd7db8e07215a7dea431f5cf @abhinavgupta committed Oct 23, 2012
Showing with 1 addition and 14 deletions.
  1. +1 −14 SIFT_Descriptor.cpp
View
15 SIFT_Descriptor.cpp
@@ -15,7 +15,7 @@
using namespace cv;
//Sorting Comparison Function - Added by Ritesh
-bool myobject (DMatch i,DMatch j)
+bool myobject (const DMatch& i,const DMatch& j)
{
return (i.distance<j.distance);
}
@@ -65,19 +65,6 @@ int main (int argc, char** argv)
std::vector <DMatch> matches; //Initializing matcher and vector for matches extracted
matcher.match( descriptors_object, descriptors_scene, matches);
- double max_dist = 0;
- double min_dist = 100; //Initializing distance measuremenets for matches
-
- for (int i = 0; i <descriptors_object.rows; i++)
- {
- double dist = matches[i].distance;
- if( dist < min_dist) min_dist = dist; // finding max and min distance values
- if( dist > max_dist) max_dist = dist;
- }
-
- printf ("-- Max Distance : %f \n", max_dist);
- printf ("-- Min Distance : %f \n", min_dist);
-
std::vector<DMatch> good_matches;
std::sort(matches.begin(),matches.end(),myobject);

0 comments on commit 3df1ce2

Please sign in to comment.
Something went wrong with that request. Please try again.