【发布时间】:2020-11-29 16:50:09
【问题描述】:
我正在处理需要将 RYB 配色方案转换为 RGB 的项目,但我们使用来自 Sony IMX600y / IMX650 传感器的原始图像,具有 Quad RYYB 模式,其中黑色电平为 240,白色电平为 2^12-1 .
我已经阅读并实现了这个算法 Paint Inspired Color Mixing and Compositing for Visualization 和 On the Transfer of Painting Style to Photographic Images through Attention to Colour Contrast,但不知道如何将其应用于拜耳图像。
如果我使用bilinear demosaicing algorithm(来自 colour_demosaicing 库)然后使用我在上面页面中的转换算法实现(或给出相同结果的js implementation)
import numpy as np
from colour_demosaicing import demosaicing_CFA_Bayer_bilinear
def ryb2rgb(ryb):
...
raw = np.fromfile('img.raw', dtype=np.int16).reshape(5472, 7296)
ryb = np.clip(demosaicing_CFA_Bayer_bilinear((raw-240)/(2**12-1-240), 'RGGB'), 0, 1)
rgb = ryb2rgb(ryb)
然后我得到:
我的错误在哪里?
感谢任何帮助。
非常感谢您的宝贵时间。
【问题讨论】:
标签: math image-processing colors