随笔分类 -  OpenCV第四章

OpenCV_ 滑动条模拟按钮
摘要:HighGUI没有显示提供任何形式的按钮,可以使用只有两个状态的滑动条来代替按钮。View Code 1 int g_switch_value=0; 2 void switch_on_function() 3 { 4 5 } 6 void switch_off_function() 7 { 8 9 }10 11 void switch_callback(int position)12 {13 if(position==0)14 switch_off_function();15 else16 switch_on_function();17 ... 阅读全文
posted @ 2011-09-30 16:26 Ming明、 阅读(1183) 评论(0) 推荐(0) 编辑
OpenCV_用鼠标在窗口画方形
摘要:View Code 1 void my_mouse_callback(int event,int x,int y,int flags,void* param); 2 3 CvRect box; 4 5 bool drawing_box=false; 6 7 // a little subroutine to draw a box on to an image 8 void draw_box(IplImage* img,CvRect rect) 9 {10 cvRectangle(img,cvPoint(box.x,box.y),cvPoint(box.x+box.width,b... 阅读全文
posted @ 2011-09-30 15:54 Ming明、 阅读(2112) 评论(0) 推荐(0) 编辑