Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Sort call by reference and Max/Min Removed. #5

Merged
merged 5 commits into from over 1 year ago

2 participants

Ritesh Ranjan Abhinav Gupta
Ritesh Ranjan

Call by reference instead of value will be faster,and max/min was not needed now I guess,so removed it

Abhinav Gupta abhinavgupta merged commit 3df1ce2 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 14 deletions. Show diff stats Hide diff stats

  1. +1 14 SIFT_Descriptor.cpp
15 SIFT_Descriptor.cpp
@@ -15,7 +15,7 @@
15 15 using namespace cv;
16 16
17 17 //Sorting Comparison Function - Added by Ritesh
18   -bool myobject (DMatch i,DMatch j)
  18 +bool myobject (const DMatch& i,const DMatch& j)
19 19 {
20 20 return (i.distance<j.distance);
21 21 }
@@ -65,19 +65,6 @@ int main (int argc, char** argv)
65 65 std::vector <DMatch> matches; //Initializing matcher and vector for matches extracted
66 66 matcher.match( descriptors_object, descriptors_scene, matches);
67 67
68   - double max_dist = 0;
69   - double min_dist = 100; //Initializing distance measuremenets for matches
70   -
71   - for (int i = 0; i <descriptors_object.rows; i++)
72   - {
73   - double dist = matches[i].distance;
74   - if( dist < min_dist) min_dist = dist; // finding max and min distance values
75   - if( dist > max_dist) max_dist = dist;
76   - }
77   -
78   - printf ("-- Max Distance : %f \n", max_dist);
79   - printf ("-- Min Distance : %f \n", min_dist);
80   -
81 68 std::vector<DMatch> good_matches;
82 69
83 70 std::sort(matches.begin(),matches.end(),myobject);

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.