how to bright a picture gradually

1 visualizzazione (ultimi 30 giorni)
Arbel Cohen
Arbel Cohen il 29 Nov 2020
Risposto: Image Analyst il 29 Nov 2020
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?

Risposte (2)

KALYAN ACHARJYA
KALYAN ACHARJYA il 29 Nov 2020
Modificato: KALYAN ACHARJYA il 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.

Image Analyst
Image Analyst il 29 Nov 2020
Yes, you need to do background correction to compensate for any brightess change due to
  1. non-uniform illumination
  2. lens shading
  3. 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.

Community Treasure Hunt

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

Start Hunting!

Translated by