CN1945627A - Method for correcting digital tongue picture colour cast - Google Patents

Method for correcting digital tongue picture colour cast Download PDF

Info

Publication number
CN1945627A
CN1945627A CN 200610113870 CN200610113870A CN1945627A CN 1945627 A CN1945627 A CN 1945627A CN 200610113870 CN200610113870 CN 200610113870 CN 200610113870 A CN200610113870 A CN 200610113870A CN 1945627 A CN1945627 A CN 1945627A
Authority
CN
China
Prior art keywords
prime
max
image
color
lightness
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN 200610113870
Other languages
Chinese (zh)
Other versions
CN100412906C (en
Inventor
白净
张永红
吴佳
崔珊珊
孙晓静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tsinghua University
Original Assignee
Tsinghua University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tsinghua University filed Critical Tsinghua University
Priority to CNB2006101138705A priority Critical patent/CN100412906C/en
Publication of CN1945627A publication Critical patent/CN1945627A/en
Application granted granted Critical
Publication of CN100412906C publication Critical patent/CN100412906C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Processing Of Color Television Signals (AREA)

Abstract

本发明涉及舌象色偏的数字校正方法,其特征在于,依次含有以下步骤:对用闪光灯拍摄的Macbeth色校准比色卡图像进行白平衡校正后转入色调,饱和度,明度空间,与色卡的标准值比较得到相应的调整参数;再用数码相机拍摄舌象图片,再按上述方法调整白平衡后转入色调,饱和度,明度空间,用上述求出的调整参数对色调,饱和度,饱和度进行调整后,转化回红,绿,蓝空间;最后用gamma值对红绿蓝空间的图片进行调整。曲线校正值gamma值是通过Macbeth色卡标准值的明度值和色卡照片中的明度平均值用最小二乘法为标准进行拟合的。试验证明,本方法更确切地反映了舌头的真实颜色,得到了医生的认可。

The invention relates to a digital correction method for tongue image color shift, which is characterized in that it comprises the following steps in sequence: after performing white balance correction on a Macbeth color calibration color card image taken with a flashlight, it is transferred into hue, saturation, lightness space, and color The standard value of the card is compared to obtain the corresponding adjustment parameters; then use a digital camera to take a picture of the tongue image, then adjust the white balance according to the above method, and then enter the hue, saturation, lightness space, use the adjustment parameters obtained above to adjust the hue, saturation , after the saturation is adjusted, it is converted back to the red, green, and blue space; finally, the gamma value is used to adjust the image in the red, green, and blue space. The gamma value of the curve correction value is fitted by the lightness value of the Macbeth color card standard value and the lightness average value in the color card photo using the least square method as a standard. Tests have proved that this method more accurately reflects the true color of the tongue and has been approved by doctors.

Description

数字舌象色偏校正方法Digital Tongue Image Color Shift Correction Method

技术领域technical field

本发明属于舌象色偏的数字校正方法范畴。The invention belongs to the category of digital correction method for tongue image color shift.

背景技术Background technique

从20世纪80年代中后期开始,中医工作者和数字图像工作者开始联合,尝试以计算机技术为基础进行舌诊客观化研究。研究主要集中在舌头照片颜色的校准,存储和输出和用现代图像处理分析技术对舌头的照片进行处理等方面。其中,舌头的颜色是舌诊中最重要的信息。使用数码相机强制闪光模式拍摄的舌象,虽然能够利用闪光灯的强光线屏蔽自然光线干扰,但是闪光灯的强光照射舌头表面,会使舌象的整体颜色产生偏差,整个舌象偏向红黄的暖色调,因此需要通过一定的方法来校正此偏差。Since the mid-to-late 1980s, Chinese medicine practitioners and digital imaging practitioners began to combine to try to conduct objective research on tongue diagnosis based on computer technology. The research mainly focuses on the color calibration, storage and output of tongue photos, and the processing of tongue photos with modern image processing and analysis techniques. Among them, the color of the tongue is the most important information in tongue diagnosis. Although the strong light of the flash can shield the interference of natural light in the tongue image taken with the forced flash mode of a digital camera, the strong light of the flash illuminates the surface of the tongue, which will make the overall color of the tongue image deviate, and the whole tongue image tends to be warm red and yellow. Hue, so it is necessary to correct this deviation through a certain method.

本方法利用修正数码照片颜色常用的Macbeth24色标准比色卡,该比色卡经过特殊工艺处理,表面具有和皮肤相近的反射光谱,通过照片中Macbeth24比色卡的颜色和真实比色卡颜色的比对,设计出一系列校准参数,用于校准拍摄的舌头图片。This method uses the Macbeth24 color standard color card commonly used to correct the color of digital photos. The color card has been processed by a special process, and the surface has a reflection spectrum similar to the skin. For comparison, a series of calibration parameters are designed to calibrate the tongue pictures taken.

发明内容Contents of the invention

本发明的目的在于校正舌象拍摄时,由强闪光灯造成的色偏,提供一套通用的舌象颜色校正的计算机方法。The purpose of the present invention is to correct the color shift caused by the strong flashlight when the tongue image is taken, and to provide a general computer method for tongue image color correction.

本发明的特征在于:The present invention is characterized in that:

步骤(1),在强制闪光条件下,用数码相机拍摄N张Macbeth色卡,N=10~15张,并把照片输入计算机;Step (1), under the forced flash condition, take N pieces of Macbeth color cards with a digital camera, N=10~15 pieces, and photo input computer;

步骤(2),计算机对N张Macbeth色卡照片校正白平衡:Step (2), the computer corrects the white balance of N Macbeth color card photos:

若:所述N张照片Macbeth色卡照片表示为f1(x,y),f2(x,y)...fN(x,y)该照片中每一幅图像表示为:fi(x,y)=[Ri(x,y),Gi(x,y),Bi(x,y)],i=1...NRi(x,y),Gi(x,y),Bi(x,y)分别代表在采样点(x,y)的红色、绿色、蓝色的值;则校正白平衡后各照片相应的图片表示为:If: the N photos of the Macbeth color card photos are expressed as f 1 (x, y), f 2 (x, y)...f N (x, y) each image in the photos is expressed as: f i (x, y)=[R i (x, y), G i (x, y), B i (x, y)], i=1...NR i (x, y), G i (x , y), B i (x, y) respectively represent the red, green, and blue values at the sampling point (x, y); then the corresponding pictures of each photo after correcting the white balance are expressed as:

fi′=[Ri′(x,y),Gi′(x,y),Bi′(x,y)],f i '=[R i '(x, y), G i '(x, y), B i '(x, y)],

RR ii ′′ (( xx ,, ythe y )) == 255255 MaxMax (( RR ii (( xx ,, ythe y )) )) ** RR ii (( xx ,, ythe y ))

其中, G i ′ ( x , y ) = 255 Max ( G i ( x , y ) ) * G i ( x , y ) in, G i ′ ( x , the y ) = 255 Max ( G i ( x , the y ) ) * G i ( x , the y )

BB ii ′′ (( xx ,, ythe y )) == 255255 MaxMax (( BB ii (( xx ,, ythe y )) )) ** BB ii (( xx ,, ythe y ))

其中,Max(Ri(x,y)),Max(Gi(x,y))和Max(Bi(x,y))分别表示在图像fi(x,y)中,红色通道、绿色通道和蓝色通道的最大值;Among them, Max(R i (x, y)), Max(G i (x, y)) and Max(B i (x, y)) respectively represent in the image f i (x, y), the red channel, the maximum value of the green and blue channels;

步骤(3),把将在RGB空间表示的fi′(x,y)和Macbeth色卡颜色转入HSV空间表示,HSV分别表示色调,饱和度和明度:Step (3), transfer f i '(x, y) and Macbeth color card colors expressed in RGB space into HSV space representation, and HSV represents hue, saturation and lightness respectively:

步骤(3.1),把fi′(x,y)=[Ri′(x,y),Gi′(x,y),Bi′(x,y)]转换到HSV空间:Step (3.1), convert f i ′(x, y)=[R i ′(x, y), G i ′(x, y), B i ′(x, y)] to HSV space:

Hh ii ′′ (( xx ,, ythe y )) == coscos -- 11 [[ (( RR ii ′′ (( xx ,, ythe y )) -- GG ii ′′ (( xx ,, ythe y )) )) ++ (( RR ii ′′ (( xx ,, ythe y )) -- BB ii ′′ (( xx ,, ythe y )) )) 22 (( RR ii ′′ (( xx ,, ythe y )) -- GG ii ′′ (( xx ,, ythe y )) )) 22 ++ (( RR ii ′′ (( xx ,, ythe y )) -- BB ii ′′ (( xx ,, ythe y )) )) ** (( GG ii ′′ (( xx ,, ythe y )) -- BB ii ′′ (( xx ,, ythe y )) )) ]]

SS ii ′′ (( xx ,, ythe y )) == MaxMax (( RR ii ′′ (( xx ,, ythe y )) ,, GG ii ′′ (( xx ,, ythe y )) ,, BB ii ′′ (( xx ,, ythe y )) )) -- MinMin (( RR ii ′′ (( xx ,, ythe y )) ,, GG ii ′′ (( xx ,, ythe y )) ,, BB ii ′′ (( xx ,, ythe y )) )) MaxMax (( RR ii ′′ (( xx ,, ythe y )) ,, GG ii ′′ (( xx ,, ythe y )) ,, BB ii ′′ (( xx ,, ythe y )) ))

Vi′(x,y)=Max(Ri′(x,y),Gi′(x,y),Bi′(x,y))V i '(x, y) = Max(R i '(x, y), G i '(x, y), B i '(x, y))

所述Hi′(x,y),Si′(x,y),Vi′(x,y)分别表示转换后第i幅图像在采样点(x,y)的色调、饱和度、明度三个通道的值,而Ri′(x,y),Gi′(x,y),Bi′(x,y)分别表示调整白平衡后第i幅图像在采样点(x,y)的红、绿、蓝三个通道的值,校正白平衡后图像的HSV通道表示为:The H i ′(x, y), S i ′(x, y), and V i ′(x, y) represent the hue, saturation, saturation, The values of the three channels of lightness, and R i ′(x, y), G i ′(x, y), and B i ′(x, y) respectively represent the i-th image at the sampling point (x, y) after adjusting the white balance. The values of the red, green and blue channels of y), the HSV channel of the image after correcting the white balance is expressed as:

fi′(x,y)=[Hi′(x,y),Si′(x,y),Vi′(x,y)]f i '(x, y) = [H i '(x, y), S i '(x, y), V i '(x, y)]

步骤(3.2),把Macbeth色卡的标准值Mj转入HSV空间,Step (3.2), transfer the standard value Mj of the Macbeth color card into the HSV space,

Mj=[MRj,MGj,MBj],j=1~24M j =[MR j , MG j , MB j ], j=1~24

MHMH jj == coscos -- 11 [[ (( MRMR jj -- MGMG jj )) ++ (( MRMR jj -- MBMB jj )) 22 (( MRMR jj -- MGMG jj )) 22 ++ (( MRMR jj -- MGMG jj )) (( MRMR jj -- MBMB jj )) ]]

MS j = Max ( MR j , MG j , MB j ) - Min ( MR j , MG j , MB j ) Max ( MR j , MG j , MB j ) but MS j = Max ( MR j , MG j , MB j ) - Min ( MR j , MG j , MB j ) Max ( MR j , MG j , MB j )

MVj=Max(MRj,MGj,MBj)MV j = Max(MR j , MG j , MB j )

其中,MRj,MGj,MBj分别表示色卡第j个色块的红、绿、蓝三个通道的值,Among them, MR j , MG j , and MB j respectively represent the values of the red, green and blue channels of the jth color block of the color card,

MHj,MSj,MVj分别表示转换后第j个色块的色调、饱和度、明度三个通道的值;MH j , MS j , and MV j represent the values of the three channels of hue, saturation, and lightness of the jth color block after conversion;

得到:色卡标准值的HSV空间表达方式:Mj=[MHj,MSj,MVj],j=1~24;Obtained: the HSV space expression of the standard value of the color card: M j = [MH j , MS j , MV j ], j = 1~24;

步骤(4),按照以下步骤通过标准Macbeth色卡与色卡照片的值分别求出各调整参数:In step (4), according to the following steps, each adjustment parameter is obtained respectively through the values of the standard Macbeth color card and the color card photo:

步骤(4.1),求出调整白平衡后Macbeth色卡照片色调H通道的平均值,并把其与标准色卡平均色调作比较,得到色调调整参数h:Step (4.1), calculate the average value of the color tone H channel of the Macbeth color card photo after adjusting the white balance, and compare it with the average color tone of the standard color card to obtain the tone adjustment parameter h:

N副Macbeth照片的色调平均值为 Hav = 1 N Σ i = 1 N Hav i , Havi为调整白平衡后的第i个图像的色调H通道的平均值,The average color tone of N Macbeth photos is Hav = 1 N Σ i = 1 N Hav i , Hav i is the average value of the hue H channel of the i-th image after adjusting the white balance,

Macbeth色卡的标准色调平均值为 Hst = 1 24 Σ j = 1 24 MH j , The standard hue average of the Macbeth color card is Hst = 1 twenty four Σ j = 1 twenty four M H j ,

色调调整参数为h=Hav-Hst;The hue adjustment parameter is h=Hav-Hst;

步骤(4.2),求出调整白平衡后Macbeth色卡照片明度V通道的平均值,并把其与标准色卡平均明度作比较,得到明度调整参数v:Step (4.2), calculate the average value of the lightness V channel of the Macbeth color card photo after adjusting the white balance, and compare it with the average lightness of the standard color card to obtain the lightness adjustment parameter v:

N副Macbeth照片的明度平均值为 Vav = 1 N Σ i = 1 N Vav i , Vavi为调整白平衡后的第i个图像的明度V通道的平均值,The average brightness of N Macbeth photos is Vav = 1 N Σ i = 1 N Vav i , Vav i is the average value of the lightness V channel of the i-th image after adjusting the white balance,

Macbeth色卡的标准明度平均值为 Vst = 1 24 Σ j = 1 24 MV j , The standard lightness average of the Macbeth color card is Vst = 1 twenty four Σ j = 1 twenty four MV j ,

明度调整参数为v=Vav-Vst;Brightness adjustment parameter is v=Vav-Vst;

步骤(4.3),求调整自平衡后Macbeth色卡照片饱和度S通道的平均值,并把其与色卡标准值的饱和度做比较,通过拟合得到饱和度调整参数s:Step (4.3), calculate the average value of the saturation S channel of the photo of the Macbeth color card after adjusting the self-balancing, and compare it with the saturation of the standard value of the color card, and obtain the saturation adjustment parameter s by fitting:

在N张Macbeth色卡照片中,色块j的饱和度平均值为 Sav j = 1 N Σ i = 1 N fS ij , 其中,fSij为第i幅照片中色块j的饱和度,i=1~N,j=1~24,In the N Macbeth color card photos, the average saturation of color patch j is Sav j = 1 N Σ i = 1 N f ij , Among them, fS ij is the saturation of color block j in the i-th photo, i=1~N, j=1~24,

色卡中各色块的标准饱和度为MS1,MS2...MS24The standard saturation of each color block in the color card is MS 1 , MS 2 ... MS 24 ,

饱和度调整参数s为: s = Σ j = 1 24 Sav j * MS j Σ j = 1 24 Sav j 2 ; The saturation adjustment parameter s is: the s = Σ j = 1 twenty four Sav j * MS j Σ j = 1 twenty four Sav j 2 ;

步骤(5),求出曲线校正值gamma:Step (5), calculate the curve correction value gamma:

在N张Macbeth色卡照片中,色块j的明度值为 Vav j = 1 N Σ i = 1 N fV ij , 其中,fVij为第i幅照片中色块j的明度,i=1~N,j=1~24,In the N Macbeth color card photos, the lightness value of the color block j is Vav j = 1 N Σ i = 1 N f ij , Among them, fV ij is the lightness of the color block j in the i-th photo, i=1~N, j=1~24,

色卡中各色块的标准明度为Vav1,Vav2...Vav24The standard lightness of each color block in the color card is Vav 1 , Vav 2 ...Vav 24 ,

曲线校正值gamma为: gamma = Σ j = 1 24 ln ( Vav j ) * ln ( MV j ) Σ j = 1 24 ln ( Vav j ) 2 ; The curve correction value gamma is: gamma = Σ j = 1 twenty four ln ( Vav j ) * ln ( MV j ) Σ j = 1 twenty four ln ( Vav j ) 2 ;

步骤(6),用数码相机拍摄舌头照片,得到图像It(x,y)=[IR(x,y),IG(x,y),IB(x,y)],其中,IR(x,y),IG(x,y),IB(x,y)分别代表在该图像采样点(x,y)红色、绿色、蓝色的值;步骤(7),校正舌象照片It(x,y)中的白色为纯白色,得到校正后的舌象照片为It′(x,y):Step (6), take a picture of the tongue with a digital camera to obtain an image It (x, y)=[IR (x, y), IG (x, y), IB (x, y)], wherein, IR (x, y) y), IG(x, y), and IB(x, y) respectively represent the values of red, green, and blue at the image sampling point (x, y); step (7), correct the tongue image photo It(x, The white in y) is pure white, and the corrected tongue picture is It′(x, y):

It′(x,y)=[IR′(x,y),IG′(x,y),IB′(x,y)]It'(x,y)=[IR'(x,y), IG'(x,y), IB'(x,y)]

IRIR ′′ (( xx ,, ythe y )) == 255255 MaxMax (( IRIR (( xx ,, ythe y )) )) ** IRIR (( xx ,, ythe y ))

IGIG ii ′′ (( xx ,, ythe y )) == 255255 MaxMax (( IGIG (( xx ,, ythe y )) )) ** IGIG (( xx ,, ythe y ))

IBIB ii ′′ (( xx ,, ythe y )) == 255255 MaxMax (( IBIB (( xx ,, ythe y )) )) ** IBIB (( xx ,, ythe y ))

其中,Max(IR(x,y)),Max(IG(x,y))和Max(IB(x,y))分别表示在图像It(x,y)中,红色通道、绿色通道和蓝色通道的最大值;Among them, Max(IR(x, y)), Max(IG(x, y)) and Max(IB(x, y)) respectively represent the red channel, green channel and blue channel in the image It(x, y). The maximum value of the color channel;

步骤(8),将在RGB空间表示的舌象图片转换到用色调H,饱和度S,明度V空间表示Step (8), the tongue image picture represented in RGB space is converted to use hue H, saturation S, lightness V space representation

IHIH ′′ (( xx ,, ythe y )) == coscos -- 11 [[ (( IRIR ′′ (( xx ,, ythe y )) -- IGIG ′′ (( xx ,, ythe y )) )) ++ (( IRIR ′′ (( xx ,, ythe y )) -- IBIB ′′ (( xx ,, ythe y )) )) 22 (( IRIR ′′ (( xx ,, ythe y )) -- IGIG ′′ (( xx ,, ythe y )) )) 22 ++ (( IRIR ′′ (( xx ,, ythe y )) -- IBIB ′′ (( xx ,, ythe y )) )) (( IGIG ′′ (( xx ,, ythe y )) -- IBIB ′′ (( xx ,, ythe y )) )) ]]

ISIS ′′ (( xx ,, ythe y )) == MaxMax (( IRIR ′′ (( xx ,, ythe y )) ,, IGIG ′′ (( xx ,, ythe y )) ,, IBIB ′′ (( xx ,, ythe y )) )) -- MinMin (( IRIR ′′ (( xx ,, ythe y )) ,, IGIG ′′ (( xx ,, ythe y )) ,, IBIB ′′ (( xx ,, ythe y )) )) MaxMax (( IRIR ′′ (( xx ,, ythe y )) ,, IGIG ′′ (( xx ,, ythe y )) ,, IBIB ′′ (( xx ,, ythe y )) ))

IV′(x,y)=Max(IR′(x,y),IG′(x,y),IB′(x,y));IV'(x,y)=Max(IR'(x,y), IG'(x,y), IB'(x,y));

步骤(9),判断在校正白平衡后,舌象图片曝光是否过度,对曝光不足的图片要进行明度均衡:Step (9), after correcting the white balance, determine whether the tongue picture is overexposed, and perform brightness balance on the underexposed picture:

步骤(9.1),对所述的照片做明度直方图分布:Step (9.1), the brightness histogram distribution is done to the photo:

