How to create a SURF FeatureDetector with certain params in Android

2,769 views
Skip to first unread message

diegovarese

unread,
May 17, 2012, 11:19:35 PM5/17/12
to android...@googlegroups.com
I'm using the Android wrapper of OpenCV 2.4.0 and I can't see how I can create a SURF feature detector with certain parameters such as the hessian threshold and the number of octaves. I see that there is a FeatureDetector.create function that receives the detector type, but I didn't see anywhere to specify these params.

Thanks

Diego

Rui Marques

unread,
Aug 14, 2012, 10:19:03 AM8/14/12
to
You can see the work-around here:

[BROKEN link - see bellow]
http://code.opencv.org/projects/opencv/repository/entry/branches/2.4/opencv/modules/java/android_test/src/org/opencv/test/features2d/SURFFeatureDetectorTest.java

Basicaly you do something like this:

writeFile(filename, "%YAML:1.0\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n");

detector
.read(filename);

EDIT:

The link above is broken, here is a new link - but now for ORB instead of SURF - it works the same way:

http://code.opencv.org/projects/opencv/repository/revisions/master/entry/modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java

String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile
(filename, "%YAML:1.0\nscaleFactor: 1.1\nnLevels: 3\nfirstLevel: 0\nedgeThreshold: 31\npatchSize: 31\n");

extractor
.read(filename); //note: this will fail if the above parameters are not the ones expected by method

(...)





diegovarese

unread,
May 19, 2012, 8:42:38 PM5/19/12
to android...@googlegroups.com
Excellent, will try that. Thanks!

David

unread,
Aug 2, 2012, 3:50:15 PM8/2/12
to android...@googlegroups.com
Hi Diego,

Did you read the yml file successfully? If you did, can you show me a working example?

Thanks

David
Reply all
Reply to author
Forward
0 new messages