OpenCV SURF, is it normal that the captured videos lag by a little? How to speed it up?

一笑奈何 提交于 2020-01-03 15:34:34

问题


How do I speed up the correspondence matching processes of SURF? I used the samples provided and changed it to capture color images from the webcam for processing, however, the speed certainly needs improvement. Where should this be tackled on?


回答1:


First, SURF (at least, OpenCV's one) supports only gray images.

There are lots of descriptors parameters avalable to tune, setting them to lower values can increase performance:

typedef struct CvSURFParams
{
   int extended; // 0 means basic descriptors (64 elements each),
                 // 1 means extended descriptors (128 elements each)
   double hessianThreshold; // only features with keypoint.hessian
         // larger than that are extracted.
                 // good default value is ~300-500 (can depend on the
         // average local contrast and sharpness of the image).
                 // user can further filter out some features based on
         // their hessian values and other characteristics.
   int nOctaves; // the number of octaves to be used for extraction.
                 // With each next octave the feature size is doubled
         // (3 by default)
   int nOctaveLayers; // The number of layers within each octave
         // (4 by default)
}
CvSURFParams;

See OpenCV's SURF docs.

Also, check out original article and notes on OpenSURF lib




回答2:


There is an issue with the cvRound function, that is used extensively by SURF code. To sum up, function overloading comes with an additional type conversion between double and float, which slows the rounding code. You can find a detailed explanation, along with speed measurements and a patch here: http://computer-vision-talks.com/2011/06/a-few-thoughts-about-cvround/.



来源:https://stackoverflow.com/questions/3243889/opencv-surf-is-it-normal-that-the-captured-videos-lag-by-a-little-how-to-speed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!