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.