#include <cv.h>
#include <highgui.h>
using namespace std;
int main(void){
IplImage* image = cvLoadImage("d:\\2.jpg");
IplImage* src = cvCreateImage(cvGetSize(image), IPL_DEPTH_8U, 3);
cvZero(src);
cvNamedWindow("Test", CV_WINDOW_AUTOSIZE);
cvShowImage("Test", src);
int min = (src->width / 2) > (src->height / 2) ? (src->height / 2) : (src->width / 2);
cvCircle(src, cvPoint(min, min), min, cvScalar(255, 255, 255), CV_FILLED, 8, 0);
cvAnd(image, src, src);
cvShowImage("Test", src);
cvShowImage("Test1", image);
cvWaitKey(0);
cvSetIdentity(src);
cvOr(image, src, src);
cvShowImage("Test", src);
cvWaitKey(0);
return 0;
}
OpenCV学习笔记_cvCircle, cvAnd, cvOr, cvSetIdentity使用
最新推荐文章于 2022-04-30 18:35:26 发布