opencv之roi示例

以后争取每天实验一个opencv代码吧,这样以后就可以直接复制这些代码了

opencv之roi示例

IplImage * test;
test = cvLoadImage(“2.jpg”);
cvNamedWindow(“哈哈”,CV_WINDOW_AUTOSIZE );
cvShowImage(“哈哈”,test);
//设置一下感兴趣区域,并且显示出来roi
cvSetImageROI(test,(cvRect)(1,1,200,200));
cvNamedWindow(“ROI”,CV_WINDOW_AUTOSIZE );
cvShowImage(“ROI”,test);
//设置一下感兴趣通道,并且显示出来coi
cvResetImageROI(test);
cvSetImageCOI(test,0);
cvNamedWindow(“COI”,CV_WINDOW_AUTOSIZE );
cvGetImageCOI(test);
cvShowImage(“COI”,test);

Leave a Reply