3
votes

I am trying to run BRISK within java using the openCV wrapper javacv. I don't have any problems running a FAST corner detector but I am stuck on how to run the compute function. When I run this code:

private int threshold = 30;
private int octaves = 3;
private float scale = 1.0f;

private BRISK brisk = null;
private KeyPoint keyPoints = null;
private CvMat img, descriptors;

descriptors = new CvMat();
keyPoints = new KeyPoint();

img = getFrame();

brisk = new BRISK(threshold, octaves, scale);
brisk.compute(img, null, keyPoints, descriptors, false);

I get following error:

OpenCV Error: Bad argument (Unknown array type) in unknown function, file ......\src\opencv\modules\core\src\matrix.cpp, line 698

I am sure that the img is not the problem because I can run a FAST corner detection on it. I think the actual problem is the descriptors matrix because I have no clue how to initialize it. Any ideas?

1
I am using OpenCv Java 2.4.9 but I could not find a way to create BRISK object as you have done above code. Which package did you import to do so, also which version of JavaCv were you using?mualloc

1 Answers

1
votes

The solution to the problem is the descriptors need to be initialized as new CvMat(null)