openCV实现将图像切成m*n块,供大家参考,具体内容如下
一、代码部分:
#include "stdafx.h" #include#include #include #include #include #include using namespace std; using namespace cv; //Cut an image into m*n patch void Cut_img(Mat src_img, int m, int n, vector ceil_img) { int t = m * n; int height = src_img.rows; int width = src_img.cols; int ceil_height = height / m; int ceil_width = width / n; Mat roi_img; //String concatenation ostringstream oss; string str, str1, str2; Point p1, p2; for (int i = 0; i


