【发布时间】:2014-01-03 05:37:27
【问题描述】:
我快疯了...我想在最后一帧的 (center.x 和 center.y) 和当前帧的 (center.x 和 center.y) 之间画一条线...
for(int j=0; j<Frames; j++){
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));
int radius = cvRound(circles[i][2]);
circle( dis, center, 3, 1 , -1, 8, 0 );
circle( dis, center, radius, 1 , 3, 8, 0 );
cv::Point2i p1(center.x, center.y);
}
}
cv::Mat base(100, 100, CV_32F);
cv::Point2i p2(center.x, center.y); //for the previous frame
cv::line(base, p1, p2, cv::Scalar(1.0), 1, CV_AA); // CV_AA == Anti-aliased flag
代码第一次运行时,p1为当前帧会make!但我不知道如何将其保存在缓冲区中以保留它,然后在代码第二次运行时在这两点之间画一条线。
提前谢谢..
【问题讨论】:
标签: c++ opencv image-processing video-streaming