核心函数:cvConvertImage
程序:
代码:
#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; }
cvConvertImage 彩色灰度转换 垂直旋转图像,布布扣,bubuko.com
时间: 2024-10-10 20:52:52