简体   繁体   English

如何通过 opencv c++ 中的黑白蒙版范围更改图像亮度

[英]How to change Image brightness by range of black and white mask in opencv c++

I have two images:我有两张图片:

Mat originalImage = imread(addr, IMREAD_UNCHANGED);
Mat maskImage = imread(addr, 0);

Originl Image原始图像
Mask Image蒙版图像

maskImage is a grayscale image and size of both images are same. maskImage 是灰度图像,两个图像的大小相同。
My question is how can I change brightness in my image by the mask that I have in opencv c++?我的问题是如何通过 opencv c++ 中的蒙版更改图像的亮度? We have a range between 0 than 255 and 0 it means don't change brightness and 255 is maximum brightness.我们的范围在 0 到 255 和 0 之间,这意味着不改变亮度,255 是最大亮度。
Thank you.谢谢你。

take a look at How to change brightness of an image the code written in python but you can use the c++ API看看如何更改图像的亮度python 中编写的代码,但您可以使用 c++ API

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM