include <opencv2/opencv.hpp>
using namespace cv;
using namespace std;
int main(){
//定义矩阵内存块;
Mat pic, logo_src, logo,pic_roi;
//读入两张图片,底板背景和水印logo_src;
pic = imread("/Users/leung/Desktop/left.jpg");
logo_src = imread("/Users/leung/Desktop/right.jpg");
//对logo_src修改大小;
resize(logo_src, logo, Size(logo_src.cols/2,logo_src.rows/2));
//在原图选择logo的x位置,注意roi一定要和logo大小一致
//roi(起始x,起始y,width,height);左上角坐标(x,y)
Rect roi(50,50,logo.cols,logo.rows);
pic_roi = pic(roi);
//将logo和pic_roi按一定比例融合叠加,
addWeighted(logo, 0.7, pic_roi, 0.8, 0, pic_roi);
imshow("pic_withmix", pic);
waitKey();
return 0;
}