0

我们可以从背景减去图像中提取关键点吗?我通过首先减去其背景从视频中提取关键点,但它显示运行时错误

    if (! previous_frame.empty())  {
       subtract(current_frame, previous_frame, predict_img);
       detector.detect(predict_img, keypoint2);
       if (keypoint2.size > 20) // Error
   {
       RetainBestKeypoints(keypoint2, 20);
   }
   else 
   {
       //Want to ignore the frame , but how ?
   }

代码中提到了错误,

4

1 回答 1

0

The detect() method of keypoints detectors outputs an std::vector of keypoints. Thus, you should call keypoint2.size() instead of size without the parentheses.

Apart from that, and provoded that the type of the difference is compatible with the keypoint detector, yes you can (compute keypoints on difference images or background images).

于 2013-09-02T15:39:43.747 回答