for my app I need to blend two photos using an alpha mask. How do I finish the code? And how do I acess the photos using opecv? This is the code I have until now:
public int abc()
{
double alpha;
double beta;
double input;
Mat src1;
Mat src2;
Mat dst;
/// We use the alpha provided by the user if it is between 0 and 1
alpha= 0.5;
/// Read image ( same size, same type )
src1 = imread("");
src2 = imread("");
if( !src1.data ) { printf("Error loading src1 \n");return -1; }
if( !src2.data ) { printf("Error loading src2 \n");return -1; }
/// Create Windows
namedWindow("Linear Blend", 1);
beta = ( 1.0 - alpha );
addWeighted( src1, alpha, src2, beta, 0.0, dst);
imshow( "Linear Blend", dst );
waitKey(0);
return 0;
}
i do this in this way:
after you have an image as a mat, do your stuff..