基本信息
源码名称:CIE2000色差公式
源码大小:1.36KB
文件格式:.py
开发语言:Python
更新时间:2021-03-24
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元×
微信扫码支付:2 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
def Loss_CIE20002(Lab1,Lab2): L1_,a1_,b1_=Lab1 L2_,a2_,b2_=Lab2 C1_,C2_=sqrt(a1_*a1_ b1_*b1_),sqrt(a2_*a2_ b2_*b2_) Cmean_=(C1_ C2_)/2 # Step 1: calculate L,a,b,C,h G=0.5*(1-sqrt(pow(Cmean_,7)/(pow(Cmean_,7) pow(25,7)))) L1,L2,b1,b2=L1_,L2_,b1_,b2_ a1,a2=(1 G)*a1_,(1 G)*a2_ C1,C2=sqrt(a1*a1 b1*b1),sqrt(a2*a2 b2*b2) h1,h2=atan2(b1,a1),atan2(b2,a2) # h1,h2=asin(b1/a1),asin(b2/a2) # Step 2: calculate delta L,C,H Lsub,Lmean=L2-L1,(L1 L2)/2 Csub,Cmean=C2-C1,(C1 C2)/2 if abs(h1-h2)<=180: hSub=h2-h1 elif h2<=h1: hSub=h2-h1 360 else: hSub=h2-h1-360 #draw to illustrate HSub=2*sqrt(C1*C2)*sin(hSub/2) if abs(h1-h2)>180: HMean=(h1 h2 360)/2 else: HMean=(h1 h2)/2 #try # Step 3: calculate SL,SC,SH,T T=1-0.17*cos(HMean-30) 0.24*cos(2*HMean) 0.32*cos(3*HMean 6)-0.2*cos(4*HMean-63) SL=1 0.015*pow(Lmean-50,2)/sqrt(20 pow(Lmean-50,2)) SC=1 0.045*Cmean SH=1 0.015*Cmean*T Rc=2*sqrt(pow(Cmean,7)/(pow(Cmean,7) pow(25,7))) dTheta=30*exp(-pow((HMean-275)/25,2)) RT=-2*sin(2*dTheta)*Rc result=sqrt(pow(Lsub/SL,2) pow(Csub/SC,2) pow(HSub/SH,2) RT*Csub/SC*HSub/SH) return result