1.Mat类
Mat src = imread(“test.jpg”);
Rect rect(0,0,src.cols/2,src.rows/2);
Mat src1( src, rect);
Mat src2=src(rect);
2.IplImage类
IplImage*img=cvLoadImage(readname.c_str());
Rect rect(0,0,img->width/2,img->height/2);
IplROI ROI;
ROI=cvRectToROI(rect,0);
img->roi = &ROI;