Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

ORB example fails

Hello, I am working through the examples in chapter 8 of the book Practical OpenCV by Samarth Brahmbhatt.

I'm running example 8.4, copied from their included source code:

vector<KeyPoint> train_kp;
Mat train_desc;

OrbFeatureDetector featureDetector;
featureDetector.detect(train_g, train_kp);

cout << "Key Point size" << train_kp.size() << endl;

OrbDescriptorExtractor featureExtractor;
featureExtractor.compute(train_g, train_kp, train_desc);

cout << "Descriptor depth " << train_desc.depth() << endl;

flann::Index flannIndex(train_desc, flann::LshIndexParams(12, 20, 2), cvflann::FLANN_DIST_HAMMING);

For train_kp.size(), I get 496. For train_descr.depth(), I get 0.

When executing I get an exception at the line, flan:: ...

I'm using their supplied image. I'm running on Windows compiling with Visual Studio 2012, while I believe they wrote and tested their code running on Linux. I have successfully run previous examples in the book.

I'm guessing that the 0 descriptors is at the heart of the problem and causes the exception at flan::.

Does anyone know why I'm getting this error? Is the problem, in fact, 0 descriptors?

Thanks, Barry.

ORB example fails

Hello, I am working through the examples in chapter 8 of the book Practical OpenCV by Samarth Brahmbhatt.

I'm running example 8.4, copied from their included source code:

vector<KeyPoint> train_kp;
Mat train_desc;

OrbFeatureDetector featureDetector;
featureDetector.detect(train_g, train_kp);

cout << "Key Point size" << train_kp.size() << endl;

OrbDescriptorExtractor featureExtractor;
featureExtractor.compute(train_g, train_kp, train_desc);

cout << "Descriptor depth " << train_desc.depth() << endl;

flann::Index flannIndex(train_desc, flann::LshIndexParams(12, 20, 2), cvflann::FLANN_DIST_HAMMING);

For train_kp.size(), I get 496. For train_descr.depth(), I get 0.

When executing I get an exception at the line, flan:: flann:: ...

I'm using their supplied image. I'm running on Windows compiling with Visual Studio 2012, while I believe they wrote and tested their code running on Linux. I have successfully run previous examples in the book.

I'm guessing that the 0 descriptors is at the heart of the problem and causes the exception at flan::.flann::.

Does anyone know why I'm getting this error? Is the problem, in fact, 0 descriptors?

Thanks, Barry.