百度360必应搜狗淘宝本站头条
当前位置:网站首页 > 技术分类 > 正文

ISO 22028-4:2023勘误(gb14684勘误)

ztj100 2024-11-10 13:14 17 浏览 0 评论

因为备课的需要,今天看了一下ISO 22028-4:2023标准《 ISO 22028-4:2023 Photography and graphic technology ——Extended colour encodings for digital image storage, manipulation and interchange ——Part 4: European Colour Initiative RGB colour image encoding [eciRGB (2008)]》

一不小心发现了一个小错误:

在4.4.5.3.2中,由XYZ向XYZa转换时,用的公式是:

在计算Ya时,最后加的是Xk,应该加Yk才对。这个公式是4.4.5.2公式的逆向公式,改一下就对了。

另外,在计算XYZ向RGB转换时,用到了下面的公式:

公式下面还有一句话:

R, G, B tristimulus values with all component values within the range [0, 1] shall be within the colour gamut ofthe eciRGB(2008)colour image encoding.

要求R、G、B的值要在[0, 1]之间,但是在计算时,有可能大于1,在标准中没有说明如何处理。处理的办法之一就是,借鉴sRGB的转换方法,大于1的值改为1,但是这样,就不能保证XYZ和eciRGB(2008)转换的可逆性了。


附上相互转换的Python程序,3.0

Bash

def XYZ_to_eciRGB2008(XYZ):
    XYZw=[96.4296,100, 82.5105 ]    # 白点的XYZ值, 
    XYZk=[0.3013,0.3125, 0.2578 ]    # 黑点的XYZ值, 

    ### 对测量得到XYZ(即色度学中的XYZ)进行归一化
    X = (XYZ[0] - XYZk[0]) * XYZw[0] / (XYZw[0] - XYZk[0]) / XYZw[1]
    Y = (XYZ[1] - XYZk[1])  / (XYZw[1] - XYZk[1])
    Z = (XYZ[2] - XYZk[2]) * XYZw[2] / (XYZw[2] - XYZk[2]) / XYZw[1]
    XYZ =np.asarray([X, Y, Z])
    #print("XYZ=",XYZ)
    ##3 XYZ到RGB的转换矩阵
    M=[[1.782760,-0.496985,-0.269010 ],
       [-0.959362,1.947800, -0.027581],
       [0.085932,-0.174467,1.322830]]

    M = np.asarray(M)
    RGB = np.dot(M,np.transpose(XYZ))
    ### 把线性的RGB 转换到 eciRGB2008 空间的RGB'
    RGBp=[0,0,0]    # 浮点数
    for i in range(3):
        if RGB[i] >= 0.008856:
            RGBp[i] =1.16*(RGB[i]**(1.0/3))-0.16
        else:
            RGBp[i] = 9.066 * RGB[i]

        if RGBp[i]>1:   # 这个计算出来的RGB'有可能大于1,因此超过1 压缩为1
            RGBp[i]=1

    #print("RGBp=", RGBp)
    ### 把浮点数的RGBp转换为8位的无符号数
    RGBp  =np.multiply(RGBp,255)
    RGBp8 = np.uint8(RGBp )

    return RGBp8


Bash

def eciRGB2008_to_XYZ(RGB):
    RGBp8 =RGB
    ### 转换到0-1之间
    RGBp = np.divide(RGBp8, 255)
    #print("RGBp=", RGBp)

    ### 把RGB‘转换到RGB
    RGB =[0,0,0]    #这里的RGB和输入参数的RGB意义不一样,这里是转换的中间量
    for i in range(3):
        if RGBp[i] < 0.08:
            RGB[i] = 0.1107*RGBp[i]
        else:
            RGB[i] = (0.8621*RGBp[i]+0.1379 )**3

    ### 转换到XYZ
    M=[[ 0.65020476 , 0.17807719,  0.1359382 ], [ 0.32024938,  0.60206979 , 0.07767889], [-0.00000034 , 0.06783848 , 0.7573694 ]]
    #M = np.asarray(M)
    XYZ = np.dot(M,np.transpose(RGB))
    #print("XYZ=", XYZ)
    XYZw = [96.4296, 100, 82.5105]  # 白点的XYZ值, 
    XYZk = [0.3013, 0.3125, 0.2578]  # 黑点的XYZ值 
    X = XYZ[0] * (XYZw[0] - XYZk[0]) * XYZw[1] / XYZw[0] + XYZk[0]
    Y = XYZ[1] * (XYZw[1] - XYZk[1]) + XYZk[1]
    Z = XYZ[2] * (XYZw[2] - XYZk[2]) * XYZw[1] / XYZw[2] + XYZk[2]
    return   np.round([X,Y,Z],3)

相关推荐

10条军规:电商API从数据泄露到高可用的全链路防护

电商API接口避坑指南:数据安全、版本兼容与成本控制的10个教训在电商行业数字化转型中,API接口已成为连接平台、商家、用户与第三方服务的核心枢纽。然而,从数据泄露到版本冲突,从成本超支到系统崩溃,A...

Python 文件处理在实际项目中的困难与应对策略

在Python项目开发,文件处理是一项基础且关键的任务。然而,在实际项目中,Python文件处理往往会面临各种各样的困难和挑战,从文件格式兼容性、编码问题,到性能瓶颈、并发访问冲突等。本文将深入...

The Future of Manufacturing with Custom CNC Parts

ThefutureofmanufacturingisincreasinglybeingshapedbytheintegrationofcustomCNC(ComputerNumericalContro...

Innovative Solutions in Custom CNC Machining

Inrecentyears,thelandscapeofcustomCNCmachininghasevolvedrapidly,drivenbyincreasingdemandsforprecisio...

C#.NET serilog 详解(c# repository)

简介Serilog是...

Custom CNC Machining for Small Batch Production

Inmodernmanufacturing,producingsmallbatchesofcustomizedpartshasbecomeanincreasinglycommondemandacros...

Custom CNC Machining for Customized Solutions

Thedemandforcustomizedsolutionsinmanufacturinghasgrownsignificantly,drivenbydiverseindustryneedsandt...

Revolutionizing Manufacturing with Custom CNC Parts

Understandinghowmanufacturingisevolving,especiallythroughtheuseofcustomCNCparts,canseemcomplex.Thisa...

Breaking Boundaries with Custom CNC Parts

BreakingboundarieswithcustomCNCpartsinvolvesexploringhowadvancedmanufacturingtechniquesaretransformi...

Custom CNC Parts for Aerospace Industry

Intherealmofaerospacemanufacturing,precisionandreliabilityareparamount.Thecomponentsthatmakeupaircra...

Cnc machining for custom parts and components

UnderstandingCNCmachiningforcustompartsandcomponentsinvolvesexploringitsprocesses,advantages,andcomm...

洞察宇宙(十八):深入理解C语言内存管理

分享乐趣,传播快乐,增长见识,留下美好。亲爱的您,这里是LearingYard学苑!今天小编为大家带来“深入理解C语言内存管理”...

The Art of Crafting Custom CNC Parts

UnderstandingtheprocessofcreatingcustomCNCpartscanoftenbeconfusingforbeginnersandevensomeexperienced...

Tailored Custom CNC Solutions for Automotive

Intheautomotiveindustry,precisionandefficiencyarecrucialforproducinghigh-qualityvehiclecomponents.Ta...

关于WEB服务器(.NET)一些经验累积(一)

以前做过技术支持,把一些遇到的问题累积保存起来,现在发出了。1.问题:未能加载文件或程序集“System.EnterpriseServices.Wrapper.dll”或它的某一个依赖项。拒绝访问。解...

取消回复欢迎 发表评论: