Refer from http://blog.csdn.net/yangtrees/article/details/7573919
[cpp]
view plaincopyprint?
#include "cv.h"
#include "highgui.h"
bool check_line_state=false;
IplImage* workImg;
IplImage* imgshow;
CvRect ROI_rect;
void on_mouse4(int event, int x,int y,int flags,void* param)
{
int thickness=2;
CvPoint p1,p2;
if(event==CV_EVENT_LBUTTONDOWN)
{
//当前鼠标位置(x,y)
ROI_rect.x=x;
ROI_rect.y=y;
check_lin......
阅读全文