1、#include“stdio.h“#include“cv.h“#include“highgui.h“/垂直镜像void main(int argc,char *argv)int i,j,u,v,m,n;int height,width,step,step1;uchar *data;uchar *data1;IplImage *Img;IplImage *dst;Img = cvLoadImage(“123.jpg“,0);width = Img-width;height = Img-height;data = (uchar*)Img-imageData;step = Img-widthStep
2、;dst = cvCreateImage(cvGetSize(Img),IPL_DEPTH_8U,1);data1 = (uchar*)dst-imageData;step1 = dst-widthStep;cvZero(dst);cvNamedWindow(“win1“,1);cvShowImage(“win1“,Img);for(i=height/2;iheight;i+)for(j=0;jwidth;j+)u=2*i-height;v=j;data1i*step1+j = datau*step+v;for(m=0;mheight/2;m+)for(n=0;nwidth;n+)i =height-m;j=n;data1m*step1+n=data1i*step1+j;cvNamedWindow(“win2“,1);cvShowImage(“win2“,dst);cvWaitKey();cvReleaseImage(