直方图HistV(t)=Num(IV′(x,y)=t),t=0~255,表示在直方图中,第t个分量代表的意思为在明度图IV′(x,y)中值为t的点的个数;Histogram HistV(t)=Num(IV'(x, y)=t), t=0~255, which means that in the histogram, the tth component means that in the brightness map IV'(x, y) The number of points whose median value is t;

步骤(9.2),求明度图的峰值PeakV:Step (9.2), find the peak value PeakV of the lightness map:

PeakV=Max(HistV(t)),t=0~255;PeakV=Max(HistV(t)), t=0~255;

步骤(9.3),判断是否PeakV<thresholdVStep (9.3), judge whether PeakV<thresholdV

其中,thresholdV为设定值取值100,若PeakV≥thresholdV,则对IV′(x,y)不处理,Wherein, thresholdV is the setting value of 100, if PeakV≥thresholdV, then IV'(x, y) will not be processed,

否则,进入下一个步骤;Otherwise, go to the next step;

步骤(9.4),对图像IV′(x,y)作直方图均衡化,得到 IV &prime; ( x , y ) = &Sigma; k = 1 IV &prime; ( x , y ) HistV ( IV &prime; ( x , y ) ) , k表示明度值的计数器;Step (9.4), perform histogram equalization on the image IV'(x, y), and obtain IV &prime; ( x , the y ) = &Sigma; k = 1 IV &prime; ( x , the y ) HistV ( IV &prime; ( x , the y ) ) , k represents the counter of the lightness value;

步骤(10),根据步骤(4)设定的调整参数h、s、v对HSV空间内的图像进行校正:Step (10), the image in the HSV space is corrected according to the adjustment parameters h, s, v set in step (4):

IHd(x,y)=IH′(x,y)-hIH d (x, y) = IH'(x, y)-h

ISd(x,y)=IS′(x,y)*s;IS d (x, y) = IS'(x, y)*s;

IVd(x,y)=IV′(x,y)-vIV d (x, y) = IV'(x, y) - v

步骤(11),将HSV空间内的图像转化到RGB空间内:Step (11), convert the image in the HSV space into the RGB space:

步骤(11.1),设定四个临时变量f,aa,bb,cc帮助转化:Step (11.1), set four temporary variables f, aa, bb, cc to help transform:

其中,f=IHd-floor(IHd),函数floor(IHd)的意思是取比IHd小的最大的整数,故f表示的是IHd的小数部分,Wherein, f=IH d -floor(IH d ), the meaning of function floor(IH d ) is to get the largest integer smaller than IH d , so what f represents is the fractional part of IH d ,

aa=IVd*(1-ISd)aa=IV d *(1-IS d )

bb=IVd*(1-(ISd*f))bb=IV d *(1-(IS d *f))

cc=IVd*(1-(ISd*(1-f)))cc=IV d *(1-(IS d *(1-f)))

步骤(11.2),根据IHd的范围确定IRd,IGd,IBd的值:Step (11.2), determine the value of IR d , IG d , IB d according to the range of IH d :

IH d &Element; [ 0 ~ &pi; 6 ) , 则IRd=IVd,IGd=cc,IBd=aalike IH d &Element; [ 0 ~ &pi; 6 ) , Then IR d =IV d , IG d =cc, IB d =aa

IH d &Element; [ &pi; 6 ~ &pi; 3 ) , 则IRd=bb,IGd=IVd,IBd=aalike IH d &Element; [ &pi; 6 ~ &pi; 3 ) , Then IR d = bb, IG d = IV d , IB d = aa

IH d &Element; [ &pi; 3 ~ &pi; 2 ) , 则IRd=aa,IGd=IVd,IBd=cclike IH d &Element; [ &pi; 3 ~ &pi; 2 ) , Then IR d = aa, IG d = IV d , IB d = cc

IH d &Element; [ &pi; 2 ~ 2 &pi; 3 ) , 则IRd=aa,IGd=bb,IBd=IVd like IH d &Element; [ &pi; 2 ~ 2 &pi; 3 ) , Then IR d = aa, IG d = bb, IB d = IV d

IH d &Element; [ 2 &pi; 3 ~ 5 &pi; 6 ) , 则IRd=cc,IGd=aa,IBd=IVd like IH d &Element; [ 2 &pi; 3 ~ 5 &pi; 6 ) , Then IR d =cc, IG d =aa, IB d =IV d

IH d &Element; [ 5 &pi; 6 ~ 2 &pi; ) , 则IRd=IVd,IGd=aa,IBd=bblike IH d &Element; [ 5 &pi; 6 ~ 2 &pi; ) , Then IR d =IV d , IG d =aa, IB d =bb

步骤(12),用曲线校正值gamma对图像进行调整:Step (12), adjust the image with the curve correction value gamma:

IRd′(x,y)=IRd(x,y)gamma IR d '(x, y) = IR d (x, y) gamma

IGd′(x,y)=IGd(x,y)gamma IG d '(x, y) = IG d (x, y) gamma

IBd′(x,y)=IBd(x,y)gamma IB d '(x, y) = IB d (x, y) gamma

得到的调整后图像Itd(x,y)=[IRd′(x,y),IGd′(x,y),IBd′(x,y)]就是调整后的舌象照片。The obtained adjusted image It d (x, y)=[IR d ′(x, y), IG d ′(x, y), IB d ′(x, y)] is the adjusted tongue image photo.

使用结果证明经过医生目测,确定调整后的图象比未调整的图象更确切的反映了舌头的真实颜色,得到医生的认可。The result of use proves that the adjusted image reflects the true color of the tongue more accurately than the unadjusted image after the doctor's visual inspection, which is recognized by the doctor.

附图说明Description of drawings

图1:算法流程图;Figure 1: Algorithm flow chart;

图2:Macbeth色卡实物图;Figure 2: The physical picture of the Macbeth color card;

图3:Macbeth色卡示意图;Figure 3: Schematic diagram of the Macbeth color card;

图4:Macbeth色卡真值表;Figure 4: Macbeth color card truth table;

图5:照片的直方图:(a)曝光未足的照片明度直方图,(b)作直方图均衡化之后的明度直方图;Figure 5: The histogram of the photo: (a) the brightness histogram of the underexposed photo, (b) the brightness histogram after histogram equalization;

图6:拍摄的一张舌象照片;Figure 6: A photo of the tongue image taken;

图7:调整白平衡、明度均匀化之后的舌象照片;Figure 7: A photo of the tongue image after white balance adjustment and brightness uniformization;

图8:调整完的舌象照片结果。Figure 8: The result of the adjusted tongue photo.

具体实施方式Detailed ways

该方法硬件由一个数码照相机和一台计算机组成。调整算法的软件由Matlab实现。输入的舌头照片由中医大夫用数码相机拍摄,拍摄时病人平伸出舌头,方便医生将整个舌头摄入照片。The method hardware consists of a digital camera and a computer. The software for adjusting the algorithm is realized by Matlab. The imported tongue photo is taken by a doctor of traditional Chinese medicine with a digital camera. When taking the photo, the patient sticks out his tongue, which is convenient for the doctor to take the whole tongue into the photo.

Macbeth色卡由24个色块组成,分布为四行六列,按照从左至右,从上到下的顺序排列,如图2所示。依次表示为Mj=[MRj,MGj,MBj],j=1~24,顺序示意图如图3所示。其中,MRj,MGj,MBj分别表示第j个色块中红色,绿色,蓝色通道的数值,其附带说明中列有该卡24个色块的标准值,如图4所示。The Macbeth color card consists of 24 color blocks, distributed in four rows and six columns, arranged in order from left to right and from top to bottom, as shown in Figure 2. The sequence is expressed as M j =[MR j , MG j , MB j ], j=1-24, and the schematic diagram of the sequence is shown in FIG. 3 . Among them, MR j , MG j , and MB j represent the values of the red, green, and blue channels in the jth color block respectively, and the standard values of the 24 color blocks of the card are listed in the accompanying instructions, as shown in Figure 4.

采用尼(Sony)Cybershot DSC-W1数码相机,在室内拍照,拍摄时避免强光干扰,同时使用强制闪光灯模式,距离为30厘米左右。拍摄10张Macbeth色卡,将照片输入到计算机中。Use Sony Cybershot DSC-W1 digital camera to take pictures indoors, avoid strong light interference when shooting, and use forced flash mode at the same time, the distance is about 30 cm. Take 10 Macbeth color cards and import the photos into the computer.

对十幅图像调整白平衡,将图像中最亮的颜色调整到(255,255,255),其他颜色作相应的线性调整。再将其转化到HSV空间。Adjust the white balance of the ten images, adjust the brightest color in the image to (255, 255, 255), and make corresponding linear adjustments for other colors. Then convert it to HSV space.

对于转化到HSV空间中的图像,与标准色卡颜色做对比,求出参量。在我们的实验中,得到四个参量分别是h=0.02,s=-5,v=-6,gamma=1.1。For the image converted into HSV space, compare it with the color of the standard color card to find the parameters. In our experiment, the four parameters obtained are h=0.02, s=-5, v=-6, gamma=1.1.

摄入一张舌头的照片,存入计算机。如图6所示。对该照片调整白平衡后,转换到HSV空间。求V通道的直方图,发现该图像属于曝光不足类型,对图像进行明度均衡化,得到图片如图7所示。Take a picture of your tongue and save it to your computer. As shown in Figure 6. After adjusting the white balance of this photo, convert to HSV space. Find the histogram of the V channel, and find that the image is underexposed, and equalize the brightness of the image, as shown in Figure 7.

再按照这套系统得到的参数h=0.02,s=-5,v=-6,gamma=1.1对图像进行相应的调整,最后调整后的结果如图8所示。According to the parameters h=0.02, s=-5, v=-6, gamma=1.1 obtained by this system, the image is adjusted accordingly, and the final adjusted result is shown in FIG. 8 .

本发明具体实施步骤如下:The specific implementation steps of the present invention are as follows:

1.拍摄N张Macbeth色卡1. Take N pieces of Macbeth color cards

拍摄条件为:在室内拍照,拍摄时避免强光干扰,同时使用强制闪光灯模式,距离为30厘米左右。拍摄N张Macbeth色卡,N=10~15。将照片输入到计算机中。The shooting conditions are: take pictures indoors, avoid strong light interference when shooting, and use forced flash mode at the same time, with a distance of about 30 cm. Take N pieces of Macbeth color cards, N=10~15. Import photos into your computer.

2.对这N张Macbeth色卡照片校正白平衡2. Correct the white balance of these N Macbeth color card photos

将储存在计算机中的N张照片表示为f1(x,y),f2(x,y)...fN(x,y),其中,对于每一幅图像,fi(x,y)=[Ri(x,y),Gi(x,y),Bi(x,y)],i=1...N。(x,y)代表图像的采样点,Ri(x,y),Gi(x,y),Bi(x,y)分别代表在该采样点红色、绿色、蓝色的值。Denote the N photos stored in the computer as f 1 (x, y), f 2 (x, y)...f N (x, y), where, for each image, f i (x, y)=[R i (x, y), G i (x, y), B i (x, y)], i=1...N. (x, y) represents the sampling point of the image, and R i (x, y), G i (x, y), and Bi ( x, y) represent the red, green, and blue values at the sampling point, respectively.

由于在数码照片中的纯白色的红、绿、蓝三个颜色的值分别为255,255,255,是图像中最亮的颜色,也是各通道的最大值。为了校正拍摄图像的亮度色偏,在校正图像颜色之前,需要将照片中的白色校正为纯白色,其方法为:Since the pure white red, green, and blue colors in digital photos have values of 255, 255, and 255 respectively, they are the brightest color in the image and the maximum value of each channel. In order to correct the brightness and color cast of the captured image, before correcting the image color, it is necessary to correct the white in the photo to pure white, the method is:

RR ii &prime;&prime; (( xx ,, ythe y )) == 255255 MaxMax (( RR ii )) ** RR ii (( xx ,, ythe y ))

GG ii &prime;&prime; (( xx ,, ythe y )) == 255255 MaxMax (( GG ii )) ** GG ii (( xx ,, ythe y ))

BB ii &prime;&prime; (( xx ,, ythe y )) == 255255 MaxMax (( BB ii )) ** BB ii (( xx ,, ythe y ))

其中,Max(Ri),Max(Gi)和Max(Bi)表示在图像fi(x,y)中,红色通道、绿色通道和蓝色通道的最大值。调整后相应图片表示为fi′=[Ri′(x,y),Gi′(x,y),Bi′(x,y)]。通过调整白平衡,我们得到一系列调整后的图像f1′(x,y),f2′(x,y)...fN′(x,y)。Wherein, Max(R i ), Max(G i ) and Max(B i ) represent the maximum values of the red channel, the green channel and the blue channel in the image f i (x, y). The adjusted corresponding picture is expressed as f i '=[R i '(x, y), G i '(x, y), B i '(x, y)]. By adjusting the white balance, we obtain a series of adjusted images f 1 ′(x,y), f 2 ′(x,y) . . . f N ′(x,y).

