OpenCV学习笔记_cvCircle, cvAnd, cvOr, cvSetIdentity使用

#include 
#include 

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学习)