开发者

method for adaptive exposure (gain) based on scene brightness /darkness, or "auto levels"

I have a couple of exposure and gamma functions, but I've not come up with an efficient formula to adjust the exposure based on brightness. What I'd like to do is brighten just the darker regions.

I've implemented this via a low-pass (threshold), but that's not the best way. I'd really like to have the exposure controls ramp the exposure up based on the brightness, so darker regions get the most gain and brighter regions the least. This could be开发者_StackOverflow社区 like "auto-levels" in Photoshop and other image processing applications.


You'll have to do this by using piecewise functions, where the compostite mapping is continous, monotonous and preferrably differentiable. A good way to implement this is using spline interpolation between control points.

A linear identity mapping has control points (0,0), (1,1). Introducing a control point inbetween and below the linear, like (0.5, 0.4) acts like reducing the gamma value. Using multiple intermediate control points the mapping can be controled very precisely, though for a simple exposure control it's probably best to linearize the original values (typical images have a pre applied gamma of about 2.4, though colour spaces like sRGB complicate things a bit), then adjust offset and gain, possibly by setting first and last control point in a spline based mapping. Then use a intermediate control point or apply gamma.

Automating the process is a bit tricky, but a good method is to determine the histogram, then perform a least square fit of a Gaussian distribution with offset and mean width parameters. The inverse of these parameters give the adjustment to perform. A typical picture's histogram in no way looks like a Gaussian, but it makes sense to assume that most of the image content is in the median values.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