alphablending - Emgu CV 中的 Alpha 混合

标签 alphablending emgucv computer-vision

嗨,我正在学习 Emgu CV。我想执行 alpha 混合(addWeighted)。我有以下代码

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

如何 alpha 混合这两个图像? (Bgr 和格雷)

最佳答案

尝试将灰度图像转换回彩色,然后将它们混合。

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);

关于alphablending - Emgu CV 中的 Alpha 混合,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14089609/

相关文章:

javascript - HTML5 Canvas ,如何通过点击图像的不同区域来打开不同的超链接?

c# - 将EMGUCV VectorOfKeyPoint保存到XML并再次加载

python - 图像的梯度方向不一致(X vs Y)

python - numpy 与 python : convert 3d array to 2d

image-processing - 需要一些帮助来理解公式

math - 如何通过指定alpha混合量来计算RGB颜色?

wpf - 在WPF像素着色器效果中处理Alpha channel

C# New bitmap() - 内存不足

c# - 与 Alpha 的混合模式

c++ - 有人有优化的函数来通过 alpha 预乘位图吗?