【文件属性】:
文件名称:图像的载入和输出.cpp
文件大小:621B
文件格式:CPP
更新时间:2022-10-12 11:16:27
opencv
图像的载入、显示和输出
#include
#include
using namespace cv;
int main()
{
Mat girl = imread("1.jpg");
namedWindow("动漫窗口");
imshow("动漫窗口",girl);
Mat image = imread("dota.jpg",199);
Mat logo = imread("dota_logo.jpg");
namedWindow("原画图");
imshow("原画图", image);
namedWindow("logo图");
imshow("logo图", logo);
Mat imageROT;
imageROT = image(Rect(800,350,logo.cols,logo.rows));
addWeighted(imageROT,0.5,logo,0.3,0.,imageROT);
namedWindow("原画图+logo图");
imshow("原画图+logo图",image);
imwrite("由imwrite生成的图片.jpg",image);
waitKey(0);
}