获取浮点型像素颜色值(HDR)
在Python中是否可以读取图像并获取0-1(或浮点数中的0-255)之间的每个像素颜色(12位深度)值,而不需要转换为0-255 - > 0-1 范围。 这样我就不会损失精度并获得 HDR 格式的准确颜色。
看起来 cv2 和 PIL 仅读取整数值的像素。
这是 Paul Rohde 的一个很好的仓库,我想在图像示例中使用:https://github.com/codelogic/wide-gamut-tests
Is it possible in Python to read an image and get each pixels color (12 bits depth) value between 0-1 (or 0-255 in float) without doing the conversion to 0-255 -> 0-1 range.
This way I won't get precision loss and get the exact color in HDR format.
It look like cv2 and PIL read pixels only in integer value.
Here is a good repo of Paul Rohde that I would like to use in example for image : https://github.com/codelogic/wide-gamut-tests
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
更新的答案
您可以打开一个正确的 HDR 文件,如下所示,以获得完整的 float32 缩放:
原始答案
我仍然不明白你的问题。您共享的图像是每个样本 8 位,或 RGB888。它既不是 12 位也不是 HDR。
你可以用
exiftool
看到,从底部开始6行:如果你用OpenCV加载图像,你可以看到你说看不到的文本:
Updated Answer
You can open a proper HDR file like this to get it in full float32 scaling:
Original Answer
I still don't understand your question. The image you have shared is 8-bits per sample, or RGB888. It is neither 12-bit nor HDR.
You can see that with
exiftool
, 6 lines from the bottom:If you load the image with OpenCV, you can see the text that you say you cannot see: