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..!

解决方案

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!

Logo

昇腾计算产业是基于昇腾系列(HUAWEI Ascend)处理器和基础软件构建的全栈 AI计算基础设施、行业应用及服务,https://devpress.csdn.net/organization/setting/general/146749包括昇腾系列处理器、系列硬件、CANN、AI计算框架、应用使能、开发工具链、管理运维工具、行业应用及服务等全产业链

更多推荐