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

22 次查看(过去 30 天)
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 个评论
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).

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Get Started with Image Processing Toolbox 的更多信息

产品


版本

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by