基于场景亮度/暗度或“自动级别”的自适应曝光(增益)的方法
我有几个曝光和伽玛函数,但我还没有想出一个有效的公式来根据亮度调整曝光。我想做的就是只照亮较暗的区域。
我已经通过低通(阈值)实现了这一点,但这不是最好的方法。我真的很想让曝光控制根据亮度来增加曝光,这样较暗的区域获得最多的增益,而较亮的区域获得最少的增益。这可能类似于 Photoshop 和其他图像处理应用程序中的“自动级别”。
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 like "auto-levels" in Photoshop and other image processing applications.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须使用分段函数来完成此操作,其中复合映射是连续的、单调的并且最好是可微的。实现此目的的一个好方法是在控制点之间使用样条插值。
线性恒等映射具有控制点 (0,0)、(1,1)。在线性之间和之下引入控制点,例如 (0.5, 0.4),其作用类似于降低伽玛值。使用多个中间控制点可以非常精确地控制映射,但对于简单的曝光控制,最好将原始值线性化(典型图像的预应用伽玛约为 2.4,尽管像 sRGB 这样的色彩空间使事情变得有点复杂),然后调整偏移和增益,可能通过在基于样条的映射中设置第一个和最后一个控制点来调整。然后使用中间控制点或应用伽玛。
自动化该过程有点棘手,但一个好的方法是确定直方图,然后使用偏移和平均宽度参数执行高斯分布的最小二乘拟合。这些参数的倒数给出了要执行的调整。典型图片的直方图看起来一点也不像高斯分布,但假设大部分图像内容位于中值中是有意义的。
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.