ORB not detecting any keypoint [closed]

asked 2014-05-04 03:34:38 -0600

rednaks gravatar image

updated 2014-05-04 03:46:08 -0600

berak gravatar image

I'm trying to detect keypoints with ORB everything is fine until I switched to Opencv 2.4.9.

Firts, it seems that the number of keys decresed, and for some images, no keypoints are detected :

This is my code compiled with two version : (2.3.1, 2.4.8 and 2.4.9)

#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/features2d/features2d.hpp>


using namespace cv;


int main(int argc, char **argv){

  Mat img = imread(argv[1]);

  std::vector<KeyPoint> kp;

  OrbFeatureDetector detector;
  detector.detect(img, kp);
  std::cout << "Found " << kp.size() << " Keypoints " << std::endl;

  Mat out;
  drawKeypoints(img, kp, out, Scalar::all(255));

  imshow("Kpts", out);

  waitKey(0);
  return 0;
}

Result : 2.3.1 : Found 152 Keypoints

kp detected

2.4.9 and 2.4.8 : Found 0 Keypoints

zero kpts

I also tested with a different ORB Constructor, but I get the same result, no KPts. The same constuctor values as in 2.3.1 default's constructor : 2.4.9 (2.4.8) custom constr :

#include <iostream>
#include <opencv2/opencv.hpp>
#include <opencv2/features2d/features2d.hpp>


using namespace cv;


int main(int argc, char **argv){

  Mat img = imread(argv[1]);

  std::vector<KeyPoint> kp;

  // default in 2.4.9 is : ORB(700, 1.2f, 3, 31, 0);
  OrbFeatureDetector detector(500, 1.2f, 8, 31, 0); // default values of 2.3.1
  detector.detect(img, kp);
  std::cout << "Found " << kp.size() << " Keypoints " << std::endl;
  Mat out;
  drawKeypoints(img, kp, out, Scalar::all(255));

  imshow("Kpts", out);

  waitKey(0);
  return 0;
}

Do you have any idea what's happening ? And how can I fix it ?

Thank you.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-09-30 00:38:52.352842

Comments

that's you ? (if not, you'll want to watch the outcome there)

berak gravatar imageberak ( 2014-05-04 03:43:46 -0600 )edit

@break yes, it's me. I posted here because I don't really know if it's a bug or something else.

rednaks gravatar imagerednaks ( 2014-05-04 04:15:18 -0600 )edit

ah, nice that you made an issue.

(btw, the attachment links seem to be broken/lead elsewhere)

berak gravatar imageberak ( 2014-05-04 04:20:40 -0600 )edit

Oh thank you, I didn't notice that, I'll host them somewhere elese.

rednaks gravatar imagerednaks ( 2014-05-04 05:47:54 -0600 )edit

2.4.2 already finds 0 keypoints (in the last image) here

berak gravatar imageberak ( 2014-05-06 05:39:26 -0600 )edit

I'm not sure, but I think that the "issue" was introduced since 2.4.0, if it's a bug, that would be really weird that no one noticed that ...

rednaks gravatar imagerednaks ( 2014-05-06 16:17:25 -0600 )edit