Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Java BRIEF

I am learning OpenCV 3.x using java and came across problem using BRIEF detector:

DescriptorExtractor brief = DescriptorExtractor.create(DescriptorExtractor.BRIEF);
    MatOfKeyPoint keypoints = new MatOfKeyPoint();
    brief.compute(gray, keypoints, copyMat);
    Features2d.drawKeypoints(copyMat, keypoints, copyMat);

I get error OpenCV Error: Bad argument (Specified descriptor extractor type is not supported.) Actually this code doesn't work with any of its static members. So I have tried the code below and there is no BRIEF only ORB which is FAST and BRIEF.

FeatureDetector fast = FeatureDetector.create(FeatureDetector.ORB);
    MatOfKeyPoint keypoints = new MatOfKeyPoint();
    fast.detect(gray, keypoints);
    Features2d.drawKeypoints(copyMat, keypoints, copyMat);

Is there a mistake in my code?

Thanks.

Java BRIEF

I am learning OpenCV 3.x using java and came across problem using BRIEF detector:

DescriptorExtractor brief = DescriptorExtractor.create(DescriptorExtractor.BRIEF);
    MatOfKeyPoint keypoints = new MatOfKeyPoint();
    brief.compute(gray, keypoints, copyMat);
Mat descriptors = new Mat();
 Features2d.drawKeypoints(copyMat, brief.compute(gray, keypoints, descriptors);

    Features2d.drawKeypoints(gray, keypoints, copyMat);

I get error This results in OpenCV Error: Bad argument (Specified descriptor extractor type is not supported.) Actually this code doesn't work with any of its static members. So I have tried the code below and there is no BRIEF only ORB which is FAST and BRIEF.supported.)

FeatureDetector fast = FeatureDetector.create(FeatureDetector.ORB);
    MatOfKeyPoint keypoints = new MatOfKeyPoint();
    fast.detect(gray, keypoints);
    Features2d.drawKeypoints(copyMat, keypoints, copyMat);

Is there a mistake in my code?code or is BRIEF really not supported?

Thanks.