#include<opencv2\opencv.hpp>
#include<iostream>
#include<math.h>
using namespace cv;
int main()
{
Mat dst;
Mat src1 = imread("C:/Users/asus/Desktop/tupian/3.jpg");
Mat src2 = imread("C:/Users/asus/Desktop/tupian/4.jpg");
if (!src1.data)
{
printf("could not load image...\n");
return -1;
}
if (!src2.data)
{
printf("could not load image...\n");
return -1;
}
double alpha = 0.5;
if (src1.rows==src2.rows&&src1.cols==src2.cols&&src1.type()==src2.type())
{
addWeighted(src1, alpha, src2, (1.0 - alpha), 0.0, dst);
//add(src1, src2, dst, Mat());
//multiply(src1, src2, dst, 1.0);
imshow("1", src1);
imshow("2", src2);
imshow("3", dst);
}
else
{
printf("could not blend images");
return -1;
}
waitKey(0);
return 0;
}