Adjust Brightness of Image part

2 views (last 30 days)
I am new to Matlab and to Image Processing as well, I know we can change image brightness by following formula if my image is `I`
newImg=imadjust(I, [low_in high_in], [low_out,high_out]);
it adjust all pixel's value of image but how can I do it on some part of image, like I detected face in the image now I want change its brightness how can I do it using `imadjust`.
I have detected area in a binary mask.

Accepted Answer

Image Analyst
Image Analyst on 20 Jan 2013
Just do it on the whole image. Then use your binary mask to assign only those pixels in your new image that are in the mask, to your original image in the same pixel locations:
% Replace original pixels with adjusted pixels, but only under the mask.
I(binaryMask) = newImg(binaryMask);

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!