我采用的是OPENCV的库
#include <iostream> #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> using namespace std; using namespace cv;
Mat img;
Mat out;
img = imread("D:\\Picture1.jpg");
out = img(Range(0,100),Range(50,200));
imwrite("D:\\Picture2.jpg", out);
结果为原图的0-99行,50-199列