ORB FeatureDetector has different result between C++ and Android.

asked 2014-10-26 08:36:10 -0600

Though I found similar topics, I simplify the problem and ask again.

ORB FeatureDetector has different result between C++ and Android. Why?

C++ code snippet:

Ptr<FeatureDetector> Detector = FeatureDetector::create("ORB");
Mat frame = imread("rgb24bit.png");
vector<KeyPoint> kp;
Detector->detect(frame, kp);
OutputKeyPoint2Text(kp, "keypoint.csv");

Java code snippet:

FeatureDetector Detector = FeatureDetector.create(FeatureDetector.ORB);
Mat frame = new Mat();
try {
    frame = Utils.loadResource(getApplicationContext(), R.drawable.rgb24bit, Highgui.CV_LOAD_IMAGE_COLOR );
} catch (IOException e) {
}
MatOfKeyPoint kp = new MatOfKeyPoint();
Detector.detect(frame, kp);
OutputKeyPoint2Text(kp, "keypoint.csv");

"rgb24bit.png" and R.drawable.rgb24bit are same image. You can use any RGB 24bit PNG image.

If you use any FeatureDetector except ORB(FAST,STAR,HARRIS...), both result are exactly same KeyPoint values.

But when you use ORB, some different result exists though almost results are same (5,6 rows in 500 rows). And more, the order of rows are quite different as if they have shuffled.

It seems to lead later DescriptorMatcher to wrong result.

Any idea?

BTW, If you use BRISK, Point, size, response of KeyPoint and its order are exactly same though some angle value has small error less than 0.001. curious...

Thanks.

edit retag flag offensive close merge delete