MSER produces different results for android and desktop version [closed]
Hello, all,
It seems like MSER algorithm works differently for desktop and Android version of OpenCV 3.0. The code below produces different results depending on the platform where OpenCV is run (desktop or android):
Mat img = Imgcodecs.imread(filename, Imgcodecs.IMREAD_GRAYSCALE);
MatOfKeyPoint mokp = new MatOfKeyPoint();
FeatureDetector fd = FeatureDetector.create(FeatureDetector.MSER);
fd.detect(img, mokp);
and then System.out.println("Mat of key points = " + mokp.rows() + "x" + mokp.cols()); (for desktop)
or Log.i(TAG, "Mat of key points = " + mokp.rows() + "x" + mokp.cols()); (for android)
This is what I get in logs: Mat of key points = 79x1 (desktop)
Mat of key points = 216x1 (android)
Why is the difference? Are there any MSER default settings, which are different for desktop and android? I'm stuck here, any help much appreciated.
Regards
I think you must change some parameters.
when use create for MSER use explicit params In c++ something like that :
MSER::create(5,60,1440,0.25,,0.2,200,1.01,0.003,5); In java I don't know but use same parameters
After If you 've got still different results you can post your image and some users would be able to test it
Thanks a lot, I will try and let know the results. One question though - if I use exact same file for testing on android and desktop, wouldn't it matter if it has compression or not? I though imread() removes compression and colors or does it?
Yes I hope so. But with uncompressed image I'm sure that's a byte is read like a byte on all platform.
I found the problem - different versions of OpenCV on desktop and android. Version 3.0 is apparently using different default parameters than 3.0 RC1.
Thank you very much for prompt response and for help! Case closed