在OpenCV的Andr​​oid或Java的设置SURF算法参数算法、参数、Andr、OpenCV

由网友(孤岛)分享简介:有关Android的OpenCV中的对象匹配的问题。A question about the object matching in Android-Opencv.正如我无法找到Android平台使用SURF的任何样品code。我想引用一些示例codeS在C ++中。As I cannot find any sam...

有关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的阈值的机器人。任何与And​​roid,的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.0nhessianThreshold: 8000.noctaves: 3noctaveLayers: 4nupright: 0n";

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

SURFDetector.read(tempFile.getPath());

希望这会帮助你!

Hope this will help you!

阅读全文

相关推荐

最新文章