Set a threshold on FAST feature detection?
When I use the FAST detector on an image of the size 960 x 720, I get about 9000 points with the current method. I was wondering if there is a technique to set a limit on the number of points that are being detected? Like the 500 best points only? I know that reducing the resolution gives less points, but I want to know if there is another way with a higher resolution?
FeatureDetector fast = FeatureDetector.create(FeatureDetector.FAST);
fast.detect(mIntermediateMat, points);
// gives +9000 points
This would help me in the description phase to reduce the calculation time to describe all these points. (takes about 0.8 seconds at the moment, and the descriptor is bigger then the original image when looking at the Mb). I don't use the native part, but the Java code and the OpenCV Library 2.4.4.
EDIT: I found this article on how to describe ORB parameters, and was wondering if it might work for FAST.
I added
FeatureDetector fast = FeatureDetector.create(FeatureDetector.FAST);
String filename = "mnt/sdcard/fast_params.yml";
WriteFile(filename, "%YAML:1.0\nimage: mIntermediateMat\nkeypoints: points\nthreshold : 300 \nnonmaxSupression : true\ntype : FastFeatureDetector::TYPE_9_16\n");
DescriptorExtractor extractor = null;
extractor.read(filename);
fast.detect(mIntermediateMat, points);
The string is based upon information i found here but it is giving back a NullPointerException and I'm not use it even works for FAST. Anyone?
For your EDIT: Guess this results in the first solution @alexander-pacha gave to you, which should work fine if you do it like in http://answers.opencv.org/question/3167/java-how-to-set-parameters-to-orb-featuredetector/?answer=17296#post-id-17296
The method proposed here is valid, but I can barely imagine the reading operation in RT scenarios. As for configuration itself, please see my config applied to the code working under OpenCV 3.0
The last parameter - type - is defined as enum in features2d,hpp as