opencv中的鼠标响应的函数是setMouseCallback(),可以实现画图的功能。
c++: void setMousecallback(const string& winname, MouseCallback onMouse, void* userdata=0)
#defineCV_EVENT_MOUSEMOVE 0
#defineCV_EVENT_LBUTTONDOWN 1
#defineCV_EVENT_RBUTTONDOWN 2
#defineCV_EVENT_MBUTTONDOWN 3
#defineCV_EVENT_LBUTTONUP 4
#defineCV_EVENT_RBUTTONUP 5
#defineCV_EVENT_MBUTTONUP 6
#defineCV_EVENT_LBUTTONDBLCLK 7
#defineCV_EVENT_RBUTTONDBLCLK 8
#defineCV_EVENT_MBUTTONDBLCLK 9
#defineCV_EVENT_FLAG_LBUTTON 1
#defineCV_EVENT_FLAG_RBUTTON 2
#defineCV_EVENT_FLAG_MBUTTON 4
#defineCV_EVENT_FLAG_CTRLKEY 8
#defineCV_EVENT_FLAG_SHIFTKEY 16
#defineCV_EVENT_FLAG_ALTKEY 32