3.将在RGB(红、绿、蓝)空间表示的fi′(x,y)和色卡颜色Mj=[MRj,MGj,MBj],j=1~24转入HSV(色调,饱和度,明度)空间表示3. The f i '(x, y) and the color card color M j =[MR j , MG j , MB j ] expressed in RGB (red, green, blue) space, j=1~24 are transferred to HSV ( hue, saturation, lightness) spatial representation

对于已经校正白平衡的图像fi′(x,y)=[Ri′(x,y),Gi′(x,y),Bi′(x,y)],通过下式将其转换到HSV空间中。For the image f i '(x, y)=[R i '(x, y), G i '(x, y), B i '(x, y)] for the image f i '(x, y)] whose white balance has been corrected, it is expressed by the following formula Convert to HSV space.

Hh ii &prime;&prime; (( xx ,, ythe y )) == coscos -- 11 [[ (( RR ii &prime;&prime; (( xx ,, ythe y )) -- GG ii &prime;&prime; (( xx ,, ythe y )) )) ++ (( RR ii &prime;&prime; (( xx ,, ythe y )) -- BB ii &prime;&prime; (( xx ,, ythe y )) )) 22 (( RR ii &prime;&prime; (( xx ,, ythe y )) -- GG ii &prime;&prime; (( xx ,, ythe y )) )) 22 ++ (( RR ii &prime;&prime; (( xx ,, ythe y )) -- BB ii &prime;&prime; (( xx ,, ythe y )) )) ** (( GG ii &prime;&prime; (( xx ,, ythe y )) -- BB ii &prime;&prime; (( xx ,, ythe y )) )) ]]

SS ii &prime;&prime; (( xx ,, ythe y )) == MaxMax (( RR ii &prime;&prime; (( xx ,, ythe y )) ,, GG ii &prime;&prime; (( xx ,, ythe y )) ,, BB ii &prime;&prime; (( xx ,, ythe y )) )) -- MinMin (( RR ii &prime;&prime; (( xx ,, ythe y )) ,, GG ii &prime;&prime; (( xx ,, ythe y )) ,, BB ii &prime;&prime; (( xx ,, ythe y )) )) MaxMax (( RR ii &prime;&prime; (( xx ,, ythe y )) ,, GG ii &prime;&prime; (( xx ,, ythe y )) ,, BB ii &prime;&prime; (( xx ,, ythe y )) ))

Vi′(x,y)=Max(Ri′(x,y),Gi′(x,y),Bi′(x,y))V i '(x, y) = Max(R i '(x, y), G i '(x, y), B i '(x, y))

其中,Ri′(x,y),Gi′(x,y),Bi′(x,y)分别表示调整白平衡后第i幅图像在采样点(x,y)的红、绿、蓝三个通道的值,Hi′(x,y),Si′(x,y),Vi′(x,y)分别表示转换后第i幅图像在采样点(x,y)的色调、饱和度、明度三个通道的值。由此得到校正白平衡之后图像的HSV通道表示为Among them, R i ′(x, y), G i ′(x, y), and B i ′(x, y) respectively represent the red and green colors of the i-th image at the sampling point (x, y) after adjusting the white balance. , the values of the three channels of blue, H i ′(x, y), S i ′(x, y), V i ′(x, y) respectively represent the i-th image after conversion at the sampling point (x, y) The values of the three channels of Hue, Saturation, and Brightness. Thus, the HSV channel of the image after correcting the white balance is expressed as

fi′(x,y)=[Hi′(x,y),Si′(x,y),Vi′(x,y)]f i '(x, y) = [H i '(x, y), S i '(x, y), V i '(x, y)]

另外,将对色卡的标准值Mj=[MRj,MGj,MBj],j=1~24也转入到HSV空间。In addition, the standard value M j =[MR j , MG j , MB j ] of the color card, j=1~24 is also transferred to the HSV space.

MHMH jj == coscos -- 11 [[ (( MRMR jj -- MGMG jj )) ++ (( MRMR jj -- MBMB jj )) 22 (( MRMR jj -- MGMG jj )) 22 ++ (( MRMR jj -- MGMG jj )) (( MRMR jj -- MBMB jj )) ]]

MSMS jj == MaxMax (( MRMR jj ,, MGMG jj ,, MBMB jj )) -- MinMin (( MRMR jj ,, MGMG jj ,, MBMB jj )) MaxMax (( MRMR jj ,, MGMG jj ,, MBMB jj ,, ))

MVj=Max(MRj,MGj,MBj)MV j = Max(MR j , MG j , MB j )

其中,MRj,MGj,MBj分别表示色卡第j个色块的红、绿、蓝三个通道的值,MHj,MSj,MVj分别表示转换后第j个色块的色调、饱和度、明度三个通道的值。从而得到色卡标准值的HSV空间表达方式Mj=[MHj,MSj,MVj],j=1~24。Among them, MR j , MG j , and MB j represent the values of the red, green, and blue channels of the jth color block of the color card respectively, and MH j , MS j , and MV j represent the hue of the jth color block after conversion , Saturation, Brightness three channel values. Thus, the HSV space expression of the standard value of the color card is obtained M j =[MH j , MS j , MV j ], j=1-24.

4.求出调整白平衡后Macbeth色卡照片H(色调)通道的平均值,与色卡平均色调做比较,得到色调调整参数h4. Find the average value of the H (hue) channel of the Macbeth color card photo after adjusting the white balance, and compare it with the average hue of the color card to obtain the hue adjustment parameter h

用Hav1,Hav2,...HavN表示调整后的各个图像i的H通道的平均值,则N副图像的色调平均值为 Hav = 1 N &Sigma; i = 1 N Hav i &CenterDot; 另外,求色卡标准色调值的平均值 Hst = 1 24 &Sigma; j = 1 24 MH j &CenterDot; 两者的差h=Hav-Hst为调整色度的参数。Use Hav 1 , Hav 2 , ... Hav N to represent the average value of the H channel of each image i after adjustment, then the average value of the tone of the N sub-images is Hav = 1 N &Sigma; i = 1 N Hav i &Center Dot; In addition, find the average value of the standard hue value of the color card Hst = 1 twenty four &Sigma; j = 1 twenty four M H j &CenterDot; The difference between the two h=Hav-Hst is a parameter for adjusting chromaticity.

5.求出调整白平衡后Macbeth色卡照片V(明度)通道的平均值,与色卡平均明度做比较,得到明度调整参数v5. Find the average value of the V (lightness) channel of the Macbeth color card photo after adjusting the white balance, and compare it with the average lightness of the color card to obtain the lightness adjustment parameter v

用Vav1,Vav2,...VavN表示调整后的各个图像的V通道的平均值,则N副图像的明度平均值为 Vav = 1 N &Sigma; i = 1 N Vav i &CenterDot; 另外,求色卡标准值的平均值 Vst = 1 24 &Sigma; j = 1 24 MV j &CenterDot; 两者的差v=Vav-Vst为调整明度的参数。Use Vav 1 , Vav 2 ,...Vav N to represent the average value of the V channels of each image after adjustment, then the average value of the brightness of the N images is Vav = 1 N &Sigma; i = 1 N Vav i &CenterDot; In addition, find the average value of the standard value of the color card Vst = 1 twenty four &Sigma; j = 1 twenty four MV j &Center Dot; The difference v=Vav-Vst between the two is a parameter for adjusting brightness.

6.求出调整白平衡后Macbeth色卡照片S(饱和度)通道的平均值,与色卡的饱和度做比较,通过拟合得到饱和度调整参数s6. Find the average value of the S (saturation) channel of the Macbeth color card photo after adjusting the white balance, compare it with the saturation of the color card, and obtain the saturation adjustment parameter s by fitting

在一张调整了白平衡之后的照片fi′(x,y)中,按照位置分别取出24个矩形的色块,如图3所示,求得各个色块内饱和度分别为fSi1,fSi2....fSi24。对采集的所有照片都分别求出24个色块的饱和度之后,再求各个色块对于这N张图片的平均值。In a photo f i ′(x, y) after adjusting the white balance, 24 rectangular color blocks are taken out according to their positions, as shown in Figure 3, and the saturation in each color block is obtained as fS i1 , fS i2 .... fS i24 . After calculating the saturation of 24 color blocks for all the collected photos, calculate the average value of each color block for the N pictures.

SavSav jj == 11 NN &Sigma;&Sigma; ii == 11 NN fSf ijij &CenterDot;&Center Dot;

对于求得的饱和度平均值Sav1,Sav2...Sav24和色卡标准饱和度MS1,MS2...MS24,用最小二乘法标准进行拟和,具体方法为:选取参数s,MSj=s*Savj,使得 &delta; = &Sigma; j = 1 24 ( s * Sav j - MS j ) 2 的值最小。For the calculated saturation averages Sav 1 , Sav 2 ...Sav 24 and color card standard saturation MS 1 , MS 2 ...MS 24 , use the least square method to fit the standard, the specific method is: select the parameters s, MS j = s*Sav j , such that &delta; = &Sigma; j = 1 twenty four ( the s * Sav j - MS j ) 2 The value of is the smallest.

s的计算方法为: s = &Sigma; j = 1 24 Sav j * MS j &Sigma; j = 1 24 Sav j 2 The calculation method of s is: the s = &Sigma; j = 1 twenty four Sav j * MS j &Sigma; j = 1 twenty four Sav j 2

7.求出调整白平衡后色卡照片V(明度)通道的平均值,与色卡的明度做比较,通过拟合得到曲线校正值gamma7. Find the average value of the V (lightness) channel of the color card photo after adjusting the white balance, compare it with the lightness of the color card, and obtain the curve correction value gamma by fitting

gamma源于CRT(显示器/电视机)的响应曲线,即其明度与输入电压的非线性关系;Gamma comes from the response curve of CRT (monitor/TV), that is, the nonlinear relationship between its brightness and input voltage;

gamma校正相当于对图像进行处理;gamma的变化带来明度的变化,故通过明度V通道来得到gamma的值:Gamma correction is equivalent to processing the image; the change of gamma brings the change of brightness, so the value of gamma is obtained through the brightness V channel:

在一张调整了白平衡之后的照片fi′(x,y)中,按照位置分别取出24个矩形的色块,求得各个色块内明度数值分别为fVi1,fVi2....fVi24。对采集的所有照片都分别求出24个色块的明度之后,再求各个色块对于这N张图片的平均值。In a photo f i ′(x, y) after adjusting the white balance, 24 rectangular color blocks are taken out according to the positions, and the lightness values in each color block are obtained as fV i1 , fV i2 ... fV i24 . After calculating the lightness of 24 color blocks for all the collected photos, calculate the average value of each color block for the N pictures.

