opencv两张规格一样的图片拼接(纵向和横向)

#include <iostream>  
#include <core/core.hpp>  
#include <opencv2/imgproc/imgproc.hpp>  
#include <opencv2/highgui/highgui.hpp>  
using namespace std;
using namespace cv;
int main()
{
	Mat combine, combine1, combine2;
	Mat a = imread("0.png");
	Mat b = imread("3.png");
	hconcat(a, b, combine); //横向拼接
	//vconcat(a, b, combine); //纵向拼接
	namedWindow("Combine", CV_WINDOW_AUTOSIZE);
	imshow("Combine", combine);
	waitKey(0);
	//cout<<"Combine=:"<<combine<<endl;  
	system("pause");
	return 0;
}

原始图片:

运行效果:

一键三连呀!
原文地址:https://www.cnblogs.com/jee-cai/p/14095314.html