Send parameters to ORB Feature Detector, Android
I need to send parameters to the ORB Feature Detector from my Android app. The workaround mentioned here no longer seems to work. I am using OpenCV 3.0.
If I try to set parameters by writing a temp file, they seem to be ignored. If I deliberately mis-type a parameter name, it doesn't do anything. If I write out the parameters using the write() method, a file is indeed created but all it has is a 1-line header "%YAML: 1.0". XML fails too.
// try setting some params.
// first write a file (this is indeed created and can be viewed with 'adb shell')
String tempFileName = writeToFile("tempFile", "%YAML:1.0\nscaleFactor: 1.1\nnLevels: 5\nfirstLevel: 0\nedgeThreshold: 31\npatchSize: 31\n");
_detector.read(tempFileName); // seems to have no effect.
// try writing out params.
String fileName = myDir.getPath() + "/orb_params.yml";
_detector.write(fileName); // try yaml
fileName = myDir.getPath() + "/orb_params.xml";
_detector.write(fileName); // try xml
In the new OpenCV 3 API each feature detector has its own set of getters and setters to configure the parameters as seen here. However it seems that the Java build does not contain those ... maybe @berak can shed a light on this?
no real idea, what to do here. i'm a bit afraid, this is one of those "wontfix" things. it needs a radical change there, imho, and so far noone has made an attempt to do so (would break current java api, etc.)
Thanks for your feedback. So if I understand correctly, read/write is the only way to set/get params in Java but read/write is not implemented in ORB in C++. However it is implemented for other feature detectors in C++ so read/write will work with them from Java. Do I have that right?
^^ yes. that's right
Is this still a issue, or did you manage to find a workaround?