Ask Your Question
0

draw a plot between two center points in real-time

asked 2013-12-15 17:19:55 -0600

mahsa gravatar image

updated 2013-12-20 12:33:41 -0600

Moster gravatar image

If I want to draw a line between (center.x , center.y)in the current frame and (center.x , center.y) in the previous frame..should I every time that the code runs keep it in a vector and then take them two by two and use cvPoint() and cvLine() ?

Is this the correct way to do that by using opencv?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-12-20 09:05:32 -0600

Flart gravatar image

updated 2013-12-20 09:07:39 -0600

You can move center from previos frame to current frame, and then draw line.

cv::Point preCenter = cv::Point(0, 0); 

while(true)
{
    cv::Point center = cv::Point (preCenter.x+5, preCenter.y+5);

    cv::line(img, preCenter, center, cv::Scalar(255,0,0));

    preCenter = Point(center);
}
edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-12-15 17:19:55 -0600

Seen: 657 times

Last updated: Dec 20 '13