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

16 ビュー (過去 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 件のコメント
DGM
DGM 2022 年 3 月 22 日
Regarding the case where it's desired to do this on gamma-corrected RGB instead, see this comment:

サインインしてコメントする。

その他の回答 (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