2013-07-25 26 views

回答

1

您可以使用下面的函数来设置一个回调窗口

SetMouseCallback 

文档浏览:

http://docs.opencv.org/modules/highgui/doc/user_interface.html

社交圈,你可以使用的功能:

circle(Mat& img, Point center, int radius, const Scalar& color, int thickness=1, int lineType=8, int shift=0) 

文档在这里:

http://opencv.willowgarage.com/documentation/cpp/drawing_functions.html

+0

是绘制矩形,我使用的,知道使用鼠标,我们需要调用SetMouseCallback功能......但在那之后如何proceed.I不知道如何使用圆的半径和中心通过SetMouseCallback函数..在那只有我被殴打...请帮助我.... – user2459619

+0

你需要第一个图像,你想要绘制圆圈。这是一个递归操作,因此您将需要一个while循环来重绘您的图像或只是在回调函数中重绘它。简单的方法是像在这里一样定义全局img对象:http://code.opencv.org/projects/opencv/repository/revisions/master/entry/samples/cpp/ffilldemo.cpp。你可以通过回调的void点传递图像。在你的回调中,你可以比cv :: circle(img,cv :: Point point(x,y),10,cv :: Scalar(255,0,255)); imshow(“Window”,img)更简单。 – jamk