标签:concat combine linear 自带 resize class res jpg lin
Opencv有自带函数:
cv::vconcat(a, b, combine);
自己无聊造一个轮子:
Mat a = imread("**********.jpg"); Mat b = imread("**********.jpg"); resize(b, b, a.size(), 0, 0, INTER_LINEAR); Mat combine; std::vector<uchar> vecImage(0); uchar *src = a.data; uchar *dest = b.data; std::vector<uchar> vecsrc(src, src + a.channels()*a.cols*a.rows); std::vector<uchar> vecdest(dest, dest +b.channels()*b.cols*b.rows); vecImage.insert(vecImage.end(), vecsrc.begin(), vecsrc.end()); vecImage.insert(vecImage.end(), vecdest.begin(), vecdest.end()); cv::Mat mat = cv::Mat(vecImage);//将vector变成单列的mat combine = mat.reshape(a.channels(), a.rows+b.rows).clone();//
标签:concat combine linear 自带 resize class res jpg lin
原文地址:https://www.cnblogs.com/almn/p/13359015.html