:2004-09-24;:2004-11-11:863(2002AA411120)*,,(,710072):,RGB,Lab,HLC,,VC++,,:;;;:TP391:A:1001-3695(2005)10-0168-03ResearchandApplicationofColorSimilarityMeasurementWANGKe,LUChang-de,YUEWan-de(SchoolofMechanical&ElectricalEngineering,NorthwesternPolytechnicalUniversity,XianShanxi710072,China)Abstract:Tosolvetheproblemofthematchbetweencustomizedcolorandthecolorinthestandardbase,thecolorsimilaritymeasurementmodelbasedonthreecolorspacesofRGB,Lab,andHLCwasconstructed.Therelationshipofcolorspaceandcolorsimilaritywasdeeplystudied.AtoolofcolorsimilaritybasedonVC++wasdeveloped.Thecolorsearchedthroughthistoolisprovedsimilartotheoriginalcolor.Keywords:ColorSimilarity;ColorSpace;ColorVector;ColorDifference,,,,,,,,,,,[2,3,5,6],11.1,,,,[1],r,g,b,R,G,BR=rR0,G=rG0,B=rB0(1)R0,G0,B01,,,,RGB,Lab,HLC1.2RGB(1)1RGB,C1(r1,g1,b1)C2(r2,g2,b2),,[2]:(C1,C2)=exp{-[(r1-r2)2+(g1-g2)2+(b1-b2)2]}(C1,C2)[0,1],(C1,C2)=1,,(C1,C2)(2)2[3]RGBRGB,,,RGB,d(C1,C2)=W1(r1-r2)2+W2(g1-g2)2+W3(b1-b2)2(2)8612005,C1,C2RGB,W1,W2,W3R,G,B,W1=4,W2=8,W3=11.3LabLab1976CIE(CommissionInternationaldelEclairage,)[4],Lab,,Lab,,RGBLab:RGBY=0.2963R+0.6192G+0.0845B(3),R,G,B,0100CIE:X=xyY;Y=Y;Z=zyY=1-x-yyYX,Y,Z:X=0.5164R+0.2789G+0.1792BY=0.2963R+0.6192G+0.0845BZ=0.0339R+0.1426G+1.0166BCIE1976Lab:L=116YY013-16(4)=500XX013-YY013(5)b=200YY013-ZZ013(6)Lab(4)(6)X0,Y0,Z0D65,X0=95.045,Y0=100,Z0=108.255Lab,,LabE[5]E=(L*)2+(a*)2+(b*)2(7)(7),L*=L*1-L*2a*=a*1-a*2b*=b*1-b*2E1,1.4MuncellHLCMuncell(),H(Hue,)L(Lightness,)C(Chroma,)Y.H.Gong,HLCNBS(NationalBureauofStandardsUnit,)3.0,;HLCNBS6.0,[6]1NBS1NBS01.51.53.03.06.06.012.012.0RGBHLC:RGBxyzx=0.620R+0.718G+0.204By=0.299R+0.587G+0.144Bz=0.056G+0.942Bxyzpqp=f(x)-f(y)(8)q=0.4[f(z)-f(y)](9)(8)(9),f(y)=11.6y1/3-1.6pqsts=(a+bcos)p(10)t=(c+dsin)q(11)(10)(11),=arctan(p/q),a=8.880,b=0.966,c=8.025,d=2.558,H=arctan(s/t)L=f(y)C=s2+t2A=(H1,L1,C1),B=(H2,L2,C2)Munsell,NBSDNBSDNBS(A,B)=1.2{2C1C2[1-cos(2100H)]+(C)2+(4L)2}12(12)(12),H=|H1-H2|,L=|L1-L2|,C=|C1-C2|22.1CAXA,VC++6.0,1,2A,B,,A,B396110:图3色彩相似性判断工具界面用户定制设计子系统噎噎噎噎色彩相似性判断工具CAXA实体设计平台图1系统结构图待比较色矢量B色矢量A将色矢量转换到需要的色彩空间按照公式袁获得色差阈值A,B相似A,B不相似与阈值进行比较外内图2数据流程图[(((((((([[[槡{{槡,,,,,2.2ModePrecision,,,ModeRGB,Lab,HLCC++:ClassMode{CStringm_sMode;//intm_PaletteNum;//intm_nMatchedNum;//CIntArraym_PaletteColor[i];//CIntArraym_MatchColor[i];//doublem_dColorDifference;//CRectMatchColorRect[m];//}Precision,C++:ClassPrecision{CStringm_sPrecision;//Doublem_dStep;//}2.3(1)C++Vector,,,RGBTypevectorRGBType,allocatorRGBTypeSimilarity1,Similarity2,Similarity3,;(2)RGBLab,HLCRGBLab,HLCvoidCDlgNonStandard::RGBtoLab(RGBTypergb,double&l,double&a,double&b)voidCDlgNonStandard::RGBtoHLC(RGBTypergb,double&H,doub-le&L,double&C)3106,,(R=200,G=43,B=43),2,(R=200,G=43,B=43)24,,CAXA,,,Mahalanobis:[1],.[M].:,2003.44-45.[2],,.[J].,2002,51(12):2671-2675.[3],,.[J].,1999,12(2):241-244.[4],,.[J].,2003,20(1):102-103.[5],,,.BP[J].,2000,23(8):819-823.[6],,.[J].,2003,23(6):772-775.:(1978-),,,,CAD;(1938-),,,,,;(1975-),,,,(167)[2]ourishP,BellottiV.AwarenessandCoordinationinSharedWork-spaces[C].ProceedingsofACMCSCW92,Toronto:ACMPress,1992.107-114.[3]GreenbergS.UsingDistortion-OrientedDisplaystoSupportWork-spaceAwareness,inPeopleandComputersXI[C].Springer-Verlag,1996.299-314.[4],.CoEditor-[J].,1999,11(3):225-227.[5],,,.[J].,2000,37(3).[6]JiangBo,ChenChun,BuJiajun.CoDesignaCollaborativePatternDesignSystemBasedonAgent[C].Proceedingsofthe6thInterna-tionalConferenceonCSCWinDesign,Canada,2001.[7]YDemazeau,J-PMiller.FromReactivetoInternationalAgent[C].Demazeau,MullerDes.DecentralizedArtificialIntelligence,NorthHolland,Amsterdam,1991.[8]MWooldridge,NRJennings,DKinny.AMethodologyforAgent-OrientedAnalysisandDesign[EB/OL].[9]WeirP,etal.Distortion-OrientedWorkspaceAwarenessinDOME,inPeopleandComputersXII[C].Proceedingsofthe1998BritishComputerSocietyConferenceonHuman-ComputerInteraction,Stan-fordUniversity,Stanford,Springer-Verlag,1998.239-252.:(1976-),,,CSCW;(1976-),,,CSCW;(1973-),,,,CAD/CAMCSCW;(1955-),,,,,CAD/CAMCSCW0712005