使用Python OpenCV将SDR图像转换为HDR?
我希望与OpenCV一起在Python中进行以下操作,以提高图像的亮度。目的是将SDR照片变成HDR图像(增加动态范围)。
import cv2
img = cv2.imread("image.png")
hsv_img = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
h, s, v = cv2.split(hsv_img)
v = v**3 # any function applied to v
new_hsv = cv2.merge((h, s, v))
然后,我们得到一个更明亮的图像。
问题在于,v
仅允许在0-255范围内采用值,而255对于HDR映像不够明亮。
我如何将亮度增加到255以上,任何将图像保存为HDR图像文件(以任何合适的格式)?
I wish to do the following in python with openCV to increase the brightness of an image. The aim is to turn an SDR photo into an HDR image (to increase the dynamic range).
import cv2
img = cv2.imread("image.png")
hsv_img = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
h, s, v = cv2.split(hsv_img)
v = v**3 # any function applied to v
new_hsv = cv2.merge((h, s, v))
We then get a brighter image.
The problem is that, v
is only allowed to take values in the range 0-255, and 255 is not bright enough for an HDR image.
How can I increase the brightness beyond 255, any save the image as an hdr image file (in any suitable format)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论