# Increase exposure of an image by a certain number of stops (EV)

7 views (last 30 days)
gbos on 9 Jan 2020
Answered: gbos on 15 Jan 2020
Hello,
I need to post-process some images with MatLab and I'd like to be able to increase the exposure of the image. I know I can just add some constant value to the matrix representing the image, but I need to know how many stops I'm increasing this brightness, like in Lightroom or Photoshop. Any help?

gbos on 15 Jan 2020
Well I solved the problem, the answer was pretty straightforward actually: obviosuly if you want to over expose by 1 stop (EV) the amount of light that will be recorded on a picture will be double. So to do this in MatLab you just have to double every pixel value. If the stops are 2, you have to quadruple the values, if it's just half a stop, then you have to multiply by 1.5 (50% more light in). Obviously pixels with a value will keep a value of and they'll be the clipped pixels.
This process doesn't take into account the camera response function but it's ok since the RAW file should have a linear response anyway.

KALYAN ACHARJYA on 9 Jan 2020
Edited: KALYAN ACHARJYA on 9 Jan 2020
Still I feel the question is quite subjective, One way: the issue is how to get the contrast of an image? If done, you may look for imadjust function also with repeated iteration (loop).
Second way: As you mentioned about contrast enhancemnet, I suggest to go for repeated histogram equalization and see the dynamaic ranges. During the loop iterration, when you achieve disired dynamic range (contrast), you may consider a break statement.

gbos on 9 Jan 2020
Yep this is what I've been doing, but I need to do it properly and accurately. So let's say I want to increase the exposure of the image by 2 stops, what constant value should I add to the image?
KALYAN ACHARJYA on 9 Jan 2020
Exposure of the image by 2 stops?
Is this in two iteration?
n=4 % Considering Gray Image, Color deals with individual color planes
for i=1:n
image_A=Image_A+randi(10);
imshow(image_A)
end
gbos on 9 Jan 2020
No I mean stops of exposure, so 1 stop = 1 EV = double the light. Here the description of what is a stop