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

조회 수: 53 (최근 30일)
gbos
gbos 2020년 1월 9일
댓글: DGM 2022년 3월 22일
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
gbos 2020년 1월 15일
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.

추가 답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 1월 9일
편집: KALYAN ACHARJYA 2020년 1월 9일
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.
  댓글 수: 8
gbos
gbos 2020년 1월 9일
편집: gbos 2020년 1월 9일
No I mean stops of exposure, so 1 stop = 1 EV = double the light. Here the description of what is a stop
DGM
DGM 2022년 3월 22일
I would assume that a multiplicative correction would make sense.
As far as I know, the common method of using adjustment layers in Photoshop with the "Exposure" adjustment is just a simple three-term calculation - an "exposure" term, an "offset" term, and a "gamma term.
inpict = imread('peppers.png');
k = 1.1; % scaling factor (null is 1)
os = 0.1; % output offset (null is 0)
g = 1; % gamma (null is 1)
outpict = os + (im2double(inpict)*k).^g;
imshow(outpict)
Of course, there are more complicated ways of doing it with masking, etc. I don't use Photoshop, so I'm in no position to experimentally verify that this is the exact math. It makes sense though.
Legacy GIMP (pre-2.9) doesn't have anything that claims to be "exposure" adjustment (at least not the base tools). There is a basic brightness & contrast adjustment tool, a levels adjustment tool, and a curves adjustment tool. I explain how the GIMP brightness/contrast tool works here:
The levels and curves tools are just simple multipoint intensity interpolation. Think of the "levels" method as a simplified three-point case of "curves". The same can be done with interp1().
Consider also imadjust() and its 5-term calculation. I just look at these various methods as different ways to define a curve that maps the input values to the output values. Sometimes it's more convenient to think about the process in terms of the locations of the endpoints of a line (as in imadjust()). Sometimes it's more convenient to think about it in terms of slope (as in the PS "exposure" term).

댓글을 달려면 로그인하십시오.

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by