cvConvertImage 彩色灰度转换 垂直旋转图像

核心函数:cvConvertImage

程序:

wKiom1PsXsjReR21AACwaulGOsg938.jpg

代码:

#include "cv.h"
#include "cxcore.h"
#include "highgui.h"
#include <iostream>
int ConvertImage(int argc,char** argv)
{
IplImage* src=cvLoadImage("e:\\picture\\4.jpg");
IplImage* dst=cvCreateImage(cvGetSize(src),8,1);
cvConvertImage(src,dst,CV_CVTIMG_FLIP); //上下翻转加颜色变换
cvNamedWindow("src");
cvNamedWindow("dst");
cvShowImage("src",src);
cvShowImage("dst",dst);
cvWaitKey(0);
cvDestroyWindow("src");
cvDestroyWindow("dst");
cvReleaseImage(&src);
cvReleaseImage(&dst);
return 0;
}


你可能感兴趣的:(opencv,cvConvertImage,彩色灰度转换)