VavVav jj == 11 NN &Sigma;&Sigma; ii == 11 NN fVf ijij &CenterDot;&CenterDot;

对于求得的明度平均值Vav1,Vav2...Vav24和色卡标准明度MV1,MV2...MV24,用最小二乘法标准进行拟和,具体方法为:选取参数gamma,MVj=Vavj gamma,使得 &sigma; = &Sigma; j = 1 24 ( Vav j gamma - MV j ) 2 的值最小。For the obtained lightness averages Vav 1 , Vav 2 ... Vav 24 and color card standard lightness MV 1 , MV 2 ... MV 24 , use the least square method to fit the standard, the specific method is: select the parameter gamma, MV j = Vav j gamma , such that &sigma; = &Sigma; j = 1 twenty four ( Vav j gamma - MV j ) 2 The value of is the smallest.

gamma的计算方法为 gamma = &Sigma; j = 1 24 ln ( Vav j ) * ln ( MV j ) &Sigma; j = 1 24 ln ( Vav j ) 2 &CenterDot; The calculation method of gamma is gamma = &Sigma; j = 1 twenty four ln ( Vav j ) * ln ( MV j ) &Sigma; j = 1 twenty four ln ( Vav j ) 2 &Center Dot;

8.用数码相机拍摄舌头照片,存入计算机。8. Take photos of the tongue with a digital camera and store them in the computer.

其表示方法为It(x,y)=[IR(x,y),IG(x,y),IB(x,y)],(x,y)代表图像的采样点,IR(x,y),IG(x,y),IB(x,y)分别代表在该采样点红色、绿色、蓝色的值。Its representation method is It (x, y) = [IR (x, y), IG (x, y), IB (x, y)], (x, y) represents the sampling point of the image, IR (x, y ), IG(x, y), and IB(x, y) respectively represent the values of red, green, and blue at the sampling point.

9.校正舌象照片白平衡9. Correct the white balance of the tongue image photo

将舌象照片中的白色校正为纯白色,其方法为:Correct the white in the tongue image photo to pure white, the method is:

It′(x,y)=[IR′(x,y),IG′(x,y),IB′(x,y)]It'(x,y)=[IR'(x,y), IG'(x,y), IB'(x,y)]

IRIR &prime;&prime; (( xx ,, ythe y )) == 255255 MaxMax (( IRIR )) ** IRIR (( xx ,, ythe y ))

IGIG ii &prime;&prime; (( xx ,, ythe y )) == 255255 MaxMax (( IGIG )) ** IGIG (( xx ,, ythe y ))

IBIB ii &prime;&prime; (( xx ,, ythe y )) == 255255 MaxMax (( IBIB )) ** IBIB (( xx ,, ythe y ))

其中,Max(IR),Max(IG)和Max(IB)表示在图像It(x,y)中,红色通道、绿色通道和蓝色通道的最大值。通过调整白平衡,我们得到调整后的舌象图片为It′(x,y)。Among them, Max(IR), Max(IG) and Max(IB) represent the maximum values of the red channel, green channel and blue channel in the image It(x, y). By adjusting the white balance, we get the adjusted tongue image as It′(x, y).

10.将在RGB空间表示Iti′(x,y)转入HSV(色调,饱和度,明度)空间表示10. Convert the representation It i '(x, y) in RGB space to HSV (hue, saturation, lightness) space representation

IHIH &prime;&prime; (( xx ,, ythe y )) == coscos -- 11 [[ (( IRIR &prime;&prime; (( xx ,, ythe y )) -- IGIG &prime;&prime; (( xx ,, ythe y )) )) ++ (( IRIR &prime;&prime; (( xx ,, ythe y )) -- IBIB &prime;&prime; (( xx ,, ythe y )) )) 22 (( IRIR &prime;&prime; (( xx ,, ythe y )) -- IGIG &prime;&prime; (( xx ,, ythe y )) )) 22 ++ (( IRIR &prime;&prime; (( xx ,, ythe y )) -- IBIB &prime;&prime; (( xx ,, ythe y )) )) (( IGIG &prime;&prime; (( xx ,, ythe y )) -- IBIB &prime;&prime; (( xx ,, ythe y )) )) ]]

ISIS &prime;&prime; (( xx ,, ythe y )) == MaxMax (( IRIR &prime;&prime; (( xx ,, ythe y )) ,, IGIG &prime;&prime; (( xx ,, ythe y )) ,, IBIB &prime;&prime; (( xx ,, ythe y )) )) -- MinMin (( IRIR &prime;&prime; (( xx ,, ythe y )) ,, IGIG &prime;&prime; (( xx ,, ythe y )) ,, IBIB &prime;&prime; (( xx ,, ythe y )) )) MaxMax (( IRIR &prime;&prime; (( xx ,, ythe y )) ,, IGIG &prime;&prime; (( xx ,, ythe y )) ,, IBIB &prime;&prime; (( xx ,, ythe y )) ))

IV′(x,y)=Max(IR′(x,y),IG′(x,y),IB′(x,y))IV'(x,y)=Max(IR'(x,y),IG'(x,y),IB'(x,y))

11.曝光不足的照片进行明度均衡11. Lightness equalization for underexposed photos

校正白平衡后的舌象,首先要分析明度直方图分布,如果峰值出现的位置小于事先确定的阈值,对舌象作标记,经过明度均衡,再进行下一步的调节。To correct the tongue image after white balance, first analyze the lightness histogram distribution, if the position of the peak value is smaller than the predetermined threshold, mark the tongue image, after lightness equalization, then proceed to the next step of adjustment.

统计图像的明度通道IV′(x,y)的直方图。明度通道的取值为0~255。统计明度通道的直方图HistV(t),t=0~255。A histogram of the Luminance channel IV'(x,y) of the statistical image. The value of the lightness channel is 0~255. The histogram HistV(t) of statistical brightness channel, t=0~255.

