Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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