简体   繁体   中英

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.
My question is how can I change brightness in my image by the mask that I have in opencv c++? We have a range between 0 than 255 and 0 it means don't change brightness and 255 is maximum brightness.
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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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