直方图的定义为HistV(t)=Num(IV′(x,y)=t),即直方图的第t个分量代表的意思为在明度图IV′(x,y)中,值为t的点的个数。求明度图的峰值PeakV=Max(HistV(t)),t=0~255,图5(a)表示为一个图像的直方图。横坐标为灰度值,取值从0到255,纵坐标为图像中灰度值等于横坐标灰度的像素点的个数。The histogram is defined as HistV(t)=Num(IV'(x, y)=t), that is, the tth component of the histogram means that in the lightness map IV'(x, y), the value is t The number of points of . Calculate the peak value PeakV=Max(HistV(t)) of the lightness map, t=0~255, and Fig. 5(a) is shown as a histogram of an image. The abscissa is the gray value, ranging from 0 to 255, and the ordinate is the number of pixels in the image whose gray value is equal to the gray value of the abscissa.

如果PeakV<thresholdV,则对图像IV′(x,y)作直方图均衡化。均衡化的公式表示为: IV &prime; ( x , y ) = &Sigma; k = 1 IV &prime; ( x , y ) HistV ( IV &prime; ( x , y ) ) , 表示的意思是,一个像素点(x,y)在均衡化之前的灰度是IV′(x,y),那么这一点在均衡化之后的明度值是直方图从灰度值1到灰度值IV′(x,y)的和。式子中的k表示明度值,图5(b)为改图通过直方图均衡变化后的直方图。If PeakV<thresholdV, perform histogram equalization on image IV'(x, y). The equalization formula is expressed as: IV &prime; ( x , the y ) = &Sigma; k = 1 IV &prime; ( x , the y ) HistV ( IV &prime; ( x , the y ) ) , It means that the gray level of a pixel (x, y) before equalization is IV'(x, y), then the brightness value of this point after equalization is the histogram from gray value 1 to gray Sum of values IV'(x,y). The k in the formula represents the lightness value, and Figure 5(b) is the histogram after the modified image has been changed through histogram equalization.

如果PeakV≥thresholdV,对IV′(x,y)不进行任何处理。If PeakV≥thresholdV, no processing is performed on IV'(x, y).

12.根据设定的参数h、s、v对HSV空间内的图像进行校正;12. Correct the image in the HSV space according to the set parameters h, s, v;

IHd(x,y)=IH′(x,y)-hIH d (x, y) = IH'(x, y)-h

ISd(x,y)=IS′(x,y)*sIS d (x, y) = IS'(x, y)*s

IVd(x,y)=IV′(x,y)-vIV d (x, y) = IV'(x, y) - v

13.将在HSV空间中的图像转化到RGB空间后再用gamma系数13. Convert the image in HSV space to RGB space and then use the gamma coefficient

将HSV转到RGB空间的程序为:The program to convert HSV to RGB space is:

设四个临时变量f,aa,bb,cc来帮助运算,其中Set four temporary variables f, aa, bb, cc to help the operation, where

f=IHd-floor(IHd),函数floor(IHd)的意思是取比IHd小的最大的整数,故f表示的是IHd的小数部分f=IH d -floor(IH d ), the function floor(IH d ) means to take the largest integer smaller than IH d , so f represents the fractional part of IH d

aa=IVd*(1-ISd)aa=IV d *(1-IS d )

bb=IVd*(1-(ISd*f))bb=IV d *(1-(IS d *f))

cc=IVd*(1-(ISd*(1-f)))cc=IV d *(1-(IS d *(1-f)))

根据IHd的范围可以确定出IRd,IGd,IBd的值The value of IR d , IG d , and IB d can be determined according to the range of IH d

IH d &Element; [ 0 ~ &pi; 6 ) , 则IRd=IVd,IGd=cc,IBd=aalike IH d &Element; [ 0 ~ &pi; 6 ) , Then IR d =IV d , IG d =cc, IB d =aa

IH d &Element; [ &pi; 6 ~ &pi; 3 ) , 则IRd=bb,IGd=IVd,IBd=aalike IH d &Element; [ &pi; 6 ~ &pi; 3 ) , Then IR d = bb, IG d = IV d , IB d = aa

IH d &Element; [ &pi; 3 ~ &pi; 2 ) , 则IRd=aa,IGd=IVd,IBd=cclike IH d &Element; [ &pi; 3 ~ &pi; 2 ) , Then IR d = aa, IG d = IV d , IB d = cc

IH d &Element; [ &pi; 2 ~ 2 &pi; 3 ) , 则IRd=aa,IGd=bb,IBd=IVd like IH d &Element; [ &pi; 2 ~ 2 &pi; 3 ) , Then IR d = aa, IG d = bb, IB d = IV d

IH d &Element; [ 2 &pi; 3 ~ 5 &pi; 6 ) , 则IRd=cc,IGd=aa,IBd=IVd like IH d &Element; [ 2 &pi; 3 ~ 5 &pi; 6 ) , Then IR d =cc, IG d =aa, IB d =IV d

IH d &Element; [ 5 &pi; 6 ~ 2 &pi; ) , 则IRd=IVd,IGd=aa,IBd=bblike IH d &Element; [ 5 &pi; 6 ~ 2 &pi; ) , Then IR d =IV d , IG d =aa, IB d =bb

在转入到RGB空间后,再用曲线校正值gamma值对RGB空间的图象进行调整。After transferring to the RGB space, adjust the image in the RGB space with the gamma value of the curve correction value.

IRd′(x,y)=IRd(x,y)gamma IR d '(x, y) = IR d (x, y) gamma

IGd′(x,y)=IGd(x,y)gamma IG d '(x, y) = IG d (x, y) gamma

IBd′(x,y)=IBd(x,y)gamma IB d '(x, y) = IB d (x, y) gamma

得到的调整后图像Itd(x,y)=[IRd′(x,y),IGd′(x,y),IBd′(x,y)]就是调整后的舌象照片。The obtained adjusted image It d (x, y)=[IR d ′(x, y), IG d ′(x, y), IB d ′(x, y)] is the adjusted tongue image photo.

Claims (1)

1.数字舌象色偏校正方法,其特征在于,依次含有以下步骤:1. The digital tongue image color shift correction method is characterized in that it contains the following steps in sequence: 步骤(1),在强制闪光条件下,用数码相机拍摄N张Macbeth色卡,N=10~15张,并把照片输入计算机;Step (1), under the forced flash condition, take N pieces of Macbeth color cards with a digital camera, N=10~15 pieces, and photo input computer; 步骤(2),计算机对N张Macbeth色卡照片校正白平衡:Step (2), the computer corrects the white balance of N Macbeth color card photos: 若:所述N张照片Macbeth色卡照片表示为f1(x,y),f2(x,y)…fN(x,y)If: the N photos of Macbeth color cards are expressed as f 1 (x, y), f 2 (x, y)...f N (x, y) 该照片中每一幅图像表示为:fi(x,y)=[Ri(x,y),Gi(x,y),Bi(x,y)],i=1…NEach image in the photo is expressed as: f i (x, y)=[R i (x, y), G i (x, y), B i (x, y)], i=1...N Ri(x,y),Gi(x,y),Bi(x,y)分别代表在采样点(x,y)的红色、绿色、蓝色的值;R i (x, y), G i (x, y), Bi ( x, y) respectively represent the red, green, and blue values at the sampling point (x, y); 则校正白平衡后各照片相应的图片表示为:Then the corresponding picture of each photo after correcting the white balance is expressed as: fi′=[Ri′(x,y),Gi′(x,y),Bi′(x,y)],f i '=[R i '(x, y), G i '(x, y), B i '(x, y)], RR ii &prime;&prime; (( xx ,, ythe y )) == 255255 MaxMax (( RR ii (( xx ,, ythe y )) )) ** RR ii (( xx ,, ythe y )) 其中, G i &prime; ( x , y ) = 255 Max ( G i ( x , y ) ) * G i ( x , y ) in, G i &prime; ( x , the y ) = 255 Max ( G i ( x , the y ) ) * G i ( x , the y ) BB ii &prime;&prime; (( xx ,, ythe y )) == 255255 MaxMax (( BB ii (( xx ,, ythe y )) )) ** BB ii (( xx ,, ythe y )) 其中,Max(Ri(x,y)),Max(Gi(x,y))和Max(Bi(x,y))分别表示在图像fi(x,y)中,红色通道、绿色通道和蓝色通道的最大值;Among them, Max(R i (x, y)), Max(G i (x, y)) and Max(B i (x, y)) respectively represent in the image f i (x, y), the red channel, the maximum value of the green and blue channels; 步骤(3),把将在RGB空间表示的fi′(x,y)和Macbeth色卡颜色转入HSV空间表示,HSV分别表示色调,饱和度和明度:Step (3), transfer f i '(x, y) and Macbeth color card colors expressed in RGB space into HSV space representation, and HSV represents hue, saturation and lightness respectively: 步骤(3.1),把fi′(x,y)=[Ri′(x,y),Gi′(x,y),Bi′(x,y)]转换到HSV空间:Step (3.1), convert f i ′(x, y)=[R i ′(x, y), G i ′(x, y), B i ′(x, y)] to HSV space: Hh ii &prime;&prime; (( xx ,, ythe y )) == coscos -- 11 [[ (( RR ii &prime;&prime; (( xx ,, ythe y )) -- GG ii &prime;&prime; (( xx ,, ythe y )) )) ++ (( RR ii &prime;&prime; (( xx ,, ythe y )) -- BB ii &prime;&prime; (( xx ,, ythe y )) )) 22 (( RR ii &prime;&prime; (( xx ,, ythe y )) -- GG ii &prime;&prime; (( xx ,, ythe y )) )) 22 ++ (( RR ii &prime;&prime; (( xx ,, ythe y )) -- BB ii &prime;&prime; (( xx ,, ythe y )) )) ** (( GG ii &prime;&prime; (( xx ,, ythe y )) -- BB ii &prime;&prime; (( xx ,, ythe y )) )) ]] SS ii &prime;&prime; (( xx ,, ythe y )) == MaxMax (( RR ii &prime;&prime; (( xx ,, ythe y )) ,, GG ii &prime;&prime; (( xx ,, ythe y )) ,, BB ii &prime;&prime; (( xx ,, ythe y )) )) -- MinMin (( RR ii &prime;&prime; (( xx ,, ythe y )) ,, GG ii &prime;&prime; (( xx ,, ythe y )) ,, BB ii &prime;&prime; (( xx ,, ythe y )) )) MaxMax (( RR ii &prime;&prime; (( xx ,, ythe y )) ,, GG ii &prime;&prime; (( xx ,, ythe y )) ,, BB ii &prime;&prime; (( xx ,, ythe y )) )) Vi′(x,y)=Max(Ri′(x,y),Gi′(x,y),Bi′(x,y))V i '(x, y) = Max(R i '(x, y), G i '(x, y), B i '(x, y)) 所述Hi′(x,y),Si′(x,y),Vi′(x,y)分别表示转换后第i幅图像在采样点(x,y)的色调、饱和度、明度三个通道的值,而Ri′(x,y),Gi′(x,y),Bi′(x,y)分别表示调整白平衡后第i幅图像在采样点(x,y)的红、绿、蓝三个通道的值,校正白平衡后图像的HSV通道表示为:The H i ′(x, y), S i ′(x, y), and V i ′(x, y) represent the hue, saturation, saturation, The values of the three channels of lightness, and R i ′(x, y), G i ′(x, y), and B i ′(x, y) respectively represent the i-th image at the sampling point (x, y) after adjusting the white balance. The values of the red, green and blue channels of y), the HSV channel of the image after correcting the white balance is expressed as: fi′(x,y)=[Hi′(x,y),Si′(x,y),Vi′(x,y)]f i '(x, y) = [H i '(x, y), S i '(x, y), V i '(x, y)] 步骤(3.2),把Macbeth色卡的标准值Mj转入HSV空间,Step (3.2), transfer the standard value Mj of the Macbeth color card into the HSV space, Mj=[MRj,MGj,MBj],j=1~24M j =[MR j , MG j , MB j ], j=1~24 MHMH jj == coscos -- 11 [[ (( MRMR jj -- MGMG jj )) ++ (( MRMR jj -- MBMB jj )) 22 (( MRMR jj -- MGMG jj )) 22 ++ (( MRMR jj -- MGMG jj )) (( MRMR jj -- MBMB jj )) ]] MS j = Max ( MR j , MG j , MB j ) - Min ( MR j , MG j , MB j ) Max ( MR j , MG j , MB j ) but MS j = Max ( MR j , MG j , MB j ) - Min ( MR j , MG j , MB j ) Max ( MR j , MG j , MB j ) MVj=Max(MRj,MGj,MBj)MV j = Max(MR j , MG j , MB j ) 其中,MRj,MGj,MBj分别表示色卡第j个色块的红、绿、蓝三个通道的值,Among them, MR j , MG j , and MB j respectively represent the values of the red, green and blue channels of the jth color block of the color card, MHj,MSj,MVj分别表示转换后第j个色块的色调、饱和度、明度三个通道的值;MH j , MS j , and MV j represent the values of the three channels of hue, saturation, and lightness of the jth color block after conversion; 得到:色卡标准值的HSV空间表达方式:Mj=[MHj,MSj,MVj],j=1~24;Obtained: the HSV space expression of the standard value of the color card: M j = [MH j , MS j , MV j ], j = 1~24; 步骤(4),按照以下步骤通过标准Macbeth色卡与色卡照片的值分别求出各调整参数:In step (4), according to the following steps, each adjustment parameter is obtained respectively through the values of the standard Macbeth color card and the color card photo: 步骤(4.1),求出调整白平衡后Macbeth色卡照片色调H通道的平均值,并把其与标准色卡平均色调作比较,得到色调调整参数h:Step (4.1), calculate the average value of the color tone H channel of the Macbeth color card photo after adjusting the white balance, and compare it with the average color tone of the standard color card to obtain the tone adjustment parameter h: N副Macbeth照片的色调平均值为 Hav = 1 N &Sigma; i = 1 N Hav i , Havi为调整白平衡后的第i个图像的色调H通道的平均值,The average color tone of N Macbeth photos is Hav = 1 N &Sigma; i = 1 N Hav i , Hav i is the average value of the hue H channel of the i-th image after adjusting the white balance, Macbeth色卡的标准色调平均值为 Hst = 1 24 &Sigma; j = 1 24 MH j , The standard hue average of the Macbeth color card is Hst = 1 twenty four &Sigma; j = 1 twenty four M H j , 色调调整参数为h=Hav-Hst;The hue adjustment parameter is h=Hav-Hst; 步骤(4.2),求出调整白平衡后Macbeth色卡照片明度V通道的平均值,并把其与标准色卡平均明度作比较,得到明度调整参数v:Step (4.2), calculate the average value of the lightness V channel of the Macbeth color card photo after adjusting the white balance, and compare it with the average lightness of the standard color card to obtain the lightness adjustment parameter v: N副Macbeth照片的明度平均值为 Vav = 1 N &Sigma; i = 1 N Vav i , Vavi为调整白平衡后的第i个图像的明度V通道的平均值,The average brightness of N Macbeth photos is Vav = 1 N &Sigma; i = 1 N Vav i , Vav i is the average value of the lightness V channel of the i-th image after adjusting the white balance, Macbeth色卡的标准明度平均值为 Vst = 1 24 &Sigma; j = 1 24 MV j , The standard lightness average of the Macbeth color card is Vst = 1 twenty four &Sigma; j = 1 twenty four MV j , 明度调整参数为v=Vav-Vst;Brightness adjustment parameter is v=Vav-Vst; 步骤(4.3),求调整白平衡后Macbeth色卡照片饱和度S通道的平均值,并把其与色卡标准值的饱和度做比较,通过拟合得到饱和度调整参数s:Step (4.3), find the average value of the saturation S channel of the Macbeth color card photo after adjusting the white balance, and compare it with the saturation of the standard value of the color card, and obtain the saturation adjustment parameter s by fitting: 在N张Macbeth色卡照片中,色块j的饱和度平均值为 Sav j = 1 N &Sigma; i = 1 N f S ij , 其中,fSij为第i幅照片中色块j的饱和度,i=1~N,j=1~24,In the N Macbeth color card photos, the average saturation of color patch j is Sav j = 1 N &Sigma; i = 1 N f S ij , Among them, fS ij is the saturation of color block j in the i-th photo, i=1~N, j=1~24, 色卡中各色块的标准饱和度为MS1,MS2…MS24The standard saturation of each color block in the color card is MS 1 , MS 2 ... MS 24 , 饱和度调整参数s为: s = &Sigma; j = 1 24 Sav j * MS j &Sigma; j = 1 24 Sav j 2 ; The saturation adjustment parameter s is: the s = &Sigma; j = 1 twenty four Sav j * MS j &Sigma; j = 1 twenty four Sav j 2 ; 步骤(5),求出曲线校正值gamma:Step (5), calculate the curve correction value gamma: 在N张Macbeth色卡照片中,色块j的明度值为 Vav j = 1 N &Sigma; i = 1 N f V ij , 其中,fVij为第i幅照片中色块j的明度,i=1~N,j=1~24,In the N Macbeth color card photos, the lightness value of the color block j is Vav j = 1 N &Sigma; i = 1 N f V ij , Among them, fV ij is the lightness of the color block j in the i-th photo, i=1~N, j=1~24, 色卡中各色块的标准明度为Vav1,Vav2…Vav24The standard lightness of each color block in the color card is Vav 1 , Vav 2 ...Vav 24 , 曲线校正值gamma为: &Sigma; j = 1 24 ln ( Vav j ) * ln ( MV j ) &Sigma; j = 1 24 ln ( Vav j ) 2 ; The curve correction value gamma is: &Sigma; j = 1 twenty four ln ( Vav j ) * ln ( MV j ) &Sigma; j = 1 twenty four ln ( Vav j ) 2 ; 步骤(6),用数码相机拍摄舌头照片,得到图像It(x,y)=[IR(x,y),IG(x,y),IB(x,y)],其中,IR(x,y),IG(x,y),IB(x,y)分别代表在该图像采样点(x,y)红色、绿色、蓝色的值;步骤(7),校正舌象照片It(x,y)中的白色为纯白色,得到校正后的舌象照片为It′(x,y):Step (6), take a picture of the tongue with a digital camera to obtain an image It (x, y)=[IR (x, y), IG (x, y), IB (x, y)], wherein, IR (x, y) y), IG(x, y), and IB(x, y) respectively represent the values of red, green, and blue at the image sampling point (x, y); step (7), correct the tongue image photo It(x, The white in y) is pure white, and the corrected tongue picture is It′(x, y): It′(x,y)=[IR′(x,y),IG′(x,y),IB′(x,y)]It'(x,y)=[IR'(x,y), IG'(x,y), IB'(x,y)] IRIR &prime;&prime; (( xx ,, ythe y )) == 255255 MaxMax (( IRIR (( xx ,, ythe y )) )) ** IRIR (( xx ,, ythe y )) II GG ii &prime;&prime; (( xx ,, ythe y )) == 255255 MaxMax (( IGIG (( xx ,, ythe y )) )) ** IGIG (( xx ,, ythe y )) II BB ii &prime;&prime; (( xx ,, ythe y )) == 255255 MaxMax (( IBIB (( xx ,, ythe y )) )) ** IBIB (( xx ,, ythe y )) 其中,Max(IR(x,y)),Max(IG(x,y))和Max(IB(x,y))分别表示在图像It(x,y)中,红色通道、绿色通道和蓝色通道的最大值;Among them, Max(IR(x, y)), Max(IG(x, y)) and Max(IB(x, y)) respectively represent the red channel, green channel and blue channel in the image It(x, y). The maximum value of the color channel; 步骤(8),将在RGB空间表示的舌象图片转换到用色调H,饱和度S,明度V空间表示Step (8), the tongue image picture represented in RGB space is converted to use hue H, saturation S, lightness V space representation II Hh &prime;&prime; (( xx ,, ythe y )) == coscos -- 11 [[ (( IRIR &prime;&prime; (( xx ,, ythe y )) -- IGIG &prime;&prime; (( xx ,, ythe y )) )) ++ (( IRIR &prime;&prime; (( xx ,, ythe y )) -- IBIB &prime;&prime; (( xx ,, ythe y )) )) 22 (( IRIR &prime;&prime; (( xx ,, ythe y )) -- IGIG &prime;&prime; (( xx ,, ythe y )) )) 22 ++ (( IRIR &prime;&prime; (( xx ,, ythe y )) -- IBIB &prime;&prime; (( xx ,, ythe y )) )) ** (( II GG &prime;&prime; (( xx ,, ythe y )) -- IBIB &prime;&prime; (( xx ,, ythe y )) )) ]] II SS &prime;&prime; (( xx ,, ythe y )) == MaxMax (( II RR &prime;&prime; (( xx ,, ythe y )) ,, IGIG &prime;&prime; (( xx ,, ythe y )) ,, IBIB &prime;&prime; (( xx ,, ythe y )) )) -- MinMin (( IRIR &prime;&prime; (( xx ,, ythe y )) ,, II GG &prime;&prime; (( xx ,, ythe y )) ,, II BB &prime;&prime; (( xx ,, ythe y )) )) MaxMax (( IRIR &prime;&prime; (( xx ,, ythe y )) ,, II GG &prime;&prime; (( xx ,, ythe y )) ,, II BB &prime;&prime; (( xx ,, ythe y )) )) IV′(x,y)=Max(IR′(x,y),IG′(x,y),IB′(x,y));IV'(x,y)=Max(IR'(x,y), IG'(x,y), IB'(x,y)); 步骤(9),判断在校正白平衡后,舌象图片曝光是否过度,对曝光不足的图片要进行明度均衡:Step (9), after correcting the white balance, determine whether the tongue picture is overexposed, and perform brightness balance on the underexposed picture: 步骤(9.1),对所述的照片做明度直方图分布:Step (9.1), the brightness histogram distribution is done to the photo: 直方图HistV(t)=Num(IV′(x,y)=t),t=0~255,表示在直方图中,第t个分量代表的意思为在明度图IV′(x,y)中值为t的点的个数;Histogram HistV(t)=Num(IV'(x, y)=t), t=0~255, which means that in the histogram, the tth component means that in the brightness map IV'(x, y) The number of points whose median value is t; 步骤(9.2),求明度图的峰值PeakV:Step (9.2), find the peak value PeakV of the lightness map: PeakV=Max(HistV(t)),t=0~255;PeakV=Max(HistV(t)), t=0~255; 步骤(9.3),判断是否PeakV<thresholdVStep (9.3), judge whether PeakV<thresholdV 其中,thresholdV为设定值取值100,若PeakV≥thresholdV,则对IV′(x,y)不处理,否则,进入下一个步骤;Wherein, thresholdV is the setting value of 100, if PeakV≥thresholdV, then do not process IV'(x, y), otherwise, enter the next step; 步骤(9.4),对图像IV′(x,y)作直方图均衡化,得到 IV &prime; ( x , y ) = &Sigma; k = 1 IV &prime; ( x , y ) HistV ( IV &prime; ( x , y ) ) , k表示明度值的计数器;Step (9.4), perform histogram equalization on the image IV'(x, y), and obtain IV &prime; ( x , the y ) = &Sigma; k = 1 IV &prime; ( x , the y ) HistV ( IV &prime; ( x , the y ) ) , k represents the counter of the lightness value; 步骤(10),根据步骤(4)设定的调整参数h、s、v对HSV空间内的图像进行校正:Step (10), the image in the HSV space is corrected according to the adjustment parameters h, s, v set in step (4): IHd(x,y)=IH′(x,y)-hIH d (x, y) = IH'(x, y)-h ISd(x,y)=IS′(x,y)*s;IS d (x, y) = IS'(x, y)*s; IVd(x,y)=IV′(x,y)-vIV d (x, y) = IV'(x, y) - v 步骤(11),将HSV空间内的图像转化到RGB空间内:Step (11), convert the image in the HSV space into the RGB space: 步骤(11.1),设定四个临时变量f,aa,bb,cc帮助转化:Step (11.1), set four temporary variables f, aa, bb, cc to help transform: 其中,f=IHd-floor(IHd),函数floor(IHd)的意思是取比IHd小的最大的整数,故f表示的是IHd的小数部分,Wherein, f=IH d -floor(IH d ), the meaning of function floor(IH d ) is to get the largest integer smaller than IH d , so what f represents is the fractional part of IH d , aa=IVd*(1-ISd)aa=IV d *(1-IS d ) bb=IVd*(1-(ISd*f))bb=IV d *(1-(IS d *f)) cc=IVd*(1-(ISd*(1-f)))cc=IV d *(1-(IS d *(1-f))) 步骤(11.2),根据IHd的范围确定IRd,IGd,IBd的值:Step (11.2), determine the value of IR d , IG d , IB d according to the range of IH d : IH d &Element; [ 0 ~ &pi; 6 ) , 则IRd=IVd,IGd=cc,IBd=aalike IH d &Element; [ 0 ~ &pi; 6 ) , Then IR d =IV d , IG d =cc, IB d =aa IH d &Element; [ &pi; 6 ~ &pi; 3 ) , 则IRd=bb,IGd=IVd,IBd=aalike IH d &Element; [ &pi; 6 ~ &pi; 3 ) , Then IR d =bb, IG d =IVd, IB d =aa IH d &Element; [ &pi; 3 ~ &pi; 2 ) , 则IRd=aa,IGd=IVd,IBd=cclike IH d &Element; [ &pi; 3 ~ &pi; 2 ) , Then IR d =aa, IG d =IVd, IB d =cc IH d &Element; [ &pi; 2 ~ 2 &pi; 3 ) , 则IRd=aa,IGd=bb,IBd=IVd like IH d &Element; [ &pi; 2 ~ 2 &pi; 3 ) , Then IR d = aa, IG d = bb, IB d = IV d IH d &Element; [ 2 &pi; 3 ~ 5 &pi; 6 ) , 则IRd=cc,IGd=aa,IBd=IVd like IH d &Element; [ 2 &pi; 3 ~ 5 &pi; 6 ) , Then IR d =cc, IG d =aa, IB d =IV d IH d &Element; [ 5 &pi; 6 ~ 2 &pi; ) , 则IRd=IVd,IGd=aa,IBd=bblike IH d &Element; [ 5 &pi; 6 ~ 2 &pi; ) , Then IR d =IV d , IG d =aa, IB d =bb 步骤(12),用曲线校正值gamma对图像进行调整:Step (12), adjust the image with the curve correction value gamma: IRd′(x,y)=IRd(x,y)gamma IR d '(x, y) = IR d (x, y) gamma IGd′(x,y)=IGd(x,y)gamma IG d '(x, y) = IG d (x, y) gamma IBd′(x,y)=IBd(x,y)gamma IB d '(x, y) = IB d (x, y) gamma 得到的调整后图像Itd(x,y)=[IRd′(x,y),IGd′(x,y),IBd′(x,y)]就是调整后的舌象照片。The obtained adjusted image It d (x, y)=[IR d ′(x, y), IG d ′(x, y), IB d ′(x, y)] is the adjusted tongue image photo.
CNB2006101138705A 2006-10-20 2006-10-20 Digital Tongue Image Color Shift Correction Method Expired - Fee Related CN100412906C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006101138705A CN100412906C (en) 2006-10-20 2006-10-20 Digital Tongue Image Color Shift Correction Method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006101138705A CN100412906C (en) 2006-10-20 2006-10-20 Digital Tongue Image Color Shift Correction Method

Publications (2)

Publication Number Publication Date
CN1945627A true CN1945627A (en) 2007-04-11
CN100412906C CN100412906C (en) 2008-08-20

Family

ID=38045022

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006101138705A Expired - Fee Related CN100412906C (en) 2006-10-20 2006-10-20 Digital Tongue Image Color Shift Correction Method

Country Status (1)

Country Link
CN (1) CN100412906C (en)

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101947101A (en) * 2010-07-15 2011-01-19 哈尔滨工业大学 Method for making tongue colour reproduction colour card
CN102419861A (en) * 2010-09-27 2012-04-18 上海中医药大学 Color Image Correction Method Based on Topological Partition of Uniform Color Space
CN101615385B (en) * 2008-06-23 2012-05-30 索尼株式会社 Image display apparatus and image display apparatus assembly and driving method thereof
CN102693671A (en) * 2011-03-23 2012-09-26 长庚医疗财团法人林口长庚纪念医院 Tongue picture classification card and manufacturing method thereof
CN103106669A (en) * 2013-01-02 2013-05-15 北京工业大学 Tongue image environment adaptive color reproduction method of traditional Chinese medicine
CN103248793A (en) * 2013-05-14 2013-08-14 旭曜科技股份有限公司 Skin color optimization method and device for color gamut conversion system
CN103308517A (en) * 2013-05-21 2013-09-18 谢绍鹏 Traditional Chinese medicine color objectification method and traditional Chinese medicine image acquisition device
CN103957396A (en) * 2014-05-14 2014-07-30 姚杰 Image processing method and device used when tongue diagnosis is conducted with intelligent device and equipment
CN104297469A (en) * 2013-07-15 2015-01-21 艾博生物医药(杭州)有限公司 Immune reading device and calibration method of the same
CN104412299A (en) * 2012-06-28 2015-03-11 夏普株式会社 Image processing device and recording medium
CN104572538A (en) * 2014-12-31 2015-04-29 北京工业大学 K-PLS regression model based traditional Chinese medicine tongue image color correction method
CN104700363A (en) * 2013-12-06 2015-06-10 富士通株式会社 Removal method and device of reflecting areas in tongue image
CN106127675A (en) * 2016-06-20 2016-11-16 深圳市中识创新科技有限公司 Colour consistency method and apparatus
CN107689031A (en) * 2016-08-03 2018-02-13 天津慧医谷科技有限公司 Color restoration method based on illumination compensation in tongue picture analysis
CN107833620A (en) * 2017-11-28 2018-03-23 北京羽医甘蓝信息技术有限公司 Image processing method and image processing apparatus
CN108320272A (en) * 2018-02-05 2018-07-24 电子科技大学 The method that image delusters
CN108742519A (en) * 2018-04-02 2018-11-06 上海中医药大学附属岳阳中西医结合医院 Machine vision three-dimensional reconstruction technique skin ulcer surface of a wound intelligent auxiliary diagnosis system
CN109815860A (en) * 2019-01-10 2019-05-28 中国科学院苏州生物医学工程技术研究所 TCM tongue diagnosis image color correction method, electronic equipment, storage medium
CN110009588A (en) * 2019-04-09 2019-07-12 成都品果科技有限公司 A kind of portrait image color enhancement method and device
WO2020103570A1 (en) * 2018-11-19 2020-05-28 Oppo广东移动通信有限公司 Image color correction method, device, storage medium and mobile terminal
CN114073494A (en) * 2020-08-19 2022-02-22 京东方科技集团股份有限公司 White blood cell detection method, system, electronic device and computer readable medium
CN116509326A (en) * 2023-04-11 2023-08-01 广东健齿生物科技有限公司 Tongue image multispectral image generation method, device, equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050270383A1 (en) * 2004-06-02 2005-12-08 Aiptek International Inc. Method for detecting and processing dominant color with automatic white balance
GB0504520D0 (en) * 2005-03-04 2005-04-13 Chrometrics Ltd Reflectance spectra estimation and colour space conversion using reference reflectance spectra

Cited By (32)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101615385B (en) * 2008-06-23 2012-05-30 索尼株式会社 Image display apparatus and image display apparatus assembly and driving method thereof
CN101947101A (en) * 2010-07-15 2011-01-19 哈尔滨工业大学 Method for making tongue colour reproduction colour card
CN102419861A (en) * 2010-09-27 2012-04-18 上海中医药大学 Color Image Correction Method Based on Topological Partition of Uniform Color Space
CN102693671A (en) * 2011-03-23 2012-09-26 长庚医疗财团法人林口长庚纪念医院 Tongue picture classification card and manufacturing method thereof
CN102693671B (en) * 2011-03-23 2014-03-26 长庚医疗财团法人林口长庚纪念医院 A method of making a tongue image classification card
CN104412299A (en) * 2012-06-28 2015-03-11 夏普株式会社 Image processing device and recording medium
CN103106669A (en) * 2013-01-02 2013-05-15 北京工业大学 Tongue image environment adaptive color reproduction method of traditional Chinese medicine
CN103106669B (en) * 2013-01-02 2015-10-28 北京工业大学 Chinese medicine tongue picture is as environmental suitability color reproduction method
CN103248793A (en) * 2013-05-14 2013-08-14 旭曜科技股份有限公司 Skin color optimization method and device for color gamut conversion system
CN103248793B (en) * 2013-05-14 2016-08-10 旭曜科技股份有限公司 Skin color optimization method and device for color gamut conversion system
CN103308517A (en) * 2013-05-21 2013-09-18 谢绍鹏 Traditional Chinese medicine color objectification method and traditional Chinese medicine image acquisition device
CN103308517B (en) * 2013-05-21 2015-09-30 谢绍鹏 Chinese medicine color objectifies method and Chinese medicine image acquiring device
CN104297469A (en) * 2013-07-15 2015-01-21 艾博生物医药(杭州)有限公司 Immune reading device and calibration method of the same
CN104297469B (en) * 2013-07-15 2017-02-08 艾博生物医药(杭州)有限公司 Immune reading device and calibration method of the same
CN104700363A (en) * 2013-12-06 2015-06-10 富士通株式会社 Removal method and device of reflecting areas in tongue image
CN103957396A (en) * 2014-05-14 2014-07-30 姚杰 Image processing method and device used when tongue diagnosis is conducted with intelligent device and equipment
CN104572538B (en) * 2014-12-31 2017-08-25 北京工业大学 A kind of Chinese medicine tongue image color correction method based on K PLS regression models
CN104572538A (en) * 2014-12-31 2015-04-29 北京工业大学 K-PLS regression model based traditional Chinese medicine tongue image color correction method
CN106127675A (en) * 2016-06-20 2016-11-16 深圳市中识创新科技有限公司 Colour consistency method and apparatus
CN106127675B (en) * 2016-06-20 2019-05-24 深圳市利众信息科技有限公司 Colour consistency method and apparatus
CN107689031B (en) * 2016-08-03 2021-05-28 天津慧医谷科技有限公司 Color restoration method based on illumination compensation in tongue picture analysis
CN107689031A (en) * 2016-08-03 2018-02-13 天津慧医谷科技有限公司 Color restoration method based on illumination compensation in tongue picture analysis
CN107833620A (en) * 2017-11-28 2018-03-23 北京羽医甘蓝信息技术有限公司 Image processing method and image processing apparatus
CN108320272A (en) * 2018-02-05 2018-07-24 电子科技大学 The method that image delusters
CN108742519A (en) * 2018-04-02 2018-11-06 上海中医药大学附属岳阳中西医结合医院 Machine vision three-dimensional reconstruction technique skin ulcer surface of a wound intelligent auxiliary diagnosis system
WO2020103570A1 (en) * 2018-11-19 2020-05-28 Oppo广东移动通信有限公司 Image color correction method, device, storage medium and mobile terminal
CN109815860A (en) * 2019-01-10 2019-05-28 中国科学院苏州生物医学工程技术研究所 TCM tongue diagnosis image color correction method, electronic equipment, storage medium
CN110009588A (en) * 2019-04-09 2019-07-12 成都品果科技有限公司 A kind of portrait image color enhancement method and device
CN110009588B (en) * 2019-04-09 2022-12-27 成都品果科技有限公司 Portrait image color enhancement method and device
CN114073494A (en) * 2020-08-19 2022-02-22 京东方科技集团股份有限公司 White blood cell detection method, system, electronic device and computer readable medium
WO2022037328A1 (en) * 2020-08-19 2022-02-24 京东方科技集团股份有限公司 White blood cell detection method and system, electronic device, and computer readable medium
CN116509326A (en) * 2023-04-11 2023-08-01 广东健齿生物科技有限公司 Tongue image multispectral image generation method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN100412906C (en) 2008-08-20

Similar Documents

Publication Publication Date Title
CN1945627A (en) Method for correcting digital tongue picture colour cast
CN100341045C (en) Image display device, image processing method, program and storage medium
CN1941843A (en) Image processing apparatus and an image processing program
CN1717006A (en) Be used for improving the equipment and the method for picture quality at imageing sensor
CN1314266C (en) Image pickup apparatus
CN1909671A (en) Method and apparatus for generating user preference data
CN101032159A (en) Image processing device, method, and image processing program
CN1595958A (en) Image quality correction apparatus and image quality correction method
CN1822660A (en) Image processing system, projector and image processing method
CN1832583A (en) Equipment, medium and method possessing white balance control
CN1662071A (en) Image data processing in color spaces
CN1535003A (en) Image processing system, projector and image processing method
CN1892756A (en) Projection image position adjustment method
CN1625763A (en) Display apparatus
CN1662932A (en) Method and system for adaptively transforming visual content according to end user&#39;s color vision characteristics
CN1430420A (en) Device and method for controlling image brightness
CN1835565A (en) Image capturing apparatus, image sensor, and image processing method
CN101061704A (en) Color adjusting device and method
CN1867080A (en) Image process apparatus and image pickup apparatus
CN101035190A (en) Apparatus, method, and program product for color correction
CN100342709C (en) Image recording apparatus, image recording method, image processing apparatus, image processing method and image processing system
CN1857008A (en) Image processing method
CN1960431A (en) Image processing device, image processing method, program for the same, and memory medium for storing the program
CN1754189A (en) Image processing device, method, and program
CN100345160C (en) Histogram equalizing method for controlling average brightness

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20080820

Termination date: 20091120