[转]OpenCV两张图片的合并

时间:2020-12-20 23:44:41

 
#include <opencv2/highgui/highgui.hpp>#include <opencv2/core/core.hpp> int main(){cv::Mat image = cv::imread("E:/Image/Fruits.jpg");cv::Mat logo = cv::imread("E:/logo.png");cv::Mat imageROI;imageROI = image(cv::Rect(10,10,logo.cols,logo.rows));cv::addWeighted(imageROI, 1.0, logo, 0.3, 0, imageROI);cv::namedWindow("result");cv::imshow("result",image);cv::waitKey();return 0;} #include <opencv2/highgui/highgui.hpp>#include <opencv2/core/core.hpp> int main(){cv::Mat image = cv::imread("E:/Image/Fruits.jpg");cv::Mat logo = cv::imread("E:/logo.png");cv::Mat mask = cv::imread("E:/logo.png",0);cv::Mat imageROI;imageROI = image(cv::Rect(10,10,logo.cols,logo.rows));logo.copyTo(imageROI,mask);cv::namedWindow("result");cv::imshow("result",image);cv::waitKey();return 0;}1  opencv 将两张图片显示到一幅图片中    ****  http://blog.csdn.net/CSDNMicrosoftCSDN/article/details/50207101?locationNum=3&fps=12  OpenCV两张图片的合并   http://blog.csdn.net/zhonghuan1992/article/details/38456767