#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2\opencv.hpp>
using namespace cv;
using namespace std;int main()
{//1.加载两幅图片Mat src = imread("风景.jpg");Mat logo = imread("企鹅.png");//2.设置感兴趣ROI区域Mat ROI = src(Rect(src.rows/2,200, logo.cols, logo.rows));//3.加载掩模,必须是灰度图Mat mask = imread("企鹅.png", 0);//4.使用掩膜图片覆盖到ROI区域logo.copyTo(ROI, mask);namedWindow("ROI感兴趣叠加");imshow("ROI感兴趣叠加", src);waitKey(0);return 0;
}