CN110689586B - Tongue image identification method in traditional Chinese medicine intelligent tongue diagnosis and portable correction color card used for same - Google Patents
Tongue image identification method in traditional Chinese medicine intelligent tongue diagnosis and portable correction color card used for same Download PDFInfo
- Publication number
- CN110689586B CN110689586B CN201810741280.XA CN201810741280A CN110689586B CN 110689586 B CN110689586 B CN 110689586B CN 201810741280 A CN201810741280 A CN 201810741280A CN 110689586 B CN110689586 B CN 110689586B
- Authority
- CN
- China
- Prior art keywords
- color
- color card
- card
- tongue
- area
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G16—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
- G16H—HEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
- G16H50/00—ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics
- G16H50/20—ICT specially adapted for medical diagnosis, medical simulation or medical data mining; ICT specially adapted for detecting, monitoring or modelling epidemics or pandemics for computer-aided diagnosis, e.g. based on medical expert systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
Landscapes
- Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Biomedical Technology (AREA)
- Public Health (AREA)
- Epidemiology (AREA)
- Pathology (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- General Health & Medical Sciences (AREA)
- Primary Health Care (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
本发明提供一种在中医智能舌诊中使用的、可识别便携式舌像颜色校正色卡及其识别方法,用于解决传统舌像校正色卡不便随身携带、不易被计算机识别等缺陷。考虑便捷性,色卡尺寸较小,易于携带。但过小的尺寸不利于计算机的自动识别。本发明通过在色卡的特定位置中加入特殊的几何图案,并将其按照特定的尺寸和几何位置加入色卡区域,配套特定经过改进的计算机识别算法,实现了计算机对色卡的自动识别、定位、取色,并获得了高识别率。本发明消除了颜色校正中对色卡进行人工标定的繁琐工序,提高了颜色校正处理的效率。本发明还为低像素下中医智能舌诊标识符识别率低、色卡透视形变等因素引起的误差提供了解决方案,得到了好的效果。
The invention provides an identifiable portable tongue image color correction color card and its identification method used in intelligent tongue diagnosis in traditional Chinese medicine, which is used to solve the defects of the traditional tongue image correction color card being inconvenient to carry around and difficult to be recognized by a computer. Considering convenience, the color card is small in size and easy to carry. But too small size is not conducive to the automatic recognition of the computer. In the present invention, by adding a special geometric pattern in a specific position of the color card, and adding it to the color card area according to a specific size and geometric position, and supporting a specific and improved computer recognition algorithm, the automatic recognition of the color card by the computer is realized. Positioning, color picking, and achieved a high recognition rate. The invention eliminates the cumbersome process of manual calibration of color cards in color correction, and improves the efficiency of color correction processing. The invention also provides a solution to the errors caused by factors such as low identification rate of the intelligent tongue diagnosis of traditional Chinese medicine under low pixels, perspective deformation of the color card, etc., and obtains good results.
Description
技术领域technical field
本发明提供一种可识别便携式舌像颜色校正色卡及其识别方法。The invention provides an identifiable portable tongue image color correction color card and an identification method thereof.
背景技术Background technique
传统的中医舌像诊断方式需要医生直接对患者舌部的情况进行观察并得出结论,这种方式需要患者和医生面对面进行,缺乏便捷性和推广性。近年来,随着网络通信尤其是智能手机的普及,利用手机进行舌像智能采集和诊断逐渐成为一种新型的趋势,可以很好地弥补传统方式推广性、便捷性较差的缺陷。但利用手机进行舌像采集和诊断,容易受到外界因素的干扰,对舌像拍摄的光线、角度、清晰度等要求较高,尤其是彩色摄影中的色彩还原问题,这些技术难点成为手机舌像采集发展亟待解决的问题。The traditional TCM tongue image diagnosis method requires the doctor to directly observe the condition of the patient's tongue and draw a conclusion. This method requires the patient and the doctor face-to-face, which lacks convenience and promotion. In recent years, with the popularization of network communication, especially smart phones, the use of mobile phones for intelligent collection and diagnosis of tongue images has gradually become a new trend, which can well make up for the shortcomings of traditional methods that are poor in promotion and convenience. However, the use of mobile phones to collect and diagnose tongue images is susceptible to interference from external factors, and has high requirements for the light, angle, and definition of tongue images, especially the color restoration problem in color photography. These technical difficulties have become mobile phone tongue images. Acquisition development is an urgent problem to be solved.
利用颜色色卡进行颜色校正是目前较为常用的方法之一,该方法根据色卡的颜色变化情况进行分析和拟合,从而间接推断出舌色的颜色变化,并最终实现舌色的标准化处理。但是现有的舌色校正研究中使用的色卡通常体积较大,最小的也有一本图书的大小,不利于随身携带,在中医舌像智能采集中还缺乏有效的解决方案。另外,现有的颜色校正中使用的色卡缺乏自动定位的功能,在实际应用中往往需要利用人工对色卡进行识别和定位。这样的方式需要较高的人工成本,并需要一定的操作和处理时间,会对舌像采集标准化处理的效率和准确性造成较大的影响。Using the color card for color correction is one of the more commonly used methods at present. This method analyzes and fits the color change of the color card, thereby inferring the color change of the tongue color indirectly, and finally realizes the standardized processing of the tongue color. However, the color cards used in the existing tongue color correction research are usually large in size, and the smallest one is the size of a book, which is not conducive to carrying around. There is still a lack of effective solutions in the intelligent collection of tongue images in traditional Chinese medicine. In addition, the color cards used in the existing color correction lack the function of automatic positioning, and in practical applications, it is often necessary to manually identify and position the color cards. Such a method requires high labor costs, and requires a certain amount of time for operation and processing, which will have a great impact on the efficiency and accuracy of the standardized processing of tongue image acquisition.
另外,对于中医舌像智能采集中的舌像颜色识别,现有技术中缺乏实际有效的方案。In addition, there is no practical and effective solution in the prior art for tongue image color recognition in the intelligent collection of tongue images in traditional Chinese medicine.
发明内容Contents of the invention
本发明提供一种可识别便携式舌像颜色校正色卡及其识别方法。The invention provides an identifiable portable tongue image color correction color card and an identification method thereof.
附图说明Description of drawings
图1是根据本发明的一个实施例的舌像颜色校正色卡识别方法的流程图。Fig. 1 is a flowchart of a tongue image color correction color card identification method according to an embodiment of the present invention.
图2是根据本发明的一个实施例的舌像颜色校正色卡。Fig. 2 is a tongue image color correction color card according to an embodiment of the present invention.
图3用于说明根据本发明的一个实施例的色卡位置识别符的识别。Fig. 3 is used to illustrate the identification of the color card position identifier according to an embodiment of the present invention.
图4用于表示矩形经过透视形变后的形状变化。Figure 4 is used to show the shape change of the rectangle after perspective deformation.
图5显示了识别成功和失败的采样点变化图。Fig. 5 shows the change graph of sampling points for recognition success and failure.
具体实施方式detailed description
针对现有技术的上述问题,本发明人提出一种具有自动定位功能的便携式颜色校正色卡及其识别方法。本发明的目的包括2个,一是利用特殊的色卡设计和自动识别方法,利用机器完成以往通常由人工完成的色卡识别的定位工作,从而提高颜色校正流程的工作效率和规范性,为大规模的舌图像色彩校正或其他场景下的颜色校正提供便利。为该目的,本发明提供了一种基于位置识别符的色卡定位方法,通过在色卡顶点设置特殊形状的图案,利用图像识别算法对符号进行识别定位,进而通过几何关系推断出所有色块所在的位置并计算出对应的颜色值。二是对传统的色卡的形状、大小、布局等进行改进,从而使色卡能够在实际使用中达到便于携带、便于使用的效果。In view of the above-mentioned problems in the prior art, the inventor proposes a portable color correction color card with automatic positioning function and its identification method. The purpose of the present invention includes two, one is to utilize the special color card design and automatic identification method, utilize the machine to complete the positioning work of the color card identification that is usually done manually in the past, thereby improve the working efficiency and standardization of the color correction process, for It is convenient for large-scale tongue image color correction or color correction in other scenes. For this purpose, the present invention provides a color card positioning method based on a position identifier, by setting a pattern of a special shape at the apex of the color card, using an image recognition algorithm to identify and position the symbol, and then inferring all the color blocks through the geometric relationship The location and calculate the corresponding color value. The second is to improve the shape, size, and layout of traditional color cards, so that the color cards can be carried and used in actual use.
如图1,上述色卡识别及颜色校正流程包括:As shown in Figure 1, the above-mentioned color card identification and color correction process includes:
步骤一:设置色卡特殊位置识别符。在色卡的四个顶点分别设计不同的特殊识别符。其中三个顶点采用一种符号,而最后一个顶点采用另一种符号,两种符号具有不同的几何特征。根据本发明的一个具体实施例,在设置了位置识别符后,在四个符号构成的矩形区域内填充色块。Step 1: Set the special position identifier of the color card. Design different special identifiers on the four vertices of the color card. Three of the vertices use one symbol, while the last vertex uses another symbol, and the two symbols have different geometric characteristics. According to a specific embodiment of the present invention, after the location identifier is set, a color block is filled in a rectangular area formed by four symbols.
步骤二:利用色卡进行图像获取。将色卡和物体摆放在同一场景中同一光线条件的区域中进行拍摄,得到同时包含目标物体和色卡的图像。Step 2: Use the color card for image acquisition. Place the color card and the object in the same scene in the same light condition area to shoot, and get an image that contains both the target object and the color card.
步骤三:对图像进行搜索,利用所述符号的几何特征,搜索出4个符号的位置。由于拍摄角度等问题,矩形的色卡可能会因为透视效果被扭曲为任意四边形,所以需要利用四个顶点的几何关系对坐标进行校正,将区域还原为矩形。Step 3: Search the image, and use the geometric features of the symbols to search out the positions of the four symbols. Due to problems such as shooting angles, the rectangular color card may be distorted into an arbitrary quadrilateral due to the perspective effect, so it is necessary to use the geometric relationship of the four vertices to correct the coordinates and restore the area to a rectangle.
步骤四:利用色块和色卡预先设计的集合关系,对色块区域进行计算定位,找到色块中心点。利用中心点对图像进行搜索,找到色块的边界,从而确定整个色块的位置。最终计算出整个色块的颜色。根据一个具体实施例,利用区域生长法找到色块的边界。Step 4: Use the pre-designed set relationship between the color block and the color card to calculate and locate the color block area, and find the center point of the color block. Use the center point to search the image to find the boundary of the color block, so as to determine the position of the entire color block. Finally, the color of the entire color block is calculated. According to a specific embodiment, the region growing method is used to find the boundary of the color block.
步骤五:根据取色结果,利用标准环境下的色块色彩信息进行线性拟合校正,根据拟合优度来进行识别结果的自动判断,在拟合优度达到和/或超过一定的预设阈值时,则判定识别成功。Step 5: According to the color selection result, use the color information of the color block in the standard environment to perform linear fitting correction, and automatically judge the recognition result according to the goodness of fit. When the goodness of fit reaches and/or exceeds a certain preset When the threshold is reached, it is judged that the recognition is successful.
最后,在完成上述所有步骤后,可以利用颜色校正算法对图像进行颜色校正并最终得到颜色标准化的舌像。Finally, after completing all the above steps, the color correction algorithm can be used to correct the color of the image and finally obtain a color-standardized tongue image.
下面结合附图对本发明的实施例作进一步说明。Embodiments of the present invention will be further described below in conjunction with the accompanying drawings.
色卡设计:Color card design:
图2为根据本发明的一个实施例的支持自动定位的便携式舌像颜色校正色卡。该色卡包括两个区域:手持区域和色卡区域。Fig. 2 is a portable tongue image color correction color card supporting automatic positioning according to an embodiment of the present invention. The color card includes two areas: the handheld area and the color card area.
手持区域设置在色卡的一侧,保证在单手持握时有充足的空间,保证了使用的便捷性,也为了充分避免手遮挡色卡和/或在色卡区域产生阴影,影响颜色校正的效果。The hand-held area is set on one side of the color card to ensure sufficient space when holding it with one hand, ensuring the convenience of use, and also to fully avoid the hand covering the color card and/or producing shadows in the color card area, which will affect the color correction. Effect.
根据本发明的一个具体实施例,色卡区域是一个矩形,包含3个部分,分别是位置标识符区、附加信息识别区、色卡色块区。According to a specific embodiment of the present invention, the color card area is a rectangle, including three parts, which are respectively a position identifier area, an additional information identification area, and a color block area of the color card.
根据一个具体实施例,位置标识符区分布在色卡区域的四个顶点,它们具有特殊的几何特征。根据一个具体实施例,依据几何特征的不同,识别符包括第一识别符和第二识别符。According to a specific embodiment, the location identifier area is distributed on four vertices of the color card area, and they have special geometric features. According to a specific embodiment, according to different geometric features, the identifier includes a first identifier and a second identifier.
根据本发明的一个具体实施例。其中1类识别符包括边长比为7:5:3的三个矩形,且第一类识别符共有3个,且分别位于色卡区域的四个顶点中的三个(诸如左上、右上、左下顶点)。第二识别符包括边长比为5:3:1的三个矩形,并设置在色卡区域的四个顶点中的第四个顶点处(诸如,设置在色卡区域的右下角)。According to a specific embodiment of the present invention. Type 1 identifiers include three rectangles with a side length ratio of 7:5:3, and there are 3 first-type identifiers in total, and they are respectively located at three of the four vertices of the color card area (such as upper left, upper right, lower left apex). The second identifier includes three rectangles with a side length ratio of 5:3:1, and is set at the fourth vertex among the four vertices of the color card area (such as at the lower right corner of the color card area).
附加信息识别区包含一些简单的标记点,例如可以按照二进制的规则进行解析的标记点,例如包括用于记录色卡的版本号的四个色块,作为对色卡进行进一步后续分析时的参数设置。色卡色块区包括若干个方形,这些方形具有相同的大小,在位置识别符组成的矩形内均匀排列。每一个色块都有黑色边框,可以帮助识别程序较好地识别出色块的边界。色块的内部区域由不同的颜色进行填充,具体颜色可以进行适当选择和/或更换,以满足不同的实际用途。The additional information identification area contains some simple marking points, such as marking points that can be parsed according to binary rules, such as four color blocks used to record the version number of the color card, as parameters for further subsequent analysis of the color card set up. The color block area of the color card includes several squares with the same size, which are evenly arranged in the rectangle formed by the location identifiers. Each color block has a black border, which can help the recognition program better identify the boundary of the color block. The inner area of the color block is filled with different colors, and specific colors can be properly selected and/or replaced to meet different practical purposes.
标识符识别:Identifier identification:
在使用上述色卡进行图像获取后,需要对图像进行灰度和二值处理。根据本发明的一个实施例,采用动态全局阈值法对图像进行二值处理,其中,预设若干组候选阈值,将阈值一一代入进行二值化。将二值化的图像按照图3的方式分别在x轴和y轴进行扫描,并根据标识符的几何特征进行识别。After using the above color card for image acquisition, the image needs to be processed in grayscale and binary. According to an embodiment of the present invention, a dynamic global threshold method is used to perform binary processing on the image, wherein several groups of candidate thresholds are preset, and the thresholds are input one by one for binarization. The binarized image is scanned on the x-axis and y-axis respectively in the manner shown in Figure 3, and is identified according to the geometric features of the identifier.
根据本发明的一个实施例的色卡识别符定位算法包括:The color card identifier location algorithm according to an embodiment of the present invention comprises:
(1)在候选阈值库中确定一个阈值th作为初始二值化阈值,对灰度图像进行二值化,得到二值图像G。(1) Determine a threshold th in the candidate threshold library as the initial binarization threshold, and binarize the grayscale image to obtain a binary image G.
(2)在每一行中统计连续黑点或者白点的长度。如果满足黑:白:黑:白:黑=1:1:3:1:1,则计算目标区域中点坐标,并加入候选点库。(2) Count the length of continuous black or white dots in each row. If it satisfies black:white:black:white:black=1:1:3:1:1, calculate the coordinates of the midpoint of the target area and add it to the candidate point library.
(3)得到候选点库后,对其方圆r像素内进行搜索,判断是否存在其他候选点并统计数目,如果周围候选点的数目大于预设目标n,则认为该点是目标点,并加入目标点库。(3) After obtaining the candidate point library, search within r pixels around it to determine whether there are other candidate points and count the number. If the number of surrounding candidate points is greater than the preset target n, the point is considered to be the target point and added to Target point library.
(4)X,Y轴方向对调重新进行步骤(2)、(3),最终得到所有点的X,Y坐标(4) Swap the directions of X and Y axes and repeat steps (2) and (3) to finally get the X and Y coordinates of all points
(5)在上述候选预置库中选取下一个候选阈值th并重复步骤(2)-(4)(5) Select the next candidate threshold th in the above candidate preset library and repeat steps (2)-(4)
(6)对所有结果汇总并进行DBSCAN聚类分析,选择聚类点数目排名前三的区域作为最终区域,获取其中心点的坐标作为标识符的坐标。(6) Summarize all the results and perform DBSCAN cluster analysis, select the top three areas with the number of cluster points as the final area, and obtain the coordinates of its center point as the coordinates of the identifier.
色块中心点定位:Positioning of the center point of the color block:
由于透视的原因,色卡的矩形可能被扭曲成任意四边形,如图4,其中A、B、D点为1类标识符,C点为2类标识符。如果直接进行几何计算,得到的结果误差较大。在根据本发明的一个实施例中,采取的方法是将任意四边形还原为矩形,再做进一步处理。将图像在灰度空间下利用几何关系对坐标进行变换,确定像素点的目标坐标,灰度值则保留原有的灰度值。由于计算出的坐标不一定是整数,目标图像中具体的整数坐标点对应的灰度值需要进行插值运算,在根据本发明的一个实施例中,采用双线性插值进行处理。但这样的方法运算量较大,在本发明的一个较佳实施例中,利用透视原理公式直接进行色块中心点坐标的确定,包括:Due to perspective, the rectangle of the color card may be distorted into any quadrilateral, as shown in Figure 4, where points A, B, and D are Type 1 identifiers, and Point C is Type 2 identifiers. If the geometric calculation is performed directly, the error of the obtained result is relatively large. In one embodiment of the present invention, the method adopted is to restore any quadrilateral to a rectangle, and then perform further processing. The coordinates of the image are transformed using the geometric relationship in the gray space to determine the target coordinates of the pixels, and the gray value retains the original gray value. Since the calculated coordinates are not necessarily integers, the gray values corresponding to specific integer coordinate points in the target image need to be interpolated. In one embodiment of the present invention, bilinear interpolation is used for processing. However, such a method has a large amount of computation. In a preferred embodiment of the present invention, the determination of the coordinates of the center point of the color block is directly carried out by using the perspective principle formula, including:
设某色块中心点X在标准矩形中的坐标为i,j,原始矩形长为a,高为b。经过透视变换后,矩形的四个顶点分别变为(a1,b1),(a2,b2),(a3,b3),(a4,b4),则点X的坐标在经过透视变换后,变为:Let the coordinates of the center point X of a certain color block in the standard rectangle be i, j, the length of the original rectangle is a, and the height is b. After perspective transformation, the four vertices of the rectangle become (a 1 ,b 1 ),(a 2 ,b 2 ),(a 3 ,b 3 ),(a 4 ,b 4 ), and the coordinates of point X After perspective transformation, it becomes:
由此,当确定了色块中心点在标准矩形中的坐标i、j即可推断出在实际拍摄的图像中该中心点对应的坐标i’,j’。Thus, when the coordinates i, j of the center point of the color block in the standard rectangle are determined, the coordinates i', j' corresponding to the center point in the actually captured image can be deduced.
色块选取及颜色值计算:Color block selection and color value calculation:
在取得色块中心点坐标后,在灰度空间对图像进行区域生长算法处理,由于色块具有明显的边界,相同区域内颜色和灰度值近似统一,故通过区域生长算法可以得到相对完整的色块区域。在确定色块区域后,考虑到边界可能会对平均颜色的取值造成偏差,所以需要对色块区域进行边界切割,在根据本发明的一个具体实施例中,具体的裁减尺寸取色块区域边长的1/10;由此得到最终的色块区域。最后,可以通过计算色块区域的颜色的平均值来得到色块的具体颜色值。如此,通过对每个色块区域进行处理,得到整个色卡所有色块的颜色。另外,通过确定附加信息识别区的取值,读取出色卡版本等附加信息。After obtaining the coordinates of the center point of the color block, the image is processed by the region growing algorithm in the gray space. Since the color block has obvious boundaries, the color and gray value in the same area are approximately uniform, so a relatively complete image can be obtained by the region growing algorithm. Color block area. After determining the color block area, considering that the boundary may cause a deviation to the value of the average color, it is necessary to cut the boundary of the color block area. In a specific embodiment of the present invention, the specific cut size is the color block area 1/10 of the side length; thus the final color block area is obtained. Finally, the specific color value of the color block can be obtained by calculating the average value of the color of the color block area. In this way, by processing each color block area, the colors of all the color blocks in the entire color card are obtained. In addition, by determining the value of the additional information identification area, additional information such as the excellent card version is read.
对色卡识别是否成功的判断:Judgment on whether the color card recognition is successful:
本发明经过深入具体的研究之后发现:1)色卡的识别存在失败的情况;因而,2)需要对识别失败进行判断的手段。After in-depth and specific research, the present invention finds that: 1) the identification of the color card fails; therefore, 2) a means for judging the identification failure is needed.
具体地说,识别失败的情况包括:Specifically, situations where recognition fails include:
由于色卡的几个位置标识符模糊不清和/或无法识别导致的识别失败、或者Identification failure due to ambiguous and/or unrecognizable several position identifiers of the color chip, or
因为色卡图像变形严重等原因,从而导致识别出的色块位置出现明显偏差,导致识别出的色块区域可能是一些无关的区域和/或图案,Due to the serious deformation of the color card image and other reasons, the position of the identified color block is obviously deviated, and the identified color block area may be some irrelevant areas and/or patterns.
上述情况下得到的色块颜色值并不是色卡的相关色块的实际颜色值,即识别失败。In the above cases, the color value of the color block obtained is not the actual color value of the relevant color block of the color card, that is, the recognition fails.
因此,根据本发明的一个实施例,在进行色卡识别之后,对色卡的识别效果进行判断,且只对符合“识别成功”的要求的取样值进行后续的处理。Therefore, according to an embodiment of the present invention, after the color card identification is performed, the recognition effect of the color card is judged, and only the sampled values meeting the requirement of "identification success" are subjected to subsequent processing.
在大量的实验验证基础上,本发明人发现,在一般拍摄条件下,色卡色块的颜色相对于标准环境下的颜色的变化分别在RGB通道下大致符合线性规律。该实验是在现有48色色卡的基础上实现的,该色卡各个色块的设计RGB值如下表。On the basis of a large number of experimental verifications, the inventors found that under normal shooting conditions, the color changes of the color blocks of the color card compared with the colors in the standard environment are roughly in line with the linear law in the RGB channels. This experiment is realized on the basis of the existing 48-color color card, and the design RGB values of each color block of the color card are as follows.
图5展示了识别成功和失败的采样点在R通道的颜色变化情况,可以看出识别成功的情况下R的变化更加符合线性规律。据此,本发明人提出了采用线性回归方法对识别结果进行判断的方案,具体包括:Figure 5 shows the color changes in the R channel of the sampling points for successful and failed recognition. It can be seen that the change of R is more in line with the linear law when the recognition is successful. Accordingly, the inventor proposed a solution for judging the recognition result by using the linear regression method, which specifically includes:
假设色卡有n个采样点,具体体现为色卡上的n个色块,编号分别为1~n,Y1,Y2...YN分别是n个色块在标准环境中的颜色测量值,而y1,y2...yn为色卡编号为1~n的色块在一般环境(拍摄环境)下的颜色测量值。YR、yR为分别各个采样点在R通道上的取值,那么利用最小二乘法可得出表示YR、yR之间线性近似关系的公式:Assume that the color card has n sampling points, which are embodied as n color blocks on the color card, numbered 1~n, Y 1 , Y 2 ... Y N are the colors of n color blocks in the standard environment y 1 , y 2 . . . y n are the color measurement values of the color blocks numbered 1-n on the color card under the general environment (shooting environment). Y R , y R are the values of each sampling point on the R channel, then the formula for expressing the linear approximate relationship between Y R and y R can be obtained by using the least square method:
YR=fR(yR)=kR·yR+bR Y R =f R (y R )=k R y R +b R
其中,fR为R通道下的映射函数,kR、bR为映射函数fR的一次项和常数项的拟合系数。Among them, f R is the mapping function under the R channel, and k R and b R are the fitting coefficients of the primary term and the constant term of the mapping function f R.
同理,可以分别求得G通道和B通道下的映射函数fG,fB。Similarly, the mapping functions f G and f B under the G channel and the B channel can be obtained respectively.
当有一个待校准点i的R、G、B通道测量值已知,要得到i点在在标准环境中的修正值在根据本发明的一个实施例中,使用下方公式分别计算出的值:When there is a R, G, B channel measurement value of point i to be calibrated Known, to get the corrected value of point i in the standard environment In one embodiment according to the present invention, use the following formula to calculate respectively value of:
其中,上述公式中所有的系数k和b的确定,是通过采用经典最小二乘原理,对形如的直线方程进行求解,而实现的。Among them, all the coefficients k and b in the above formula are determined by using the classical least squares principle, for the shape such as The straight line equation is solved and realized.
在求得方程系数k和b后,可以将拟合方程和实际测量值进行统计分析并求出线性拟合优度R2。其中R2可以按照如下公式进行计算:After obtaining the coefficients k and b of the equation, the fitting equation and the actual measured value can be statistically analyzed and the linear fitting goodness R 2 can be obtained. Where R2 can be calculated according to the following formula :
其中yi指第i个样本的测量值,指第i个样本通过线性回归方程计算出的修正值,为所有测量值y的平均值,其中1≤i≤n。where y i refers to the measured value of the i-th sample, Refers to the correction value calculated by the i-th sample through the linear regression equation, is the average value of all measured values y, where 1≤i≤n.
根据本发明的另一个实施例,线性拟合优度R2由如下步骤确定:According to another embodiment of the present invention, the linearity of fit R 2 is determined by the following steps:
确定yi,i=1,2…n的一个第一子集的分布的线性拟合优度R2:Determine the linear goodness of fit R 2 of the distribution of a first subset of y i , i=1,2...n:
其中:in:
上式中的求和是在所述第一子集上进行,The summation in the above formula is performed on the first subset,
是第i个样本的修正值,为从以下项中选出的一种: is the corrected value of the i-th sample, is one selected from the following:
所有测量值y的平均值,其中1≤i≤n,mean of all measurements y, where 1≤i≤n,
所述第一子集对于的各测量值y的平均值,以及the average value of the measured values y for the first subset, and
yi的一个第二子集对应的各测量值y的平均值。The average value of each measured value y corresponding to a second subset of y i .
在根据本发明的一个示例实施例中,当R2>0.8时,则认为识别成功。In an exemplary embodiment according to the present invention, when R 2 >0.8, it is considered that the recognition is successful.
在判断识别成功后,利用色卡色块的颜色相对于标准环境下的颜色的变化的信息,进行下一步的颜色校正处理,即对舌像的颜色进行校正,从而得到颜色校正后的舌像。该下一步的颜色校正处理可以使用插值法或者线性回归、多项式回归等回归方法。After judging that the recognition is successful, use the information of the color change of the color block of the color card relative to the color in the standard environment to carry out the next step of color correction processing, that is, to correct the color of the tongue image, so as to obtain the color-corrected tongue image . The color correction processing in the next step can use interpolation method or regression methods such as linear regression and polynomial regression.
在本发明人已经进行的一系列实验中,对134例在不同条件下拍摄的色卡图像样本进行了分类比对。利用上述R2>0.8的评价方法对色卡识别结果进行评价。在在像素较低的恶劣环境中可以达到94.2%左右的识别正确率,而在像素较高的较好环境中可以达到98.5%的识别率,并总体达到了96.3%的识别率,足以满足实际使用的需求。具体结果包括:In a series of experiments carried out by the inventor, 134 color card image samples taken under different conditions were classified and compared. The above-mentioned evaluation method of R 2 >0.8 was used to evaluate the color card recognition results. In the harsh environment with low pixels, the recognition accuracy rate can reach about 94.2%, while in the better environment with high pixels, the recognition rate can reach 98.5%, and the overall recognition rate reaches 96.3%, which is enough to meet the actual use needs. Specific results include:
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810741280.XA CN110689586B (en) | 2018-07-08 | 2018-07-08 | Tongue image identification method in traditional Chinese medicine intelligent tongue diagnosis and portable correction color card used for same |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810741280.XA CN110689586B (en) | 2018-07-08 | 2018-07-08 | Tongue image identification method in traditional Chinese medicine intelligent tongue diagnosis and portable correction color card used for same |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110689586A CN110689586A (en) | 2020-01-14 |
CN110689586B true CN110689586B (en) | 2022-12-16 |
Family
ID=69107473
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810741280.XA Active CN110689586B (en) | 2018-07-08 | 2018-07-08 | Tongue image identification method in traditional Chinese medicine intelligent tongue diagnosis and portable correction color card used for same |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110689586B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112950485B (en) * | 2020-11-27 | 2023-11-03 | 京东科技控股股份有限公司 | Color card, image color difference processing method and device, electronic equipment and storage medium |
CN113057583A (en) * | 2021-03-09 | 2021-07-02 | 上海中医药大学 | Tongue picture color correction method |
CN119359621A (en) * | 2024-09-10 | 2025-01-24 | 中国中医科学院中医基础理论研究所 | Tongue picture intelligent processing method and system based on mobile phone photographing |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1803087A (en) * | 2006-01-19 | 2006-07-19 | 上海交通大学 | Tongue color automatic recognition method |
CN101972138A (en) * | 2010-11-08 | 2011-02-16 | 哈尔滨工业大学 | Integrated portable standardized traditional Chinese medical science tongue image acquiring equipment |
CN102095371A (en) * | 2010-11-25 | 2011-06-15 | 天津大学 | Industrial color vision detection device and method |
CN102714687A (en) * | 2010-01-19 | 2012-10-03 | 阿克佐诺贝尔国际涂料股份有限公司 | Method and system for determining colour from an image |
CN105466430A (en) * | 2015-12-31 | 2016-04-06 | 零度智控(北京)智能科技有限公司 | Unmanned aerial vehicle positioning method and device |
CN106546581A (en) * | 2016-11-02 | 2017-03-29 | 长沙云知检信息科技有限公司 | Detection paper card intelligent checking system and detection paper card intelligent analysis method |
CN108185993A (en) * | 2018-01-31 | 2018-06-22 | 潘映含 | A kind of tongue is as acquisition method |
-
2018
- 2018-07-08 CN CN201810741280.XA patent/CN110689586B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1803087A (en) * | 2006-01-19 | 2006-07-19 | 上海交通大学 | Tongue color automatic recognition method |
CN102714687A (en) * | 2010-01-19 | 2012-10-03 | 阿克佐诺贝尔国际涂料股份有限公司 | Method and system for determining colour from an image |
CN101972138A (en) * | 2010-11-08 | 2011-02-16 | 哈尔滨工业大学 | Integrated portable standardized traditional Chinese medical science tongue image acquiring equipment |
CN102095371A (en) * | 2010-11-25 | 2011-06-15 | 天津大学 | Industrial color vision detection device and method |
CN105466430A (en) * | 2015-12-31 | 2016-04-06 | 零度智控(北京)智能科技有限公司 | Unmanned aerial vehicle positioning method and device |
CN106546581A (en) * | 2016-11-02 | 2017-03-29 | 长沙云知检信息科技有限公司 | Detection paper card intelligent checking system and detection paper card intelligent analysis method |
CN108185993A (en) * | 2018-01-31 | 2018-06-22 | 潘映含 | A kind of tongue is as acquisition method |
Also Published As
Publication number | Publication date |
---|---|
CN110689586A (en) | 2020-01-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104700062B (en) | A method and device for identifying two-dimensional codes | |
JP5699788B2 (en) | Screen area detection method and system | |
CN105046252B (en) | A kind of RMB prefix code recognition methods | |
WO2016062159A1 (en) | Image matching method and platform for testing of mobile phone applications | |
CN110569774B (en) | An Automatic Digitization Method of Line Chart Image Based on Image Processing and Pattern Recognition | |
CN110689586B (en) | Tongue image identification method in traditional Chinese medicine intelligent tongue diagnosis and portable correction color card used for same | |
KR102073468B1 (en) | System and method for scoring color candidate poses against a color image in a vision system | |
CN111508032B (en) | Method for sorting feature points in camera calibration process | |
CN110909640A (en) | Method and device for determining water level line, storage medium and electronic device | |
CN113283439A (en) | Intelligent counting method, device and system based on image recognition | |
WO2017088637A1 (en) | Method and apparatus for locating image edge in natural background | |
CN106169080A (en) | A kind of combustion gas index automatic identifying method based on image | |
CN104182757A (en) | Method of acquiring actual coverage area of measured target and device | |
CN110097535A (en) | The nitrogenous quantity measuring method of plant leaf blade, device, computer equipment and storage medium | |
CN112668578B (en) | Pointer type instrument reading method, pointer type instrument reading device, computer equipment and storage medium | |
CN118212124A (en) | A new point cloud stitching method based on coded plane targets | |
CN111563883B (en) | Screen vision positioning method, positioning equipment and storage medium | |
CN110751690B (en) | Visual positioning method for milling machine tool bit | |
JP5160366B2 (en) | Pattern matching method for electronic parts | |
WO2025035793A1 (en) | Led light spot data extraction method and apparatus, and computer device | |
JP2008116207A (en) | Image measuring apparatus, image measuring method and program | |
CN118247355A (en) | Camera external parameter calibration method, device, computer equipment and storage medium | |
CN111738936A (en) | Image processing-based multi-plant rice spike length measuring method | |
CN101469984B (en) | Image impurity analysis system and method | |
CN112215319B (en) | Two-dimensional code of color mark characteristic graph and identification method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |