标签:
#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));
logo.copyTo(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;
}
#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;
}
动动手指,20元人民币立即到手
标签:
原文地址:http://www.cnblogs.com/donaldlee2008/p/5381804.html