2

I've wrote simple template-matching program using OpenCV, which produces surprisingly different results on Android and OSx.

First, see what I'm doing:

  IplImage *image = cvLoadImage("test3a.png", -1);
  Mat templateMat(image);

  // detecting keypoints
  OrbFeatureDetector detector(500);
  std::vector<KeyPoint> templateKeypoints;
  detector.detect(templateMat, templateKeypoints);

  // computing descriptors
  Mat templateDescriptors;
  OrbDescriptorExtractor extractor;
  extractor.compute(templateMat, templateKeypoints, templateDescriptors);

  // matches
  BFMatcher matcher(cv::NORM_HAMMING2);
  std::vector<std::vector<DMatch> > matches;
  matcher.knnMatch(templateDescriptors, templateDescriptors, matches, 2);


Now next see what I'm getting:

Running same snippet on Nexus i9250 running Android 4.2.2 and on OSx 10.7(Lion) give these results:

  • Mat Objects: Same on both OSes
  • Keypoints: [On Android][2], [On OSx][3], [DIFFERENCE][4]
  • Descriptors: [On Android][5], [On OSx][6], [DIFFERENCE][7]
  • Matches: [On Android][8], [On OSx][9], [DIFFERENCE][10]

NOTE: There is no difference, if I sort these files; So what I'm not getting is, why I'm getting different ordered results?? Geting them in order is my requirement, as I need such for further computations. Further, running same code-snippet on same platform always produces same ordered results.

Stackexchange limits my account to post more than 2 links in post, so please check comments for the links.

Alexis King
  • 43,109
  • 15
  • 131
  • 205
Abhinav Mehta
  • 201
  • 2
  • 4
  • This stackexchange needs 2 or more reputation points to post 2 or more links, so links are here: http://bpaste.net/show/wxlwgy2b0ioJxfbg1b6c/ [2]: http://bpaste.net/show/wxlwgy2b0ioJxfbg1b6c/ [3]: http://bpaste.net/show/3BbAat8SGKiquX5bc2PO/ [4]: http://bpaste.net/show/mYwJkvvHydp4J6WsqXKQ/ [5]: http://bpaste.net/show/6Cgsab19jsfscE5UjwIK/ [6]: http://bpaste.net/show/h3ZAfDOFxXwy85qbFIWn/ [7]: http://bpaste.net/show/u0VmW0NYLHBae38RDKo7/ [8]: http://bpaste.net/show/gUW48kJgn0iN0oWP9gYY/ [9]: http://bpaste.net/show/pIhABMvVonldJcVGJryY/ [10]: http://bpaste.net/show/bb0izE0YkCQGGZA9vIPY/ – Abhinav Mehta Feb 26 '13 at 10:15

0 Answers0