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

原始圖片:

運行效果:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM