《学习OpenCV(中午版)》第3章 练习5

来源:互联网 发布:mysql管理器 编辑:程序博客网 时间:2024/04/29 09:12
void myType5() {int width = 210;int height = 210;cvNamedWindow("Interest ROI");IplImagecanvas = cvCreateImage(cvSize(widthheight), IPL_DEPTH_8U, 1);cvSet(canvascvScalar(0));int interest_x = 0;int interest_y = 0;int offset_x = width;int offset_y = height;int add = 0;bool condition = false;while(add<200) {cvSetImageROI(canvascvRect(interest_xinterest_yoffset_xoffset_y));if(condition) {cvSet(canvascvScalar(add));} else {cvSet(canvascvScalar(0));condition = true;}cvResetImageROI(canvas); add += 20;interest_x += 10;interest_y += 10;offset_x -= 20;offset_y -= 20;}cvShowImage("Interest ROI"canvas);}
原创粉丝点击