1

A question about the object matching in Android-Opencv.

As I cannot find any sample code of using SURF in Android platform. I would like to refer to some sample codes in C++.

But I have no idea about how to set the threshold value of SURF FeatureDetector in Android. Anyone with experience of Android-Opencv can help ?

Thanks a lot..!

1 Answer 1

1

I don't think is possible right now, but there is a workaround I'm using. You have to create a text file containig the parameters and then read the file with the method inside your feature detector. Something like this:

File tempDir = context.getCacheDir();
File tempFile = File.createTempFile("config", ".yml", tempDir);

String settings = "%YAML:1.0\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n";

FileWriter writer = new FileWriter(tempFile, false);
writer.write(settings);
writer.close();

SURFDetector.read(tempFile.getPath());

Hope this will help you!

Sign up to request clarification or add additional context in comments.

2 Comments

Yes i can confirm that currently this is the appropriate approach to do it in OpenCV4Android.
are \noctaves and \noctaveLayers typos? shouldn't it be \nnOctaves and \nnOctaveLayers since \n is for next line? per docs.opencv.org/2.4/modules/nonfree/doc/… nOctaves

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.