SaintStefan
6/10/2019 - 2:02 AM

在图片上点击后显示点和坐标

#include<opencv2/opencv.hpp>

using namespace cv;

int main() {

	Mat srcImage = imread("Lenna.jpg");
	Mat logo = imread("dota_logo.jpg");

	Mat imageROI;

	imageROI = srcImage(Rect(0, 100, logo.cols, logo.rows));
	//imageROI = srcImage(Range(0, 0 + logo.cols), Range(100, 00 + logo.rows));

	//imageROI = srcImage(Rect(0, 200, logo.cols, logo.rows));
	//imageROI = srcImage(Range(0, 0 + logo,cols), Range(200, 200 + logo.rows));

	Mat mask = imread("dota_logo.jpg", 0);

	logo.copyTo(imageROI, mask);

	namedWindow("Lenna+Dota");
	imshow("Lenna+Dota", srcImage);

	waitKey(0);

	return 0;
}