1 #include "stdafx.h" 2 #include <iostream> 3 #include <opencv.hpp> 4 5 using namespace cv; 6 7 int _tmain(int argc, _TCHAR* argv[]) 8 { 9 Mat srcImage = imread("./1.bmp"); 10 Mat roiImage; 11 Rect rect(100,100,100,100); 12 srcImage(rect).copyTo(roiImage); 13 imshow("roi",roiImage); 14 waitKey(0); 15 return 0; 16 }