Ask Your Question
0

Java: how to set up parameters for AKAZE features in OpenCv 3.0

asked 2015-07-29 02:56:51 -0500

missZBH gravatar image

updated 2015-07-29 03:02:24 -0500

I want to set parameters for AKAZE features in OpenCV 3.0 based on this post http://answers.opencv.org/question/31... I have successfully set parameters to ORB but it did not work for AKAZE. I am setting parameters based on documentation. Here is my code:


fd = FeatureDetector.create(FeatureDetector.AKAZE);
File outputDir = getCacheDir(); 
File outputFile = File.createTempFile("AKAZEDetectorParams", ".YAML", outputDir);
writeToFile(outputFile, "%YAML:1.0\ndescriptor_type: 1\ndescriptor_size: 0\ndescriptor_channels: 3\nthreshold: 0.001\nnOctaves: 4\nsublevels: 4\ndiffusivity: 1\n"); 
fd.read(outputFile.getPath()); 
fd.detect(originalImage, keyPointsEnvMap); //Crush

It crush on fd.detect() with the Error: OpenCV Error: Assertion failed (evolution_.size() > 0) in int cv::AKAZEFeatures::Create_Nonlinear_Scale_Space(const cv::Mat&), file /builds/master_pack-android/opencv/modules/features2d/src/kaze/AKAZEFeatures.cpp, line 102

When I comment out reading of the parameters it works fine. Pleas help me!

edit retag flag offensive close merge delete

Comments

3

hmm, can you try to save the default params to disk like fd.write("my.yml"); ?

imho it should be e.g. descriptor: 1 not descriptor_type: 1. also please have a look at the possible values here

berak gravatar imageberak ( 2015-07-29 03:22:13 -0500 )edit

is AKAZE faster ?, i m using the same feature extracter, but it is very slow.

Pallavi gravatar imagePallavi ( 2015-09-30 02:00:10 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2015-07-29 05:29:06 -0500

missZBH gravatar image

updated 2015-07-29 05:31:44 -0500

Thank you very much for the tip, the fd.write() method revealed that the true file should look like this descriptor: 3
descriptor_channels: 3
descriptor_size: 0
threshold: 1.0000000474974513e-03
octaves: 4
sublevels: 4
diffusivity: 1

So the method should look like:

writeToFile(outputFile, "%YAML:1.0\ndescriptor: 3\ndescriptor_size: 0\ndescriptor_channels: 3\nthreshold: 0.001\noctaves: 4\nsublevels: 4\ndiffusivity: 1\n");

Now it works fine.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-07-29 02:56:51 -0500

Seen: 1,804 times

Last updated: Jul 29 '15