how to bright a picture gradually
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have pictures that because of the shooting angle and the way they were lit came out lighter on one side and slightly darker gradually as you get closer to the other side of the picture.
Is there any way to make a function which will detect the brighten side of the image and clarify based on that side the whole image gradually? So that the brightness level will be more or less the same in all areas of the image?
0 Kommentare
Antworten (2)
KALYAN ACHARJYA
am 29 Nov. 2020
Bearbeitet: KALYAN ACHARJYA
am 29 Nov. 2020
Suggestion: Please see the Gamma Scaling or Power low trasnformation, you can adjust the values of Gamma or Constant as per desired results.
More Detail: Deigital Image Processing Book (Gonzalez) Chapter Name: Image Enhancement. There you may see the figure with mutiple plots.
0 Kommentare
Image Analyst
am 29 Nov. 2020
Yes, you need to do background correction to compensate for any brightess change due to
- non-uniform illumination
- lens shading
- optical vignetting
The best way is to just take a "blank shot" - an image of a uniform gray or white sheet. Then smooth the image with conv2() to get rid of noise and normalize that image by dividing by the max value. Then divide your actual image by that to correct for the background "shading". Something like (untested):
kernel = ones(9); % box filter to blur. Use bigger number for more smoothing.
kernel = kernel / sum(kernel(:)); % Normalize so as to not change the mean gray level.
backgroundImage = imfilter(backgroundImagem kernel); % Smooth
backgroundImage = double(backgroundImage) / max(backgroundImage(:)); % Normalize
backgroundCorrectedImage = double(originalImage) ./ backgroundImage; % Correct
Cast back to uint8 if you need to.
0 Kommentare
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!