opencv 抠子图

1
2
3
4
5
6
7
#include <opencv2/opencv.hpp>
 
using namespace cv;
 
Mat imgBig = imread("d:/big.jpg");
Mat imgSmall = imgBig(cv::Rect(x, y, w, h));
imwrite("d:/small.jpg", imgSmall);