1. Mat -->IplImage
Mat mat_img=imread("samples.bmp");
IplImage* ipl_img;
ipl_img = &IplImage(mat_img);
2. IplImage--->Mat
IplImage* ipl_img = cvLoadImage("samples.bmp");;
Mat mat_img;
mat_img = Mat(ipl_img);//Mat(const IplImage* img, bool copyData=false);
//mat_img = cvarrToMat(ipl_img);//3.x版本