Alpha Blending in Emgu CV

Hi, I am studying the resume of Emgu. I would like to execute an alpha mix (addWeighted). I have the following codes

Image<Bgr, Byte> image = new Image<Bgr, Byte>(filename); Image<Gray, Byte> grayImage = image.Convert<Gray, Byte>(); Image<Bgr, Byte> blendImage; 

How alpha mix these two images? (Bgr and Gray)

+4
source share
1 answer

Try converting the grayscale image to color, and then mix them.

 Image<Bgr, Byte> grayBGRImage = grayImage.Convert<Bgr, Byte>(); double alpha = 0.5; // Or however you would like to blend them double beta = 1 - alpha; double gamma = 0; Image<Bgr, Byte> blendImage = image.AddWeighted(grayBGRImage, alpha, beta, gamma); 
0
source

All Articles