使用opencv和c ++跟踪帧序列中的某些特定点

时间:2013-11-20 14:09:29

标签: c++ opencv

我是图像处理和c ++编程的新手。这是我到目前为止能够保持帧序列中某些特定点的坐标所做的事情:

我可以在frame1中找到圆圈的中心。

cv::HoughCircles( tmp2, circles, CV_HOUGH_GRADIENT, 1, 300, 300, 100);

       for( size_t i = 0; i < circles.size(); i++ ){

            Point center(cvRound(circles[i][0]), cvRound(circles[i][1]));
            cout << "center" << center.x << ", " << center.y << endl;
            Vector.push_back(std::make_pair(center.x,center.y));               //coordinates of center points

            int radius = cvRound(circles[i][2]);
            // circle center
            circle( tmp2, center, 3,  1 , -1, 8, 0 );           
             // circle outline
            circle( tmp2, center, radius,  1  , 3, 8, 0 );      

        }
            }
  1. 这个中心点包含什么?它包含像素值吗? 那一点?
  2. 如果我有例如,frame1中的3个圆圈...是一个在向量中复制(make_pair)它们的好方法吗?
  3. 如何在frame2中跟踪这些中心点以找到它们的新坐标?
  4. 提前感谢..

1 个答案:

答案 0 :(得分:1)

  1. 是的,中心包含坐标,它是structure with fields x and y
  2. 这取决于你之后需要什么。你想如何进一步处理它们?
  3. 多个对象跟踪取决于您拥有的图像类型。没有任何先验信息,您无法“跟踪”圆圈的中心。它是合成圆圈,还是只是一些真实物体或其他东西?检查第一个答案here,它是相关的。