void cvSetImageROI(IplImage* image, CvRect rect) 这个函数仅支持IplImage类,不能使用Mat。 Mat img=imread("D:\\1.bmp",1);