在OpenCV的Android或Java的设置SURF算法参数 [英] Setting SURF algorithm parameters in OpenCV Android or Java
问题描述
有关Android的OpenCV中的对象匹配的问题。
A question about the object matching in Android-Opencv.
正如我无法找到Android平台使用SURF的任何样品code。我想引用一些示例codeS在C ++中。
As I cannot find any sample code of using SURF in Android platform. I would like to refer to some sample codes in C++.
不过,我不知道如何设置SURF FeatureDetector的阈值的机器人。任何与Android,的OpenCV的经验可以帮助?
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 ?
非常感谢..!
推荐答案
我不认为是可能的权利,但有我使用的是一种解决方法。你必须创建一个文本文件containig的参数,然后用你的特征检测器内的方法读取文件。事情是这样的:
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!
这篇关于在OpenCV的Android或Java的设置SURF算法参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!