Problem with warning: comparison between signed and unsigned integer expressions
authorlaurentBerger <laurent.berger@univ-lemans.fr>
Sun, 3 May 2015 12:08:24 +0000 (14:08 +0200)
committerlaurentBerger <laurent.berger@univ-lemans.fr>
Sun, 3 May 2015 12:08:24 +0000 (14:08 +0200)
samples/cpp/matchmethod_orb_akaze_brisk.cpp

index 556870e..6711ba3 100644 (file)
@@ -56,8 +56,9 @@ int main(void)
                 descriptorMatcher->match(descImg1, descImg2, matches, Mat());
  // Keep best matches only to have a nice drawing
                 Mat index;
-                Mat tab(int(matches.size()), 1, CV_32F);
-                for (int i = 0; i<matches.size(); i++)
+                int nbMatch=int(matches.size());
+                Mat tab(nbMatch, 1, CV_32F);
+                for (int i = 0; i<nbMatch; i++)
                     tab.at<float>(i, 0) = matches[i].distance;
                 sortIdx(tab, index, SORT_EVERY_COLUMN + SORT_ASCENDING);
                 vector<DMatch> bestMatches;