Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

though i think, you're on the wrong path with the purpose of it, there are ways to speed up feature matching

// 1. profile, don't guess !
int64 t0 = getTickCount();
some_operation(input, output);
int64 t1 = getTickCount();
double seconds = (t1-t0)/getTickFrequency();
cerr << "some_operation took: " << seconds << " seconds." << endl;

// 2. use detectAndCompute(), not single detect() and compute() calls. 
// (it has to compute the features for the detection anyway, avoid wouble work)
OrbFeatureDetector detector; // no seperate extractor needed.
detector.detectAndCompute(image, Mat(), keypoints, descriptors);

// 3. restrict number of keypoints (if you can allow it, quality.)
// please also see the remarks on other optimizations there, scaleFactor, scoreType
OrbFeatureDetector detector(500); // 500 enough ? experiment.

// 4. work on smaller images:
pyrDown(image, image); // half size, 1/4 area to check.
detector.detectAndCompute(image, Mat(), keypoints, descriptors);