图片的变换

#include"highgui.h"
#include"cv.h"
int main(int argc, char*argv[])
{
	IplImage *img = cvLoadImage("d:\\3.jpg");
	cvNamedWindow("window");
	cvShowImage("window", img);

	IplImage *t = cvCreateImage(cvGetSize(img), IPL_DEPTH_8U, 3);
	cvConvertImage(img, t, CV_CVTIMG_SWAP_RB);//红蓝交错,另有	CV_CVTIMG_FLIP 是上下翻转
	cvNamedWindow("win2");
	cvShowImage("win2",t);

	cvWaitKey(0);
	cvReleaseImage(&img);
	cvDestroyWindow("window");
	cvReleaseImage(&t);
	cvDestroyWindow("win2");
	return 0;
}

你可能感兴趣的:(图片的变换)