I'm trying to get the keypoints in a image using the detector ORB but always gets an exception and crash, my code is the next one.
vector < KeyPoint > kp;
int nfeatures = 500;
float scaleFactor = 1.2f;
int nlevels = 8;
int edgeThreshold = 15;
int firstLevel = 0;
int WTA_K = 2;
int scoreType = ORB::HARRIS_SCORE;
int patchSize = 31;
int fastThreshold = 20;
Ptr < ORB > detector = ORB::create(
nfeatures,
scaleFactor,
nlevels,
edgeThreshold,
firstLevel,
WTA_K,
scoreType,
patchSize,
fastThreshold );
detector->detect(img, kp);
cout << "Found " << kp.size() << " Keypoints " << std::endl;
Mat out;
drawKeypoints(img, kp, out, Scalar::all(255));
imshow("Kpts", out);
img is declared early, the problem is when do detector->detect(img, kp); and I don't know what problem is, I'm trying other form of do it but all crash in the call of detect().
I try to do with BRISK and the problem is the same in the call of detect crash. With brisk I did the next one for simplify:
Ptr < BRISK > detector = BRISK::create();
vector <KeyPoint> kp;
detector->detect(img,kp);
This is turning exasperating.
I using opencv 3 in visual studio 2015 with windows 10.
Sorry for my English and thanks for the answer.