2011年9月30日
摘要: 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明、 阅读(1182) 评论(0) 推荐(0) 编辑
摘要: 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) 编辑
摘要: View Code 1 //ROI的蓝色通道增加150灰度值效果 2 IplImage* src; 3 if((src=cvLoadImage("fruit.jpg",1))!=0) 4 { 5 int x=10; 6 int y=20; 7 int width=50; 8 int height=100; 9 int add=150;10 cvSetImageROI(src,cvRect(x,y,width,height));11 cvAddS(src,c... 阅读全文
posted @ 2011-09-30 15:27 Ming明、 阅读(1603) 评论(0) 推荐(0) 编辑