Setting SURF algorithm parameters in OpenCV Android or Java

前端 未结 1 459
礼貌的吻别
礼貌的吻别 2021-01-16 05:49

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 code

相关标签:
1条回答
  • 2021-01-16 06:46

    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!

    0 讨论(0)
提交回复
热议问题