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;
}

原始图片:

运行效果:

posted @ 2020-10-29 16:44  jee-cai  阅读(869)  评论(0编辑  收藏  举报