2013-07-25 30 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