随性笔记
// TestDemo.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <iostream>
#include <opencv.hpp>
using namespace cv;
int _tmain(int argc, _TCHAR* argv[])
{
Mat srcImage = imread("./1.bmp");
Mat roiImage;
Rect rect(100,100,100,100);
srcImage(rect).copyTo(roiImage);
imshow("roi",roiImage);
waitKey(0);
return 0;
}
参考