OPENCV GAMMA校正EXR
如何伽玛校正一个32位.exr文件以看起来像该问题图像中所需的结果?基本上从衬里转换为SRGB? 我从将EXR转换为JPEG使用ImageIO和Python
我不太了解这些值(65535),然后更改它们将导致怪异的输出图像。
import os
os.environ['OPENCV_IO_ENABLE_OPENEXR']='True'
import numpy as np
import cv2
im=cv2.imread("D:\CG_CONTENT\HDRIS\HDRI_BROWSER\Concrete_Office_Outside_sm.exr",-1)
im=im*65535
im[im>65535]=65535
im=np.uint16(im)
cv2.imwrite("D:\CG_CONTENT\HDRIS\HDRI_BROWSER\Concrete_Office_Outside_sm_test8.png",im)
How can I gamma correct a 32bit .exr file to look like the desired result in the image of this question? Basically converting from liner to sRGB somehow?
I got this code(and modified it a bit) from convert EXR to JPEG using ImageIO and Python
I don't quite understand those values (65535), and changing them will result in weird output images.
import os
os.environ['OPENCV_IO_ENABLE_OPENEXR']='True'
import numpy as np
import cv2
im=cv2.imread("D:\CG_CONTENT\HDRIS\HDRI_BROWSER\Concrete_Office_Outside_sm.exr",-1)
im=im*65535
im[im>65535]=65535
im=np.uint16(im)
cv2.imwrite("D:\CG_CONTENT\HDRIS\HDRI_BROWSER\Concrete_Office_Outside_sm_test8.png",im)
On the left of this image I have the output from the code, but I need something like the image on the right.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,为了将线性图像正确转换为SRGB,我必须使用传输函数,对于SRGB,可以使用γ简化。
这是我最终使用的东西,并且效果很好。
So in order to properly converted a linear image to sRGB I had to use a transfer function, which for sRGB, can be simplified with gamma.
Here's what I ended up using, and worked very well.