WO2020043178A1 - Device and method for recognizing tooth mark on tongue using tongue contour - Google Patents

Device and method for recognizing tooth mark on tongue using tongue contour Download PDF

Info

Publication number
WO2020043178A1
WO2020043178A1 PCT/CN2019/103416 CN2019103416W WO2020043178A1 WO 2020043178 A1 WO2020043178 A1 WO 2020043178A1 CN 2019103416 W CN2019103416 W CN 2019103416W WO 2020043178 A1 WO2020043178 A1 WO 2020043178A1
Authority
WO
WIPO (PCT)
Prior art keywords
tongue
contour
tooth
tooth mark
points
Prior art date
Application number
PCT/CN2019/103416
Other languages
French (fr)
Chinese (zh)
Inventor
张贯京
葛新科
吕超
王海荣
高伟明
Original Assignee
深圳市前海安测信息技术有限公司
深圳市易特科信息技术有限公司
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 深圳市前海安测信息技术有限公司, 深圳市易特科信息技术有限公司 filed Critical 深圳市前海安测信息技术有限公司
Publication of WO2020043178A1 publication Critical patent/WO2020043178A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • AHUMAN NECESSITIES
    • A61MEDICAL OR VETERINARY SCIENCE; HYGIENE
    • A61BDIAGNOSIS; SURGERY; IDENTIFICATION
    • A61B5/00Measuring for diagnostic purposes; Identification of persons
    • A61B5/103Detecting, measuring or recording devices for testing the shape, pattern, colour, size or movement of the body or parts thereof, for diagnostic purposes
    • A61B5/107Measuring physical dimensions, e.g. size of the entire body or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes

Definitions

  • the invention relates to the technical field of traditional Chinese medicine tongue image processing, in particular to a tongue tooth mark recognition device and method based on the tongue contour line.
  • Tooth-marked tongue refers to the traces of the teeth seen at the edge of the tongue. It is also called tooth-printed tongue. It is caused by the weight of the tongue and is compressed by the edge of the tooth. It is a kind of abnormal tongue. Guiding significance. Toothed tongue is easy to identify in tongue diagnosis, and is less affected by external factors (such as food, medicine, etc.). Traditional Chinese medical theory believes that most of the teeth marks are caused by qi deficiency, spleen deficiency or yang deficiency. Because the spleen deficiency cannot transport water and wet, causing the tongue to become fat, the spleen tongue is mainly spleen and wet. If it is pale and moist, it is cold and damp, and it is red and tooth marks, mostly spleen or qi deficiency.
  • Tongue tooth marks are extracted in the prior art based on the color characteristics around the tongue body and the slope of the tongue boundary line to determine the tongue tooth marks.
  • the color characteristics around the tongue are greatly affected by the changes in the tongue color, leading to many cases of misjudgment; in many cases, the boundary curve of the tongue is not smooth enough, and the burr phenomenon is serious, which leads to a higher error rate of tongue tooth marks high. Therefore, it is necessary to provide an effective tongue tooth mark recognition device and method to improve the accuracy of tongue tooth mark recognition.
  • the main object of the present invention is to provide a tongue tooth mark recognition device and method based on the tongue contour line, which aims to solve the technology of high tongue tooth mark discrimination error rate due to tongue peripheral color and tongue boundary curve burr. problem.
  • the present invention provides a tongue tooth mark recognition device based on a tongue contour line, comprising a processor adapted to implement various computer program instructions and a memory adapted to store a plurality of computer program instructions, the computer Program instructions are loaded by the processor and perform the following steps:
  • Input a tongue image through an input unit, and perform grayscale conversion on the tongue image to generate a grayscale image;
  • the tongue body marks are marked as tongue tooth marks, and a tongue body image marked with the tooth mark positions is finally generated.
  • the step of performing image contour tracking processing on the binary image to generate a contour line of the tongue includes:
  • Step 1 Scan the binary image in order from top to bottom and left to right, and find the first boundary starting point A 0 as the current boundary point, where A 0 is the boundary point with the smallest row and the boundary point column;
  • Step 3 Search the 3 * 3 neighborhood of the current pixel in the counterclockwise direction.
  • the initial search direction is set as follows: Take (dir + 3) mod 4 for the four connected areas of the binary image, where mod is the modulo operation.
  • the first pixel point in the 3 * 3 neighborhood that is the same as the current pixel is used as the new boundary point A n , and the variable dir is updated as the new scanning direction value;
  • Step 4 If the new boundary point A n is equal to the second boundary point A 1 and the previous boundary point A n-1 is equal to the first boundary point A 0 , then stop searching and end the tracking of the boundary points, otherwise repeat step 3 Continue to search for the next boundary point;
  • step 5 the boundary formed by the tracked boundary points A 0 , A 1 , A 2 ,..., A n-2 is the contour line of the tongue.
  • the step of calculating the center of mass of the tongue according to the contour of the tongue includes the following steps: using a zero-order moment to calculate the area of the binary image, the zero-order moment is expressed as ,among them Represents the gray value of the pixel at the (i, j) point of the binary image, and M 00 is the sum of the gray values of the white area in the binary image;
  • the first-order moment and the area M 00 of the binary image are used to calculate the centroid of the binary image as the center of mass of the tongue.
  • the first-order moment is expressed as: , , Where M 10 is the cumulative sum of the x-coordinate values of all white areas on the binary image, and M 01 is the cumulative sum of the y-coordinate values of all white areas on the binary image;
  • the step of calculating the tongue contour convex hull as the approximate tongue tooth mark contour based on the tongue contour line includes the following steps: pairing n points in the point set in the tongue contour line pairwise to form n ( n-1) / 2 straight lines; for each straight line determined by any two points, traverse whether the remaining (n-2) points of the two points are on the same side of the straight line, if it exists on the straight line Point on the side, the point is added to the convex hull set until all straight lines have been traversed, and the convex hull set is used as an approximate tongue tooth contour line.
  • the step of calculating the tongue contour convex hull as the approximate tongue tooth mark contour line according to the tongue body contour line includes the following steps: assuming that there are m points on the approximate tongue tooth mark contour line, each adjacent two points Connected to form m straight lines, the two endpoints of each straight line L in the m edges have p points on the tongue contour line between the two corresponding ends of the tongue contour line. Calculate the p points to the straight line respectively The distance of L, where the maximum distance is recorded as D; if the maximum distance D is greater than a predefined threshold ⁇ , mark the area corresponding to the p points as having tooth marks, and save the point C corresponding to the maximum distance D as the tooth Mark position.
  • the present invention also provides a tongue tooth mark recognition method based on the tongue outline, which is applied to a tongue tooth mark recognition device.
  • the method includes the following steps:
  • Input a tongue image through an input unit, and perform grayscale conversion on the tongue image to generate a grayscale image;
  • the tongue body marks are marked as tongue tooth marks, and a tongue body image marked with the tooth mark positions is finally generated.
  • the step of performing image contour tracking processing on the binary image to generate a contour line of the tongue includes:
  • Step 1 Scan the binary image in order from top to bottom and left to right, and find the first boundary starting point A 0 as the current boundary point, where A 0 is the boundary point with the smallest row and the boundary point column;
  • Step 3 Search the 3 * 3 neighborhood of the current pixel in the counterclockwise direction.
  • the initial search direction is set as follows: Take (dir + 3) mod 4 for the four connected areas of the binary image, where mod is the modulo operation.
  • the first pixel point in the 3 * 3 neighborhood that is the same as the current pixel is used as the new boundary point A n , and the variable dir is updated as the new scanning direction value;
  • Step 4 If the new boundary point A n is equal to the second boundary point A 1 and the previous boundary point A n-1 is equal to the first boundary point A 0 , then stop searching and end the tracking of the boundary points, otherwise repeat step 3 Continue to search for the next boundary point;
  • step 5 the boundary formed by the tracked boundary points A 0 , A 1 , A 2 ,..., A n-2 is the contour line of the tongue.
  • the step of calculating the center of mass of the tongue according to the contour of the tongue includes the following steps: using a zero-order moment to calculate the area of the binary image, the zero-order moment is expressed as ,among them Represents the gray value of the pixel at the (i, j) point of the binary image, and M 00 is the sum of the gray values of the white area in the binary image;
  • the first-order moment and the area M 00 of the binary image are used to calculate the centroid of the binary image as the center of mass of the tongue.
  • the first-order moment is expressed as: , , Where M 10 is the cumulative sum of the x-coordinate values of all white areas on the binary image, and M 01 is the cumulative sum of the y-coordinate values of all white areas on the binary image;
  • the step of calculating the tongue contour convex hull as the approximate tongue tooth mark contour based on the tongue contour line includes the following steps: pairing n points in the point set in the tongue contour line pairwise to form n ( n-1) / 2 straight lines; for each straight line determined by any two points, traverse whether the remaining (n-2) points of the two points are on the same side of the straight line, if it exists on the straight line Point on the side, the point is added to the convex hull set until all straight lines have been traversed, and the convex hull set is used as an approximate tongue tooth contour line.
  • the step of calculating the tongue contour convex hull as the approximate tongue tooth mark contour line according to the tongue body contour line includes the following steps: assuming that there are m points on the approximate tongue tooth mark contour line, each adjacent two points Connected to form m straight lines, the two endpoints of each straight line L in the m edges have p points on the tongue contour line between the two corresponding ends of the tongue contour line. Calculate the p points to the straight line respectively The distance of L, where the maximum distance is recorded as D; if the maximum distance D is greater than a predefined threshold ⁇ , mark the area corresponding to the p points as having tooth marks, and save the point C corresponding to the maximum distance D as the tooth Mark position.
  • the tongue tooth mark recognition device and method based on the tongue outline of the present invention can determine tooth marks based on the unevenness of the tongue outline, because the tooth outline of the tongue is in the tooth mark Obvious depressions will be formed everywhere, so the number of tongue tooth marks can be judged according to the unevenness of the contour line.
  • the accuracy of identifying tongue tooth marks of the present invention is not affected by the color of the tongue periphery and the burr of the tongue boundary curve. Improve the accuracy of tongue tooth mark recognition.
  • FIG. 1 is a schematic block diagram of a preferred embodiment of a tongue tooth mark recognition device based on a tongue contour line of the present invention
  • FIG. 2 is a method flowchart of a preferred embodiment of a tongue tooth mark recognition method based on a tongue contour line of the present invention
  • FIG. 3 is a schematic diagram of a tongue tooth mark recognition process based on a tongue contour line according to the present invention.
  • FIG. 1 is a schematic block diagram of a preferred embodiment of a tongue tooth mark recognition device based on a tongue contour line of the present invention.
  • the tongue tooth mark recognition device 1 based on the tongue outline is installed with a tongue tooth mark recognition system 10 based on the tongue outline, and the tongue tooth mark recognition based on the tongue outline
  • the device 1 may be a computer device having a data processing function and an image processing function, such as a personal computer, a workstation computer, a traditional Chinese medicine tongue imager, and the like, which are equipped with the tongue tooth mark recognition system 10 based on the tongue contour line.
  • the tongue tooth mark recognition device 1 based on the tongue outline includes, but is not limited to, a tongue tooth mark recognition system 10 based on the tongue outline, an input unit 11, and is adapted to store a plurality of A computer program instruction memory 12, a processor 13 executing various computer program instructions, and an output unit 14.
  • the input unit 11 is an input device such as a keyboard, a mouse, a camera, and the like, and is configured to input a tongue image including a tongue of a patient into the tongue tooth mark recognition device 1.
  • the memory 12 may be a read-only memory ROM, a random access memory RAM, an electrically erasable memory EEPROM, a flash memory FLASH, a magnetic disk, or an optical disk.
  • the processor 13 is a central processing unit (CPU), a microcontroller (MCU), a data processing chip, or an information processing unit having a data processing function.
  • the output unit 14 may be a display screen for displaying a tongue image, or a printer for printing a tongue image.
  • the tongue tooth mark recognition system 10 based on the tongue outline is composed of a plurality of program modules composed of computer program instructions, including, but not limited to, a tongue image processing module 101 and a tongue outline
  • the module referred to in the present invention refers to a series of computer program instruction segments that can be executed by the processor 13 of the tongue tooth mark recognition device 1 based on the tongue contour line and can complete a fixed function, and is stored in the memory 12, The specific functions of each module are described in detail below with reference to FIG. 2.
  • FIG. 2 it is a flowchart of a preferred embodiment of a tongue tooth mark recognition method based on a tongue contour line of the present invention.
  • various method steps of the tongue body tooth mark recognition method are implemented by a computer software program, and the computer software program is stored in a computer readable storage medium (such as the memory 12) in the form of computer program instructions
  • the computer-readable storage medium may include a read-only memory, a random access memory, a magnetic disk, or an optical disk, and the computer program instructions can be loaded by a processor (for example, the processor 13) and execute steps S21 to S30 as follows.
  • a tongue image is input through the input unit, and the tongue image is converted into a grayscale image.
  • the tongue image processing module 101 takes in a clear image from the patient's mouth through the input unit 11 (such as a high-definition camera) Or a tongue image stored in the memory 12 in advance, the tongue image is a color tongue RGB image composed of three channels of R, G, and B, and the tongue RGB image is grayed out.
  • Degree conversion generates a grayscale picture, as shown in Figure a in Figure 3.
  • Step S22 Binarize the grayscale image to generate a binary image, and perform tongue morphological transformation on the binary image to remove small black blocks.
  • the tongue image processing module 101 binarizes a grayscale picture (as shown in FIG. 3 a) to generate a binary image, and performs tongue morphological transformation on the binary image to remove small black blocks ( (Shown in Figure 3b), to remove the impurities in the tongue image to obtain a binary image without impurities, as shown in Figure 3c.
  • Step S23 Image contour tracking processing is performed on the binary image to generate tongue contour lines.
  • the tongue contour extraction module 102 performs image contour tracking processing on the binary images to generate tongue contour lines (as shown in FIG. 3). (shown in Figure d), including the following steps: Step 1. First, scan the binary image in order from top to bottom and left to right, and find the first boundary starting point A 0 without the tracking end mark as the current boundary point.
  • Step 2 define a scanning direction variable dir, which is used to record the moving direction along the previous boundary point to the current boundary point in Step 1, this variable
  • Step 3 the 3 * 3 neighborhood of the current pixel is searched in the counterclockwise direction, and the initial search direction is set as follows: (dir + 3 for the four-connected area) ) Mod 4, where mod is a modulo operation, the first pixel point that is the same as the current pixel searched in the 3 * 3 neighborhood is used as the new boundary point A n , and the variable dir is updated as the new scanning direction value; steps 4, if A n, etc.
  • the second boundary point A 1, and a front boundary point A n-1 is equal to a first boundary point A 0, the search is stopped and ends the track boundary, a boundary point or the repeat step 3 to continue the search; Step 5, starting from The boundary formed by the tracked boundary points A 0 , A 1 , A 2 , ..., A n-2 is the contour line of the tongue.
  • the tongue body centroid is calculated according to the tongue body contour line.
  • the tongue body centroid calculation module 103 calculates the tongue body centroid according to the tongue body contour line.
  • the specific algorithm is as follows: a zero-order moment is used to calculate the Area (including contour and connected domain), the zero-order moment is expressed as: , Where the binary image is a single-channel image, Represents the gray value of the pixel at the (i, j) point of the binary image. There are only two values of 0 (black) and 1 (white). M 00 is the sum of the gray values of the white area in the binary image. Therefore, M 00 can be used to find the area of the binary image (including the contour and the connected domain).
  • the first-order moment and the area M 00 of the binary image are used to calculate the centroid of the binary image as the center of mass of the tongue.
  • the first-order moment is expressed as: , , Where M 10 is the cumulative sum of the x-coordinate values of all white areas on the binary image, and M 01 is the cumulative sum of the y-coordinate values of all white areas on the binary image.
  • the tongue body centroid calculation module 103 is based on the following formula: , Calculate the centroid of the binary image (the center point shown in Figure e of Fig. 3) as the tongue centroid, where x c and y c are the centroid coordinates of the binary image.
  • the tongue root boundary area is determined according to the center of mass of the tongue.
  • the tongue root boundary determination module 104 surrounds the tongue formed by the contour lines of the tongue root corresponding to the left and right angles of the vertical center of mass of the tongue with 50 °
  • the upper half of the body serves as the border area of the tongue base. Because the boundary points appearing in the root region of the tongue do not constitute tongue tooth marks, the tooth root boundary region does not perform tooth mark recognition. Therefore, it is necessary to delete the tooth marks in the tongue root border region to improve the accuracy of tongue tooth mark recognition.
  • the left and right angles between the vertical direction of the center of mass of the tongue body and the left and right sides are respectively 50 ° (as shown in FIG. 3 f).
  • the upper half of the tongue surrounded by the contour line is used as the tongue root boundary area.
  • the convex contour of the tongue contour is calculated according to the contour of the tongue, as the approximate contour of the tooth marks of the tongue.
  • the tooth contour determining module 105 sets all points in the set of points in the contour of the tongue (assuming A total of n points) are paired in pairs (two points determine a straight line) to form n (n-1) / 2 straight lines; for each straight line determined by any two points, traverse the remaining two points (n-2 ) Whether the points are on the same side of the line, if there is a point on one side of the line, add the point to the convex hull set until all the lines have been traversed, and use the convex hull set as the approximate tongue
  • the contour line of the tooth mark is the contour line of the convex portion as shown in FIG. 3g.
  • step S27 the position of the tooth mark is determined according to the maximum distance between the contour line of the tongue and the contour line of the approximate tongue tooth mark.
  • the tongue tooth mark recognition module 106 is based on the tongue contour line and the approximate tongue tooth mark.
  • the maximum distance between the contour lines determines the position of the tooth marks. Specifically, it is assumed that there are m points on the contour line of the approximate tongue tooth mark, and each adjacent two points are connected to form m straight lines. The two endpoints of each straight line L in the m edges are at the two points corresponding to the contour line of the tongue. There may be p points between the end points on the contour of the tongue. Calculate the distance from the p points to the straight line L, where the maximum distance is recorded as D.
  • step S28 it is determined whether a tooth mark exists at the contour of the tongue base.
  • the tongue tooth mark recognition module 106 determines whether a tooth mark exists at the contour of the tongue base. If there is a tooth mark at the contour of the tongue root, the process first performs step S28 and then step S29; if there is no tooth mark at the contour of the tongue root, the process directly performs step S29.
  • the tongue tooth mark recognition module 106 determines whether the point C exists in the tongue root boundary area, and if the point C exists in the tongue root boundary area, the position of the point C is excluded as a non-tooth mark; if the point C does not exist in the tongue root boundary area , Mark the tooth marks on the tongue image based on the position determined by point C, as shown in Figure 3 h, four white points on the contour line of the tongue.
  • step S29 the tooth marks at the outline of the tongue base are deleted.
  • the tongue tooth mark recognition module 106 determines that there are tooth marks at the tongue root outline, delete the tooth marks at the tongue root outline. Specifically, if the point C exists in the boundary area of the tongue root, the tongue tooth mark recognition module 106 excludes the position of the point C as a non-tooth mark, that is, the point C is deleted from the contour of the tongue root.
  • step S30 the tongue image is marked as a tongue tooth mark on the tongue image according to the determined tooth mark position, and finally a tongue image marked with a tooth mark position is generated.
  • the tongue tooth mark recognition module 106 marks the tongue tooth marks on the tongue image according to the determined tooth mark positions, and finally generates
  • the tongue image marked with the position of the tooth marks is shown in FIG. 3 i, the tongue image marked with four white dots. Specifically, if the point C does not exist in the border area of the tongue base, the position determined by the point C is marked as a tooth mark on the tongue image.
  • the tongue tooth mark recognition module 106 also displays the tongue image marked with the tooth mark position on the display screen through the output unit 14, or prints the tongue image marked with the tooth mark position through a printer, or marks the tooth mark
  • the tongue body image at the mark position is sent to the doctor's terminal through the communication network, so that the doctor can check the patient's tooth mark tongue information and formation status, thereby assisting the doctor in the TCM tongue diagnosis to obtain the health status of the patient.
  • the present invention also provides a computer-readable storage medium.
  • the computer-readable storage medium stores a plurality of computer program instructions.
  • the computer program instructions are loaded by a processor of a computer device and execute the tongue body based on the tongue contour line of the present invention. Steps of the tooth mark recognition method. Those skilled in the art may understand that all or part of the steps of the various methods in the foregoing embodiments may be completed by related program instructions.
  • the program may be stored in a computer-readable storage medium.
  • the storage medium may include a read-only memory, a random access memory, Disk or CD, etc.
  • the tongue tooth mark recognition device and method based on the tongue outline of the present invention can judge tooth marks based on the unevenness of the tongue outline. Since the tooth outline of the tongue will form a significant depression at the tooth mark, Therefore, the number of tongue tooth marks can be judged according to the unevenness of the contour line. The accuracy of the tongue tooth mark recognition of the present invention is not affected by the tongue peripheral color and the tongue boundary curve burr, so the tongue tooth mark recognition Accuracy.
  • the tongue tooth mark recognition device and method based on the tongue outline of the present invention can determine tooth marks based on the unevenness of the tongue outline, because the tooth outline of the tongue is in the tooth mark Obvious depressions will be formed everywhere, so the number of tongue tooth marks can be judged according to the unevenness of the contour line.
  • the accuracy of identifying tongue tooth marks of the present invention is not affected by the color of the tongue periphery and the burr of the tongue boundary curve. Improve the accuracy of tongue tooth mark recognition.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Pathology (AREA)
  • Veterinary Medicine (AREA)
  • Heart & Thoracic Surgery (AREA)
  • Medical Informatics (AREA)
  • Molecular Biology (AREA)
  • Surgery (AREA)
  • Animal Behavior & Ethology (AREA)
  • General Health & Medical Sciences (AREA)
  • Public Health (AREA)
  • Biomedical Technology (AREA)
  • Geometry (AREA)
  • Biophysics (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Dentistry (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

The present invention provides a device and a method for recognizing a tooth mark on the tongue using a tongue contour, the method comprising the following steps: subjecting a tongue image to grayscale conversion to generate a grayscale image; subjecting the grayscale image to binarization to generate a binary image; subjecting the binary image to image contour tracing and processing to generate a tongue contour; calculating a tongue centroid on the basis of the tongue contour; determining a border area of a tongue root on the basis of the tongue centroid; calculating a tongue contour convex hull on the basis of the tongue contour, to serve as an approximate contour of a tooth mark on the tongue; determining a position of the tooth mark based on a maximum distance between the tongue contour and the approximate contour of the tooth mark on the tongue; judging if a tooth mark is present at a contour of the tooth root; and if a tooth mark is present at a contour of the tooth root, then deleting the tooth mark at a contour of the tooth root; and if a tooth mark is not present at a contour of the tooth root, then labeling a tooth mark on the tongue on the tongue image on the basis of the determined position of the tooth mark, thus finally generating a tongue image labeled with the position of the tooth mark. The present invention improves accuracy in recognizing and extracting a tooth mark on the tongue.

Description

基于舌体轮廓线的舌体齿痕识别装置及方法Tongue tooth mark recognition device and method based on tongue outline 技术领域Technical field
本发明涉及中医舌像处理的技术领域,尤其涉及一种基于舌体轮廓线的舌体齿痕识别装置及方法。The invention relates to the technical field of traditional Chinese medicine tongue image processing, in particular to a tongue tooth mark recognition device and method based on the tongue contour line.
背景技术Background technique
齿痕舌是指舌体边缘见牙齿的痕迹,又名齿印舌,多因舌体胖大而受齿缘压迫所致,是异常舌形的一种,齿痕舌对临床辨证论治有很大的指导意义。齿痕舌在舌诊中容易辨识,并且受外来因素(如食物、药剂等)的影响较少。中医医学理论认为齿痕舌多由气虚、脾虚或阳虚所致,由于脾虚不能运化水湿,致舌体胖大,故齿痕舌主脾虚和湿盛。若淡白而湿润,则属寒湿壅盛;淡红而有齿痕,多是脾虚或气虚。Tooth-marked tongue refers to the traces of the teeth seen at the edge of the tongue. It is also called tooth-printed tongue. It is caused by the weight of the tongue and is compressed by the edge of the tooth. It is a kind of abnormal tongue. Guiding significance. Toothed tongue is easy to identify in tongue diagnosis, and is less affected by external factors (such as food, medicine, etc.). Traditional Chinese medical theory believes that most of the teeth marks are caused by qi deficiency, spleen deficiency or yang deficiency. Because the spleen deficiency cannot transport water and wet, causing the tongue to become fat, the spleen tongue is mainly spleen and wet. If it is pale and moist, it is cold and damp, and it is red and tooth marks, mostly spleen or qi deficiency.
随着医学科学的发展及人工智能的参与,齿痕舌的研究正逐步向微观研究和定量检测、客观化等方面深入。随着世界卫生组织对健康概念的重新界定,以及中医对亚健康状态调整的研究,对齿痕舌在疾病发生、发展中的意义也应当从新的角度进行探讨。齿痕舌与虚证体质的关系,虚证体质与某些疾病之易感性的关系,是中医舌诊客观化研究的新课题之一。为此,对舌体的齿痕特征的识别与提取是中医舌诊研究的一项重要课题。With the development of medical science and the participation of artificial intelligence, the research of tooth scar tongue is gradually deepening into microscopic research, quantitative detection, and objectification. With the redefinition of the concept of health by the World Health Organization, and the study of the adjustment of sub-health status by Chinese medicine, the significance of tooth scar tongue in the occurrence and development of diseases should also be explored from a new perspective. The relationship between dentition tongue and deficiency syndrome and the relationship between deficiency syndrome and susceptibility to certain diseases is one of the new topics for the objective study of tongue diagnosis in traditional Chinese medicine. For this reason, the identification and extraction of the tooth mark features of the tongue is an important topic in the research of TCM tongue diagnosis.
现有技术提取舌体齿痕主要根据舌体周边的颜色特征、以及舌体边界线的斜率变化情况来判别舌体齿痕。然而,舌体周边颜色特征受舌体颜色的变化影响较大,导致出现误判的情况较多;很多情况下舌体边界曲线不够光滑,毛边现象严重,从而导致舌体齿痕判别错误率较高。因此,有必要提供一种有效的舌体齿痕识别装置与方法,提高舌体齿痕识别的准确度。Tongue tooth marks are extracted in the prior art based on the color characteristics around the tongue body and the slope of the tongue boundary line to determine the tongue tooth marks. However, the color characteristics around the tongue are greatly affected by the changes in the tongue color, leading to many cases of misjudgment; in many cases, the boundary curve of the tongue is not smooth enough, and the burr phenomenon is serious, which leads to a higher error rate of tongue tooth marks high. Therefore, it is necessary to provide an effective tongue tooth mark recognition device and method to improve the accuracy of tongue tooth mark recognition.
技术问题technical problem
本发明的主要目的在于提供一种基于舌体轮廓线的舌体齿痕识别装置及方法,旨在解决因舌体周边颜色以及舌体边界曲线毛刺而导致舌体齿痕判别错误率高的技术问题。The main object of the present invention is to provide a tongue tooth mark recognition device and method based on the tongue contour line, which aims to solve the technology of high tongue tooth mark discrimination error rate due to tongue peripheral color and tongue boundary curve burr. problem.
技术解决方案Technical solutions
为实现上述目的,本发明提供一种基于舌体轮廓线的舌体齿痕识别装置,包括适于实现各种计算机程序指令的处理器以及适于存储多条计算机程序指令的存储器,所述计算机程序指令由处理器加载并执行如下步骤:To achieve the above object, the present invention provides a tongue tooth mark recognition device based on a tongue contour line, comprising a processor adapted to implement various computer program instructions and a memory adapted to store a plurality of computer program instructions, the computer Program instructions are loaded by the processor and perform the following steps:
通过输入单元输入舌体图像,并对舌体图像进行灰度转化生成灰度图片;Input a tongue image through an input unit, and perform grayscale conversion on the tongue image to generate a grayscale image;
对灰度图片二值化生成二值图像;Binarize grayscale pictures to generate binary images;
对二值图像进行图像轮廓跟踪处理生成舌体轮廓线;Image contour tracking processing on binary images to generate tongue contour lines;
根据舌体轮廓线计算舌体质心;Calculate the center of mass of the tongue according to the contour of the tongue;
根据舌体质心确定舌根边界区域;Determine the tongue root boundary area according to the center of mass of the tongue;
根据舌体轮廓线计算舌体轮廓凸包作为近似舌体齿痕轮廓线;Calculate the convex contour of the tongue according to the contour of the tongue as the approximate contour of the tongue teeth;
根据舌体轮廓线和近似舌体齿痕轮廓线之间的最大距离确定齿痕位置;Determine the position of the tooth mark according to the maximum distance between the outline of the tongue and the outline of the approximate tooth mark;
判断舌根轮廓处是否存在齿痕;Determine whether there are tooth marks at the contour of the tongue base;
若舌根轮廓处存在齿痕,则删除舌根轮廓处的齿痕;If there are tooth marks on the outline of the tongue, delete the tooth marks on the outline of the tongue;
根据确定的齿痕位置在舌体图像上标记为舌体齿痕,最终生成标记有齿痕位置的舌体图像。According to the determined tooth mark positions, the tongue body marks are marked as tongue tooth marks, and a tongue body image marked with the tooth mark positions is finally generated.
进一步地,所述对二值图像进行图像轮廓跟踪处理生成舌体轮廓线的步骤包括:Further, the step of performing image contour tracking processing on the binary image to generate a contour line of the tongue includes:
步骤1,按照从上到下、从左到右的顺序扫描二值图像,寻找第一个边界起始点A 0作为当前边界点,其中A 0是具有最小行和边界点列的边界点; Step 1. Scan the binary image in order from top to bottom and left to right, and find the first boundary starting point A 0 as the current boundary point, where A 0 is the boundary point with the smallest row and the boundary point column;
步骤2,定义一个扫描方向变量dir,该变量用于记录步骤1中沿着前一个边界点到当前边界点的移动方向,该变量的初始化取值为对二值图像的四连通区域取dir=3;Step 2. Define a scanning direction variable dir. This variable is used to record the moving direction along the previous boundary point to the current boundary point in step 1. The initialization value of this variable is dir = 3;
步骤3,按逆时针方向搜索当前象素的3*3邻域,起始搜索方向设定如下:对二值图像的四连通区域取(dir+3)mod 4,其中mod为模运算,在3*3邻域中搜索到的第一个与当前像素相同的像素点作为新的边界点A n,同时更新变量dir作为新的扫描方向值; Step 3. Search the 3 * 3 neighborhood of the current pixel in the counterclockwise direction. The initial search direction is set as follows: Take (dir + 3) mod 4 for the four connected areas of the binary image, where mod is the modulo operation. The first pixel point in the 3 * 3 neighborhood that is the same as the current pixel is used as the new boundary point A n , and the variable dir is updated as the new scanning direction value;
步骤4,如果新的边界点A n等于第二个边界点A 1,且前一个边界点A n-1等于第一个边界点A 0,则停止搜索并结束跟踪边界点,否则重复步骤3继续搜索下一个边界点; Step 4. If the new boundary point A n is equal to the second boundary point A 1 and the previous boundary point A n-1 is equal to the first boundary point A 0 , then stop searching and end the tracking of the boundary points, otherwise repeat step 3 Continue to search for the next boundary point;
步骤5,由跟踪的边界点A 0、A 1、A 2、……、A n-2构成的边界即为舌体轮廓线。 In step 5, the boundary formed by the tracked boundary points A 0 , A 1 , A 2 ,..., A n-2 is the contour line of the tongue.
进一步地,所述根据舌体轮廓线计算舌体质心的步骤包括如下步骤:采用一个零阶矩来计算二值图像的面积,所述零阶矩表示为:
Figure 499266dest_path_image001
,其中
Figure 317049dest_path_image002
表示像素点在二值图像在(i,j)点上的灰度值,M 00是二值图像中白色区域灰度值的总和;
Further, the step of calculating the center of mass of the tongue according to the contour of the tongue includes the following steps: using a zero-order moment to calculate the area of the binary image, the zero-order moment is expressed as
Figure 499266dest_path_image001
,among them
Figure 317049dest_path_image002
Represents the gray value of the pixel at the (i, j) point of the binary image, and M 00 is the sum of the gray values of the white area in the binary image;
采用一阶矩和二值图像的面积M 00计算二值图像的质心作为舌体质心,所述一阶矩表示为:
Figure 378546dest_path_image003
Figure 131738dest_path_image004
,其中M 10是二值图像上所有白色区域x坐标值的累加和,M 01是二值图像上所有白色区域y坐标值的累加和;
The first-order moment and the area M 00 of the binary image are used to calculate the centroid of the binary image as the center of mass of the tongue. The first-order moment is expressed as:
Figure 378546dest_path_image003
,
Figure 131738dest_path_image004
, Where M 10 is the cumulative sum of the x-coordinate values of all white areas on the binary image, and M 01 is the cumulative sum of the y-coordinate values of all white areas on the binary image;
根据如下公式:
Figure 544265dest_path_image005
Figure 165739dest_path_image006
,计算二值图像的质心作为舌体质心,其中x c和y c是二值图像的质心坐标(x c,y c)。
According to the following formula:
Figure 544265dest_path_image005
,
Figure 165739dest_path_image006
, Calculate the centroid of the binary image as the tongue centroid, where x c and y c are the centroid coordinates (x c , y c ) of the binary image.
进一步地,所述根据舌体轮廓线计算舌体轮廓凸包作为近似舌体齿痕轮廓线的步骤包括如下步骤:将舌体轮廓线中点集里面的n个点两两配对,组成n(n-1)/2条直线;对于任一两点确定的每条直线,遍历该两点剩余之外(n-2)个点是否在该条直线的同一侧,如果存在于该条直线一侧的点,则将该点加入到凸包集合,直到所有直线都被遍历完毕为止,并将凸包集合作为近似舌体齿痕轮廓线。Further, the step of calculating the tongue contour convex hull as the approximate tongue tooth mark contour based on the tongue contour line includes the following steps: pairing n points in the point set in the tongue contour line pairwise to form n ( n-1) / 2 straight lines; for each straight line determined by any two points, traverse whether the remaining (n-2) points of the two points are on the same side of the straight line, if it exists on the straight line Point on the side, the point is added to the convex hull set until all straight lines have been traversed, and the convex hull set is used as an approximate tongue tooth contour line.
进一步地,所述根据舌体轮廓线计算舌体轮廓凸包作为近似舌体齿痕轮廓线的步骤包括如下步骤:假设近似舌体齿痕轮廓线上共有m个点,将每相邻两点相连构成m条直线,m条边中每条直线L的两个端点在舌体轮廓线相对应的两个端点之间在舌体轮廓线上有p个点,分别计算这p个点到直线L的距离,其中最大距离记为D;如果最大距离D大于预定义的阈值θ,则标记这p个点所对应的区域存在齿痕,并保存对应为最大距离D所对应的点C为齿痕位置。Further, the step of calculating the tongue contour convex hull as the approximate tongue tooth mark contour line according to the tongue body contour line includes the following steps: assuming that there are m points on the approximate tongue tooth mark contour line, each adjacent two points Connected to form m straight lines, the two endpoints of each straight line L in the m edges have p points on the tongue contour line between the two corresponding ends of the tongue contour line. Calculate the p points to the straight line respectively The distance of L, where the maximum distance is recorded as D; if the maximum distance D is greater than a predefined threshold θ, mark the area corresponding to the p points as having tooth marks, and save the point C corresponding to the maximum distance D as the tooth Mark position.
另一方面,本发明还提供一种基于舌体轮廓线的舌体齿痕识别方法,应用于舌体齿痕识别装置中,该方法包括如下步骤:On the other hand, the present invention also provides a tongue tooth mark recognition method based on the tongue outline, which is applied to a tongue tooth mark recognition device. The method includes the following steps:
通过输入单元输入舌体图像,并对舌体图像进行灰度转化生成灰度图片;Input a tongue image through an input unit, and perform grayscale conversion on the tongue image to generate a grayscale image;
对灰度图片二值化生成二值图像;Binarize grayscale pictures to generate binary images;
对二值图像进行图像轮廓跟踪处理生成舌体轮廓线;Image contour tracking processing on binary images to generate tongue contour lines;
根据舌体轮廓线计算舌体质心;Calculate the center of mass of the tongue according to the contour of the tongue;
根据舌体质心确定舌根边界区域;Determine the tongue root boundary area according to the center of mass of the tongue;
根据舌体轮廓线计算舌体轮廓凸包作为近似舌体齿痕轮廓线;Calculate the convex contour of the tongue according to the contour of the tongue as the approximate contour of the tongue teeth;
根据舌体轮廓线和近似舌体齿痕轮廓线之间的最大距离确定齿痕位置;Determine the position of the tooth mark according to the maximum distance between the outline of the tongue and the outline of the approximate tooth mark;
判断舌根轮廓处是否存在齿痕;Determine whether there are tooth marks at the contour of the tongue base;
若舌根轮廓处存在齿痕,则删除舌根轮廓处的齿痕;If there are tooth marks on the outline of the tongue, delete the tooth marks on the outline of the tongue;
根据确定的齿痕位置在舌体图像上标记为舌体齿痕,最终生成标记有齿痕位置的舌体图像。According to the determined tooth mark positions, the tongue body marks are marked as tongue tooth marks, and a tongue body image marked with the tooth mark positions is finally generated.
进一步地,所述对二值图像进行图像轮廓跟踪处理生成舌体轮廓线的步骤包括:Further, the step of performing image contour tracking processing on the binary image to generate a contour line of the tongue includes:
步骤1,按照从上到下、从左到右的顺序扫描二值图像,寻找第一个边界起始点A 0作为当前边界点,其中A 0是具有最小行和边界点列的边界点; Step 1. Scan the binary image in order from top to bottom and left to right, and find the first boundary starting point A 0 as the current boundary point, where A 0 is the boundary point with the smallest row and the boundary point column;
步骤2,定义一个扫描方向变量dir,该变量用于记录步骤1中沿着前一个边界点到当前边界点的移动方向,该变量的初始化取值为对二值图像的四连通区域取dir=3;Step 2. Define a scanning direction variable dir. This variable is used to record the moving direction along the previous boundary point to the current boundary point in step 1. The initialization value of this variable is dir = 3;
步骤3,按逆时针方向搜索当前象素的3*3邻域,起始搜索方向设定如下:对二值图像的四连通区域取(dir+3)mod 4,其中mod为模运算,在3*3邻域中搜索到的第一个与当前像素相同的像素点作为新的边界点A n,同时更新变量dir作为新的扫描方向值; Step 3. Search the 3 * 3 neighborhood of the current pixel in the counterclockwise direction. The initial search direction is set as follows: Take (dir + 3) mod 4 for the four connected areas of the binary image, where mod is the modulo operation. The first pixel point in the 3 * 3 neighborhood that is the same as the current pixel is used as the new boundary point A n , and the variable dir is updated as the new scanning direction value;
步骤4,如果新的边界点A n等于第二个边界点A 1,且前一个边界点A n-1等于第一个边界点A 0,则停止搜索并结束跟踪边界点,否则重复步骤3继续搜索下一个边界点; Step 4. If the new boundary point A n is equal to the second boundary point A 1 and the previous boundary point A n-1 is equal to the first boundary point A 0 , then stop searching and end the tracking of the boundary points, otherwise repeat step 3 Continue to search for the next boundary point;
步骤5,由跟踪的边界点A 0、A 1、A 2、……、A n-2构成的边界即为舌体轮廓线。 In step 5, the boundary formed by the tracked boundary points A 0 , A 1 , A 2 ,..., A n-2 is the contour line of the tongue.
进一步地,所述根据舌体轮廓线计算舌体质心的步骤包括如下步骤:采用一个零阶矩来计算二值图像的面积,所述零阶矩表示为:
Figure 347322dest_path_image007
,其中
Figure 536995dest_path_image008
表示像素点在二值图像在(i,j)点上的灰度值,M 00是二值图像中白色区域灰度值的总和;
Further, the step of calculating the center of mass of the tongue according to the contour of the tongue includes the following steps: using a zero-order moment to calculate the area of the binary image, the zero-order moment is expressed as
Figure 347322dest_path_image007
,among them
Figure 536995dest_path_image008
Represents the gray value of the pixel at the (i, j) point of the binary image, and M 00 is the sum of the gray values of the white area in the binary image;
采用一阶矩和二值图像的面积M 00计算二值图像的质心作为舌体质心,所述一阶矩表示为:
Figure 905659dest_path_image009
Figure 471770dest_path_image010
,其中M 10是二值图像上所有白色区域x坐标值的累加和,M 01是二值图像上所有白色区域y坐标值的累加和;
The first-order moment and the area M 00 of the binary image are used to calculate the centroid of the binary image as the center of mass of the tongue. The first-order moment is expressed as:
Figure 905659dest_path_image009
,
Figure 471770dest_path_image010
, Where M 10 is the cumulative sum of the x-coordinate values of all white areas on the binary image, and M 01 is the cumulative sum of the y-coordinate values of all white areas on the binary image;
根据如下公式:
Figure 366913dest_path_image011
Figure 727488dest_path_image012
,计算二值图像的质心作为舌体质心,其中x c和y c是二值图像的质心坐标。
According to the following formula:
Figure 366913dest_path_image011
,
Figure 727488dest_path_image012
, Calculate the centroid of the binary image as the tongue centroid, where x c and y c are the coordinates of the centroid of the binary image.
进一步地,所述根据舌体轮廓线计算舌体轮廓凸包作为近似舌体齿痕轮廓线的步骤包括如下步骤:将舌体轮廓线中点集里面的n个点两两配对,组成n(n-1)/2条直线;对于任一两点确定的每条直线,遍历该两点剩余之外(n-2)个点是否在该条直线的同一侧,如果存在于该条直线一侧的点,则将该点加入到凸包集合,直到所有直线都被遍历完毕为止,并将凸包集合作为近似舌体齿痕轮廓线。Further, the step of calculating the tongue contour convex hull as the approximate tongue tooth mark contour based on the tongue contour line includes the following steps: pairing n points in the point set in the tongue contour line pairwise to form n ( n-1) / 2 straight lines; for each straight line determined by any two points, traverse whether the remaining (n-2) points of the two points are on the same side of the straight line, if it exists on the straight line Point on the side, the point is added to the convex hull set until all straight lines have been traversed, and the convex hull set is used as an approximate tongue tooth contour line.
进一步地,所述根据舌体轮廓线计算舌体轮廓凸包作为近似舌体齿痕轮廓线的步骤包括如下步骤:假设近似舌体齿痕轮廓线上共有m个点,将每相邻两点相连构成m条直线,m条边中每条直线L的两个端点在舌体轮廓线相对应的两个端点之间在舌体轮廓线上有p个点,分别计算这p个点到直线L的距离,其中最大距离记为D;如果最大距离D大于预定义的阈值θ,则标记这p个点所对应的区域存在齿痕,并保存对应为最大距离D所对应的点C为齿痕位置。Further, the step of calculating the tongue contour convex hull as the approximate tongue tooth mark contour line according to the tongue body contour line includes the following steps: assuming that there are m points on the approximate tongue tooth mark contour line, each adjacent two points Connected to form m straight lines, the two endpoints of each straight line L in the m edges have p points on the tongue contour line between the two corresponding ends of the tongue contour line. Calculate the p points to the straight line respectively The distance of L, where the maximum distance is recorded as D; if the maximum distance D is greater than a predefined threshold θ, mark the area corresponding to the p points as having tooth marks, and save the point C corresponding to the maximum distance D as the tooth Mark position.
有益效果Beneficial effect
相较于现有技术,本发明所述基于舌体轮廓线的舌体齿痕识别装置及方法能够根据舌体轮廓线的凹凸性来判别齿痕,由于齿痕舌体的轮廓线在齿痕处会形成明显的凹陷,因此能够依据轮廓线的凹凸性来判别舌体齿痕数量,本发明识别舌体齿痕的准确度不受舌体周边颜色以及舌体边界曲线毛刺的影响,因此能够提高舌体齿痕识别的准确度。Compared with the prior art, the tongue tooth mark recognition device and method based on the tongue outline of the present invention can determine tooth marks based on the unevenness of the tongue outline, because the tooth outline of the tongue is in the tooth mark Obvious depressions will be formed everywhere, so the number of tongue tooth marks can be judged according to the unevenness of the contour line. The accuracy of identifying tongue tooth marks of the present invention is not affected by the color of the tongue periphery and the burr of the tongue boundary curve. Improve the accuracy of tongue tooth mark recognition.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是本发明基于舌体轮廓线的舌体齿痕识别装置的优选实施例的方框示意图;1 is a schematic block diagram of a preferred embodiment of a tongue tooth mark recognition device based on a tongue contour line of the present invention;
图2是本发明基于舌体轮廓线的舌体齿痕识别方法优选实施例的方法流程图;2 is a method flowchart of a preferred embodiment of a tongue tooth mark recognition method based on a tongue contour line of the present invention;
图3是本发明基于舌体轮廓线的舌体齿痕识别的过程示意图。FIG. 3 is a schematic diagram of a tongue tooth mark recognition process based on a tongue contour line according to the present invention.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the purpose, functional characteristics and advantages of the present invention will be further explained with reference to the embodiments and the drawings.
本发明的实施方式Embodiments of the invention
为更进一步阐述本发明为达成预定发明目的所采取的技术手段及功效,以下结合附图及较佳实施例,对本发明的具体实施方式、结构、特征及其功效,详细说明如下。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to further explain the technical means and effects adopted by the present invention to achieve the intended purpose of the present invention, the following describes the specific implementation, structure, features, and effects of the present invention in detail with reference to the accompanying drawings and preferred embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
参照图1所示,图1是本发明基于舌体轮廓线的舌体齿痕识别装置的优选实施例的方框示意图。在本实施例中,所述基于舌体轮廓线的舌体齿痕识别装置1安装有基于舌体轮廓线的舌体齿痕识别系统10,所述基于舌体轮廓线的舌体齿痕识别装置1可以为安装有基于舌体轮廓线的舌体齿痕识别系统10的个人计算机、工作站计算机、中医舌像仪等具有数据处理功能和图像处理功能的计算机装置。Referring to FIG. 1, FIG. 1 is a schematic block diagram of a preferred embodiment of a tongue tooth mark recognition device based on a tongue contour line of the present invention. In this embodiment, the tongue tooth mark recognition device 1 based on the tongue outline is installed with a tongue tooth mark recognition system 10 based on the tongue outline, and the tongue tooth mark recognition based on the tongue outline The device 1 may be a computer device having a data processing function and an image processing function, such as a personal computer, a workstation computer, a traditional Chinese medicine tongue imager, and the like, which are equipped with the tongue tooth mark recognition system 10 based on the tongue contour line.
在本实施例中,所述基于舌体轮廓线的舌体齿痕识别装置1包括,但不仅限于,基于舌体轮廓线的舌体齿痕识别系统10、输入单元11、适于存储多条计算机程序指令的存储器12、执行各种计算机程序指令的处理器13以及输出单元14。所述输入单元11为一种诸如键盘、鼠标、摄像头等输入设备,用于输入包含患者舌体的舌体图像至舌体齿痕识别装置1中。所述存储器12可以为一种只读存储器ROM,随机存储器RAM、电可擦写存储器EEPROM、快闪存储器FLASH、磁盘或光盘等。所述处理器13为一种中央处理器(CPU)、微控制器(MCU)、数据处理芯片、或者具有数据处理功能的信息处理单元。所述输出单元14可以为一种用于显示舌体图像的显示屏,也可以为一种用于打印舌体图像的打印机。In this embodiment, the tongue tooth mark recognition device 1 based on the tongue outline includes, but is not limited to, a tongue tooth mark recognition system 10 based on the tongue outline, an input unit 11, and is adapted to store a plurality of A computer program instruction memory 12, a processor 13 executing various computer program instructions, and an output unit 14. The input unit 11 is an input device such as a keyboard, a mouse, a camera, and the like, and is configured to input a tongue image including a tongue of a patient into the tongue tooth mark recognition device 1. The memory 12 may be a read-only memory ROM, a random access memory RAM, an electrically erasable memory EEPROM, a flash memory FLASH, a magnetic disk, or an optical disk. The processor 13 is a central processing unit (CPU), a microcontroller (MCU), a data processing chip, or an information processing unit having a data processing function. The output unit 14 may be a display screen for displaying a tongue image, or a printer for printing a tongue image.
在本实施例中,所述基于舌体轮廓线的舌体齿痕识别系统10由多条计算机程序指令组成的程序模块组成,包括但不局限于,舌体图像处理模块101、舌体轮廓线提取模块102、舌体质心计算模块103、舌根边界确定模块104、齿痕轮廓确定模块105以及舌体齿痕识别模块106。本发明所称的模块是指一种能够被基于舌体轮廓线的舌体齿痕识别装置1的处理器13执行并且能够完成固定功能的一系列计算机程序指令段,其存储在存储器12中,以下结合图2具体说明每一个模块的具体功能。In this embodiment, the tongue tooth mark recognition system 10 based on the tongue outline is composed of a plurality of program modules composed of computer program instructions, including, but not limited to, a tongue image processing module 101 and a tongue outline The extraction module 102, the tongue centroid calculation module 103, the tongue root boundary determination module 104, the tooth mark contour determination module 105, and the tongue tooth mark recognition module 106. The module referred to in the present invention refers to a series of computer program instruction segments that can be executed by the processor 13 of the tongue tooth mark recognition device 1 based on the tongue contour line and can complete a fixed function, and is stored in the memory 12, The specific functions of each module are described in detail below with reference to FIG. 2.
参考图2所示,是本发明基于舌体轮廓线的舌体齿痕识别方法优选实施例的流程图。在本实施例中,所述舌体齿痕识别方法的各种方法步骤通过计算机软件程序来实现,该计算机软件程序以计算机程序指令的形式存储于计算机可读存储介质(例如存储器12)中,计算机可读存储介质可以包括:只读存储器、随机存储器、磁盘或光盘等,所述计算机程序指令能够被处理器(例如处理器13)加载并执行如下步骤S21至步骤S30。Referring to FIG. 2, it is a flowchart of a preferred embodiment of a tongue tooth mark recognition method based on a tongue contour line of the present invention. In this embodiment, various method steps of the tongue body tooth mark recognition method are implemented by a computer software program, and the computer software program is stored in a computer readable storage medium (such as the memory 12) in the form of computer program instructions, The computer-readable storage medium may include a read-only memory, a random access memory, a magnetic disk, or an optical disk, and the computer program instructions can be loaded by a processor (for example, the processor 13) and execute steps S21 to S30 as follows.
步骤S21,通过输入单元输入舌体图像,并对舌体图像进行灰度转化生成灰度图片;具体地,舌体图像处理模块101通过输入单元11(例如高清摄像设备)从患者嘴部摄取清晰的舌体图像,或者从预先存储在存储器12中的舌体图像,该舌体图像为一种由R、G、B三通道组成的彩色舌体RGB图像,并将对舌体RGB图像进行灰度转化生成灰度图片,如图3的a图所示。In step S21, a tongue image is input through the input unit, and the tongue image is converted into a grayscale image. Specifically, the tongue image processing module 101 takes in a clear image from the patient's mouth through the input unit 11 (such as a high-definition camera) Or a tongue image stored in the memory 12 in advance, the tongue image is a color tongue RGB image composed of three channels of R, G, and B, and the tongue RGB image is grayed out. Degree conversion generates a grayscale picture, as shown in Figure a in Figure 3.
步骤S22,对灰度图片二值化生成二值图像,并对二值图像进行舌体形态学变换除去黑色小块。在本实施例中,舌体图像处理模块101对灰度图片(如图3的a图所示)二值化生成二值图像,并对二值图像进行舌体形态学变换除去黑色小块(如图3的b图所示),以去除舌体图像中的杂质得到无杂质的二值图像,如图3的c图所示。Step S22: Binarize the grayscale image to generate a binary image, and perform tongue morphological transformation on the binary image to remove small black blocks. In this embodiment, the tongue image processing module 101 binarizes a grayscale picture (as shown in FIG. 3 a) to generate a binary image, and performs tongue morphological transformation on the binary image to remove small black blocks ( (Shown in Figure 3b), to remove the impurities in the tongue image to obtain a binary image without impurities, as shown in Figure 3c.
步骤S23,对二值图像进行图像轮廓跟踪处理生成舌体轮廓线;在本实施例中,舌体轮廓线提取模块102对二值图像进行图像轮廓跟踪处理生成舌体轮廓线(如图3的d图所示),包括如下步骤:步骤1,首先按从上到下、从左到右的顺序扫描二值图像,寻找没有标记跟踪结束记号的第一个边界起始点A 0作为当前边界点,其中A 0是具有最小行和边界点列的边界点;步骤2,定义一个扫描方向变量dir,该变量用于记录步骤1中沿着前一个边界点到当前边界点的移动方向,该变量的初始化取值为对四连通区域取dir=3;步骤3,按逆时针方向搜索当前象素的3*3邻域,其起始搜索方向设定如下:对四连通区域取(dir+3)mod 4,其中mod为模运算,在3*3邻域中搜索到的第一个与当前像素相同的像素点作为新的边界点A n,同时更新变量dir作为新的扫描方向值;步骤4,如果A n等于第二个边界点A 1,且前一个边界点A n-1等于第一个边界点A 0,则停止搜索并结束跟踪边界点,否则重复步骤3继续搜索下一个边界点;步骤5,由跟踪的边界点A 0、A 1、A 2、……、A n-2构成的边界即为舌体轮廓线。 Step S23: Image contour tracking processing is performed on the binary image to generate tongue contour lines. In this embodiment, the tongue contour extraction module 102 performs image contour tracking processing on the binary images to generate tongue contour lines (as shown in FIG. 3). (shown in Figure d), including the following steps: Step 1. First, scan the binary image in order from top to bottom and left to right, and find the first boundary starting point A 0 without the tracking end mark as the current boundary point. , Where A 0 is the boundary point with the smallest row and the boundary point column; Step 2, define a scanning direction variable dir, which is used to record the moving direction along the previous boundary point to the current boundary point in Step 1, this variable The initial value of is dir = 3 for the four-connected area; Step 3, the 3 * 3 neighborhood of the current pixel is searched in the counterclockwise direction, and the initial search direction is set as follows: (dir + 3 for the four-connected area) ) Mod 4, where mod is a modulo operation, the first pixel point that is the same as the current pixel searched in the 3 * 3 neighborhood is used as the new boundary point A n , and the variable dir is updated as the new scanning direction value; steps 4, if A n, etc. The second boundary point A 1, and a front boundary point A n-1 is equal to a first boundary point A 0, the search is stopped and ends the track boundary, a boundary point or the repeat step 3 to continue the search; Step 5, starting from The boundary formed by the tracked boundary points A 0 , A 1 , A 2 , ..., A n-2 is the contour line of the tongue.
步骤S24,根据舌体轮廓线计算舌体质心;在本实施例中,舌体质心计算模块103根据舌体轮廓线计算舌体质心,具体算法如下:采用一个零阶矩来计算二值图像的面积(包括轮廓、连通域),零阶矩表示为:
Figure 583448dest_path_image013
,其中二值图像是单通道图像,
Figure 953250dest_path_image014
表示像素点在二值图像在(i,j)点上的灰度值,
Figure 843845dest_path_image015
只有0(黑色)与1(白色)两个值,M 00是这个二值图像中白色区域灰度值的总和,因此M 00可以用来求二值图像(包括轮廓,连通域)的面积;采用一阶矩和二值图像的面积M 00计算二值图像的质心作为舌体质心,其中一阶矩表示为:
Figure 234375dest_path_image016
Figure 843211dest_path_image017
,其中M 10是二值图像上所有白色区域x坐标值的累加和,M 01是二值图像上所有白色区域y坐标值的累加和,舌体质心计算模块103根据如下公式:
Figure 16704dest_path_image018
Figure 496226dest_path_image019
计算二值图像的质心(如图3的e图所示的中心点)作为舌体质心,其中x c和y c是二值图像的质心坐标。
In step S24, the tongue body centroid is calculated according to the tongue body contour line. In this embodiment, the tongue body centroid calculation module 103 calculates the tongue body centroid according to the tongue body contour line. The specific algorithm is as follows: a zero-order moment is used to calculate the Area (including contour and connected domain), the zero-order moment is expressed as:
Figure 583448dest_path_image013
, Where the binary image is a single-channel image,
Figure 953250dest_path_image014
Represents the gray value of the pixel at the (i, j) point of the binary image.
Figure 843845dest_path_image015
There are only two values of 0 (black) and 1 (white). M 00 is the sum of the gray values of the white area in the binary image. Therefore, M 00 can be used to find the area of the binary image (including the contour and the connected domain). The first-order moment and the area M 00 of the binary image are used to calculate the centroid of the binary image as the center of mass of the tongue. The first-order moment is expressed as:
Figure 234375dest_path_image016
,
Figure 843211dest_path_image017
, Where M 10 is the cumulative sum of the x-coordinate values of all white areas on the binary image, and M 01 is the cumulative sum of the y-coordinate values of all white areas on the binary image. The tongue body centroid calculation module 103 is based on the following formula:
Figure 16704dest_path_image018
,
Figure 496226dest_path_image019
Calculate the centroid of the binary image (the center point shown in Figure e of Fig. 3) as the tongue centroid, where x c and y c are the centroid coordinates of the binary image.
步骤S25,根据舌体质心确定舌根边界区域;在本实施例中,舌根边界确定模块104将与舌体质心竖直方向的左右夹角分别为50°所对应的舌根处轮廓线围成的舌体上半部分区域作为舌根边界区域。由于舌根边界区域出现的边界点不构成舌体齿痕,因此舌根边界区域不进行齿痕识别,所以需要将舌根边界区域的齿痕删除掉,提高舌体齿痕识别的准确性。根据舌根在舌体的结构位置可以统计表明,作为优先实施例,本发明将与舌体质心竖直方向的左右夹角分别为50°(如图3的f图所示)所对应的舌根处轮廓线围成的舌体上半部分区域作为舌根边界区域。In step S25, the tongue root boundary area is determined according to the center of mass of the tongue. In this embodiment, the tongue root boundary determination module 104 surrounds the tongue formed by the contour lines of the tongue root corresponding to the left and right angles of the vertical center of mass of the tongue with 50 ° The upper half of the body serves as the border area of the tongue base. Because the boundary points appearing in the root region of the tongue do not constitute tongue tooth marks, the tooth root boundary region does not perform tooth mark recognition. Therefore, it is necessary to delete the tooth marks in the tongue root border region to improve the accuracy of tongue tooth mark recognition. According to the structural position of the tongue base on the tongue body, it can be statistically shown that, as a preferred embodiment, the left and right angles between the vertical direction of the center of mass of the tongue body and the left and right sides are respectively 50 ° (as shown in FIG. 3 f). The upper half of the tongue surrounded by the contour line is used as the tongue root boundary area.
步骤S26,根据舌体轮廓线计算舌体轮廓凸包,作为近似舌体齿痕轮廓线;在本实施例中,齿痕轮廓确定模块105将舌体轮廓线中点集里面的所有点(假设共有n个点)两两配对(两点确定一条直线),组成n(n-1)/2条直线;对于任一两点确定的每条直线,遍历该两点剩余之外(n-2)个点是否在该条直线的同一侧,如果存在该条直线一侧的点,则将该点加入到凸包集合,直到所有直线都被遍历完毕为止,并将凸包集合作为近似舌体齿痕轮廓线,如图3的g图所示的凸起部分的轮廓线。In step S26, the convex contour of the tongue contour is calculated according to the contour of the tongue, as the approximate contour of the tooth marks of the tongue. In this embodiment, the tooth contour determining module 105 sets all points in the set of points in the contour of the tongue (assuming A total of n points) are paired in pairs (two points determine a straight line) to form n (n-1) / 2 straight lines; for each straight line determined by any two points, traverse the remaining two points (n-2 ) Whether the points are on the same side of the line, if there is a point on one side of the line, add the point to the convex hull set until all the lines have been traversed, and use the convex hull set as the approximate tongue The contour line of the tooth mark is the contour line of the convex portion as shown in FIG. 3g.
步骤S27,根据舌体轮廓线和近似舌体齿痕轮廓线之间的最大距离确定齿痕位置;在本实施例中,舌体齿痕识别模块106根据舌体轮廓线和近似舌体齿痕轮廓线之间的最大距离确定齿痕位置。具体地,假设近似舌体齿痕轮廓线上共有m个点,每相邻两点相连则构成m条直线,m条边中每条直线L的两个端点在舌体轮廓线相对应的两个端点之间在舌体轮廓线上可能有p个点,分别计算这p个点到直线L的距离,其中最大距离记为D,如果最大距离D大于某个预定义的阈值θ,则标记这p个点所对应的区域存在齿痕,并保存对应为最大距离D所对应的点C为齿痕位置,如图3的h图所示舌体轮廓线上的四个白点。In step S27, the position of the tooth mark is determined according to the maximum distance between the contour line of the tongue and the contour line of the approximate tongue tooth mark. In this embodiment, the tongue tooth mark recognition module 106 is based on the tongue contour line and the approximate tongue tooth mark. The maximum distance between the contour lines determines the position of the tooth marks. Specifically, it is assumed that there are m points on the contour line of the approximate tongue tooth mark, and each adjacent two points are connected to form m straight lines. The two endpoints of each straight line L in the m edges are at the two points corresponding to the contour line of the tongue. There may be p points between the end points on the contour of the tongue. Calculate the distance from the p points to the straight line L, where the maximum distance is recorded as D. If the maximum distance D is greater than a predefined threshold θ, then mark There are tooth marks in the area corresponding to the p points, and the point C corresponding to the maximum distance D is stored as the tooth mark position, as shown in FIG. 3 h, four white points on the contour line of the tongue.
步骤S28,判断舌根轮廓处是否存在齿痕;在本实施例中,舌体齿痕识别模块106判断舌根轮廓处是否存在齿痕。若舌根轮廓处存在齿痕,则流程先执行步骤S28再执行步骤S29;若舌根轮廓处不存在齿痕,则流程直接执行步骤S29。具体地,舌体齿痕识别模块106判断点C是否存在于舌根边界区域,若点C存在于舌根边界区域,则将该点C位置排除为非齿痕;若点C不存在于舌根边界区域,则根据点C所确定的位置在舌体图像上标记为齿痕,如图3的h图所示舌体轮廓线上的四个白点。In step S28, it is determined whether a tooth mark exists at the contour of the tongue base. In this embodiment, the tongue tooth mark recognition module 106 determines whether a tooth mark exists at the contour of the tongue base. If there is a tooth mark at the contour of the tongue root, the process first performs step S28 and then step S29; if there is no tooth mark at the contour of the tongue root, the process directly performs step S29. Specifically, the tongue tooth mark recognition module 106 determines whether the point C exists in the tongue root boundary area, and if the point C exists in the tongue root boundary area, the position of the point C is excluded as a non-tooth mark; if the point C does not exist in the tongue root boundary area , Mark the tooth marks on the tongue image based on the position determined by point C, as shown in Figure 3 h, four white points on the contour line of the tongue.
步骤S29,删除舌根轮廓处的齿痕;在本实施例中,若舌体齿痕识别模块106确定舌根轮廓处存在齿痕,则删除舌根轮廓处的齿痕。具体地,若点C存在于舌根边界区域,则舌体齿痕识别模块106将该点C位置排除为非齿痕,即将点C从舌根轮廓处删除。In step S29, the tooth marks at the outline of the tongue base are deleted. In this embodiment, if the tongue tooth mark recognition module 106 determines that there are tooth marks at the tongue root outline, delete the tooth marks at the tongue root outline. Specifically, if the point C exists in the boundary area of the tongue root, the tongue tooth mark recognition module 106 excludes the position of the point C as a non-tooth mark, that is, the point C is deleted from the contour of the tongue root.
步骤S30,根据确定的齿痕位置在舌体图像上标记为舌体齿痕,最终生成标记有齿痕位置的舌体图像;在本实施例中,当确定舌根轮廓处不存在齿痕或者确定舌根轮廓处存在齿痕后删除舌根轮廓处的齿痕(即执行步骤S29,后),舌体齿痕识别模块106根据确定的齿痕位置在舌体图像上标记为舌体齿痕,最终生成标记有齿痕位置的舌体图像,如图3的i图所示的标有四个白点的舌体图像。具体地,若点C不存在于舌根边界区域,则根据点C所确定的位置在舌体图像上标记为齿痕。In step S30, the tongue image is marked as a tongue tooth mark on the tongue image according to the determined tooth mark position, and finally a tongue image marked with a tooth mark position is generated. In this embodiment, when it is determined that there is no tooth mark at the contour of the tongue base or it is determined After there are tooth marks on the outline of the tongue, delete the tooth marks on the outline of the tongue (ie, perform step S29, after), the tongue tooth mark recognition module 106 marks the tongue tooth marks on the tongue image according to the determined tooth mark positions, and finally generates The tongue image marked with the position of the tooth marks is shown in FIG. 3 i, the tongue image marked with four white dots. Specifically, if the point C does not exist in the border area of the tongue base, the position determined by the point C is marked as a tooth mark on the tongue image.
此外,所述舌体齿痕识别模块106还通过输出单元14将标记有齿痕位置的舌体图像显示显示屏上,或者通过打印机打印标记有齿痕位置的舌体图像,或者将标记有齿痕位置的舌体图像通过通信网络发送至医生终端,供医生查看患者的齿痕舌信息以及形成情况,从而辅助医生进行中医舌诊获得患者的健康状况。In addition, the tongue tooth mark recognition module 106 also displays the tongue image marked with the tooth mark position on the display screen through the output unit 14, or prints the tongue image marked with the tooth mark position through a printer, or marks the tooth mark The tongue body image at the mark position is sent to the doctor's terminal through the communication network, so that the doctor can check the patient's tooth mark tongue information and formation status, thereby assisting the doctor in the TCM tongue diagnosis to obtain the health status of the patient.
本发明还一种计算机可读存储介质,该计算机可读存储介质存储多条计算机程序指令,所述计算机程序指令由计算机装置的处理器加载并执行本发明所述基于舌体轮廓线的舌体齿痕识别方法的各个步骤。本领域技术人员可以理解,上述实施方式中各种方法的全部或部分步骤可以通过相关程序指令完成,该程序可以存储于计算机可读存储介质中,存储介质可以包括:只读存储器、随机存储器、磁盘或光盘等。The present invention also provides a computer-readable storage medium. The computer-readable storage medium stores a plurality of computer program instructions. The computer program instructions are loaded by a processor of a computer device and execute the tongue body based on the tongue contour line of the present invention. Steps of the tooth mark recognition method. Those skilled in the art may understand that all or part of the steps of the various methods in the foregoing embodiments may be completed by related program instructions. The program may be stored in a computer-readable storage medium. The storage medium may include a read-only memory, a random access memory, Disk or CD, etc.
本发明所述基于舌体轮廓线的舌体齿痕识别装置及方法能够根据舌体轮廓线的凹凸性来判别齿痕,由于齿痕舌体的轮廓线在齿痕处会形成明显的凹陷,因此能够依据轮廓线的凹凸性来判别舌体齿痕数量,本发明识别舌体齿痕的准确度不受舌体周边颜色以及舌体边界曲线毛刺的影响,因此能够提高舌体齿痕识别的准确度。The tongue tooth mark recognition device and method based on the tongue outline of the present invention can judge tooth marks based on the unevenness of the tongue outline. Since the tooth outline of the tongue will form a significant depression at the tooth mark, Therefore, the number of tongue tooth marks can be judged according to the unevenness of the contour line. The accuracy of the tongue tooth mark recognition of the present invention is not affected by the tongue peripheral color and the tongue boundary curve burr, so the tongue tooth mark recognition Accuracy.
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。。The above are only preferred embodiments of the present invention, and thus do not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the description and drawings of the present invention, or directly or indirectly used in other related technical fields All are included in the patent protection scope of the present invention. .
工业实用性Industrial applicability
相较于现有技术,本发明所述基于舌体轮廓线的舌体齿痕识别装置及方法能够根据舌体轮廓线的凹凸性来判别齿痕,由于齿痕舌体的轮廓线在齿痕处会形成明显的凹陷,因此能够依据轮廓线的凹凸性来判别舌体齿痕数量,本发明识别舌体齿痕的准确度不受舌体周边颜色以及舌体边界曲线毛刺的影响,因此能够提高舌体齿痕识别的准确度。Compared with the prior art, the tongue tooth mark recognition device and method based on the tongue outline of the present invention can determine tooth marks based on the unevenness of the tongue outline, because the tooth outline of the tongue is in the tooth mark Obvious depressions will be formed everywhere, so the number of tongue tooth marks can be judged according to the unevenness of the contour line. The accuracy of identifying tongue tooth marks of the present invention is not affected by the color of the tongue periphery and the burr of the tongue boundary curve. Improve the accuracy of tongue tooth mark recognition.

Claims (10)

  1. 一种基于舌体轮廓线的舌体齿痕识别装置,包括适于实现各种计算机程序指令的处理器以及适于存储多条计算机程序指令的存储器,其特征在于,所述计算机程序指令由处理器加载并执行如下步骤:A tongue tooth mark recognition device based on a tongue contour line includes a processor suitable for implementing various computer program instructions and a memory suitable for storing a plurality of computer program instructions, wherein the computer program instructions are processed by The loader performs the following steps:
    通过输入单元输入舌体图像,并对舌体图像进行灰度转化生成灰度图片;Input a tongue image through an input unit, and perform grayscale conversion on the tongue image to generate a grayscale image;
    对灰度图片二值化生成二值图像;Binarize grayscale pictures to generate binary images;
    对二值图像进行图像轮廓跟踪处理生成舌体轮廓线;Image contour tracking processing on binary images to generate tongue contour lines;
    根据舌体轮廓线计算舌体质心;Calculate the center of mass of the tongue according to the contour of the tongue;
    根据舌体质心确定舌根边界区域;Determine the tongue root boundary area according to the center of mass of the tongue;
    根据舌体轮廓线计算舌体轮廓凸包作为近似舌体齿痕轮廓线;Calculate the convex contour of the tongue according to the contour of the tongue as the approximate contour of the tongue teeth;
    根据舌体轮廓线和近似舌体齿痕轮廓线之间的最大距离确定齿痕位置;Determine the position of the tooth mark according to the maximum distance between the outline of the tongue and the outline of the approximate tooth mark;
    判断舌根轮廓处是否存在齿痕;Determine whether there are tooth marks at the contour of the tongue base;
    若舌根轮廓处存在齿痕,则删除舌根轮廓处的齿痕;If there are tooth marks on the outline of the tongue, delete the tooth marks on the outline of the tongue;
    根据确定的齿痕位置在舌体图像上标记为舌体齿痕,最终生成标记有齿痕位置的舌体图像。According to the determined tooth mark positions, the tongue body marks are marked as tongue tooth marks, and a tongue body image marked with the tooth mark positions is finally generated.
  2. 如权利要求1所述的基于舌体轮廓线的舌体齿痕识别装置,其特征在于,所述对二值图像进行图像轮廓跟踪处理生成舌体轮廓线的步骤包括:The tongue tooth mark recognition device based on the tongue contour line according to claim 1, wherein the step of performing image contour tracking processing on the binary image to generate the tongue contour line comprises:
    步骤1,按照从上到下、从左到右的顺序扫描二值图像,寻找第一个边界起始点A 0作为当前边界点,其中A 0是具有最小行和边界点列的边界点; Step 1. Scan the binary image in order from top to bottom and left to right, and find the first boundary starting point A 0 as the current boundary point, where A 0 is the boundary point with the smallest row and the boundary point column;
    步骤2,定义一个扫描方向变量dir,该变量用于记录步骤1中沿着前一个边界点到当前边界点的移动方向,该变量的初始化取值为对二值图像的四连通区域取dir=3;Step 2. Define a scanning direction variable dir. This variable is used to record the moving direction along the previous boundary point to the current boundary point in step 1. The initialization value of this variable is dir = 3;
    步骤3,按逆时针方向搜索当前象素的3*3邻域,起始搜索方向设定如下:对二值图像的四连通区域取(dir+3)mod 4,其中mod为模运算,在3*3邻域中搜索到的第一个与当前像素相同的像素点作为新的边界点A n,同时更新变量dir作为新的扫描方向值; Step 3. Search the 3 * 3 neighborhood of the current pixel in the counterclockwise direction. The initial search direction is set as follows: Take (dir + 3) mod 4 for the four connected areas of the binary image, where mod is the modulo operation. The first pixel point in the 3 * 3 neighborhood that is the same as the current pixel is used as the new boundary point A n , and the variable dir is updated as the new scanning direction value;
    步骤4,如果新的边界点A n等于第二个边界点A 1,且前一个边界点A n-1等于第一个边界点A 0,则停止搜索并结束跟踪边界点,否则重复步骤3继续搜索下一个边界点; Step 4. If the new boundary point A n is equal to the second boundary point A 1 and the previous boundary point A n-1 is equal to the first boundary point A 0 , then stop searching and end the tracking of the boundary points, otherwise repeat step 3 Continue to search for the next boundary point;
    步骤5,由跟踪的边界点A 0、A 1、A 2、……、A n-2构成的边界即为舌体轮廓线。 In step 5, the boundary formed by the tracked boundary points A 0 , A 1 , A 2 ,..., A n-2 is the contour line of the tongue.
  3. 如权利要求1所述的基于舌体轮廓线的舌体齿痕识别装置,其特征在于,所述根据舌体轮廓线计算舌体质心的步骤包括如下步骤:The tongue tooth mark recognition device based on the tongue contour line according to claim 1, wherein the step of calculating the tongue center of mass based on the tongue contour line comprises the following steps:
    采用一个零阶矩来计算二值图像的面积,所述零阶矩表示为:
    Figure 261241dest_path_image002
    ,其中
    Figure 357373dest_path_image003
    表示像素点在二值图像在(i,j)点上的灰度值,M 00是二值图像中白色区域灰度值的总和;
    A zero-order moment is used to calculate the area of the binary image, which is expressed as:
    Figure 261241dest_path_image002
    ,among them
    Figure 357373dest_path_image003
    Represents the gray value of the pixel at the (i, j) point of the binary image, and M 00 is the sum of the gray values of the white area in the binary image;
    采用一阶矩和二值图像的面积M 00计算二值图像的质心作为舌体质心,所述一阶矩表示为:
    Figure 131294dest_path_image004
    Figure 996481dest_path_image005
    ,其中M 10是二值图像上所有白色区域x坐标值的累加和,M 01是二值图像上所有白色区域y坐标值的累加和;
    The first-order moment and the area M 00 of the binary image are used to calculate the centroid of the binary image as the center of mass of the tongue. The first-order moment is expressed as:
    Figure 131294dest_path_image004
    ,
    Figure 996481dest_path_image005
    , Where M 10 is the cumulative sum of the x-coordinate values of all white areas on the binary image, and M 01 is the cumulative sum of the y-coordinate values of all white areas on the binary image;
    根据如下公式:
    Figure 728814dest_path_image006
    Figure 312242dest_path_image007
    ,计算二值图像的质心作为舌体质心,其中x c和y c是二值图像的质心坐标。
    According to the following formula:
    Figure 728814dest_path_image006
    ,
    Figure 312242dest_path_image007
    , Calculate the centroid of the binary image as the tongue centroid, where x c and y c are the coordinates of the centroid of the binary image.
  4. 如权利要求1所述的基于舌体轮廓线的舌体齿痕识别装置,其特征在于,所述根据舌体轮廓线计算舌体轮廓凸包作为近似舌体齿痕轮廓线的步骤包括步骤:将舌体轮廓线中点集里面的n个点两两配对,组成n(n-1)/2条直线;对于任一两点确定的每条直线,遍历该两点剩余之外(n-2)个点是否在该条直线的同一侧,如果存在于该条直线一侧的点,则将该点加入到凸包集合,直到所有直线都被遍历完毕为止,并将凸包集合作为近似舌体齿痕轮廓线。The tongue tooth mark recognition device based on the tongue outline according to claim 1, wherein the step of calculating the tongue contour convex hull as the approximate tongue tooth mark contour based on the tongue outline includes the steps: Pair the n points in the set of points in the contour line of the tongue to form n (n-1) / 2 straight lines; for each straight line determined by any two points, traverse the rest of the two points (n- 2) Whether the points are on the same side of the line, if there are points on one side of the line, then add the point to the convex hull set until all the lines have been traversed, and use the convex hull set as an approximation Tongue tooth mark contour.
  5. 如权利要求1所述的基于舌体轮廓线的舌体齿痕识别装置,其特征在于,所述根据舌体轮廓线计算舌体轮廓凸包作为近似舌体齿痕轮廓线的步骤包括步骤:假设近似舌体齿痕轮廓线上共有m个点,将每相邻两点相连构成m条直线,m条边中每条直线L的两个端点在舌体轮廓线相对应的两个端点之间在舌体轮廓线上有p个点,分别计算这p个点到直线L的距离,其中最大距离记为D;如果最大距离D大于预定义的阈值θ,则标记这p个点所对应的区域存在齿痕,并保存对应为最大距离D所对应的点C为齿痕位置。The tongue tooth mark recognition device based on the tongue outline according to claim 1, wherein the step of calculating the tongue contour convex hull as the approximate tongue tooth mark contour based on the tongue outline includes the steps: Assume that there are m points on the contour line of the approximate tongue tooth mark. Each adjacent two points are connected to form m straight lines. The two endpoints of each straight line L in the m edges are between the two endpoints corresponding to the contour line of the tongue. There are p points on the contour line of the tongue. Calculate the distances from the p points to the straight line L, where the maximum distance is recorded as D. If the maximum distance D is greater than the predefined threshold θ, then the corresponding p points are marked. There are tooth marks in the area of d and the point C corresponding to the maximum distance D is stored as the tooth mark position.
  6. 一种基于舌体轮廓线的舌体齿痕识别方法,应用于舌体齿痕识别装置中,其特征在于,该方法包括如下步骤:A tongue tooth mark recognition method based on a tongue contour line, which is applied to a tongue tooth mark recognition device, is characterized in that the method includes the following steps:
    通过输入单元输入舌体图像,并对舌体图像进行灰度转化生成灰度图片;Input a tongue image through an input unit, and perform grayscale conversion on the tongue image to generate a grayscale image;
    对灰度图片二值化生成二值图像;Binarize grayscale pictures to generate binary images;
    对二值图像进行图像轮廓跟踪处理生成舌体轮廓线;Image contour tracking processing on binary images to generate tongue contour lines;
    根据舌体轮廓线计算舌体质心;Calculate the center of mass of the tongue according to the contour of the tongue;
    根据舌体质心确定舌根边界区域;Determine the tongue root boundary area according to the center of mass of the tongue;
    根据舌体轮廓线计算舌体轮廓凸包作为近似舌体齿痕轮廓线;Calculate the convex contour of the tongue according to the contour of the tongue as the approximate contour of the tongue teeth;
    根据舌体轮廓线和近似舌体齿痕轮廓线之间的最大距离确定齿痕位置;Determine the position of the tooth mark according to the maximum distance between the outline of the tongue and the outline of the approximate tooth mark;
    判断舌根轮廓处是否存在齿痕;Determine whether there are tooth marks at the contour of the tongue base;
    若舌根轮廓处存在齿痕,则删除舌根轮廓处的齿痕;If there are tooth marks on the outline of the tongue, delete the tooth marks on the outline of the tongue;
    根据确定的齿痕位置在舌体图像上标记为舌体齿痕,最终生成标记有齿痕位置的舌体图像。According to the determined tooth mark positions, the tongue body marks are marked as tongue tooth marks, and a tongue body image marked with the tooth mark positions is finally generated.
  7. 如权利要求6所述的基于舌体轮廓线的舌体齿痕识别方法,其特征在于,所述对二值图像进行图像轮廓跟踪处理生成舌体轮廓线的步骤包括:The tongue tooth mark recognition method based on the tongue contour line according to claim 6, wherein the step of performing image contour tracking processing on the binary image to generate the tongue contour line comprises:
    步骤1,按照从上到下、从左到右的顺序扫描二值图像,寻找第一个边界起始点A 0作为当前边界点,其中A 0是具有最小行和边界点列的边界点; Step 1. Scan the binary image in order from top to bottom and left to right, and find the first boundary starting point A 0 as the current boundary point, where A 0 is the boundary point with the smallest row and the boundary point column;
    步骤2,定义一个扫描方向变量dir,该变量用于记录步骤1中沿着前一个边界点到当前边界点的移动方向,该变量的初始化取值为对二值图像的四连通区域取dir=3;Step 2. Define a scanning direction variable dir. This variable is used to record the moving direction along the previous boundary point to the current boundary point in step 1. The initialization value of this variable is dir = 3;
    步骤3,按逆时针方向搜索当前象素的3*3邻域,起始搜索方向设定如下:对二值图像的四连通区域取(dir+3)mod 4,其中mod为模运算,在3*3邻域中搜索到的第一个与当前像素相同的像素点作为新的边界点A n,同时更新变量dir作为新的扫描方向值; Step 3. Search the 3 * 3 neighborhood of the current pixel in the counterclockwise direction. The initial search direction is set as follows: Take (dir + 3) mod 4 for the four connected areas of the binary image, where mod is the modulo operation. The first pixel point in the 3 * 3 neighborhood that is the same as the current pixel is used as the new boundary point A n , and the variable dir is updated as the new scanning direction value;
    步骤4,如果新的边界点A n等于第二个边界点A 1且前一个边界点A n-1等于第一个边界点A 0,则停止搜索并结束跟踪边界点,否则重复步骤3继续搜索下一个边界点; Step 4. If the new boundary point A n is equal to the second boundary point A 1 and the previous boundary point A n-1 is equal to the first boundary point A 0 , then stop searching and end the tracking boundary point, otherwise repeat step 3 to continue Search for the next boundary point;
    步骤5,由跟踪的边界点A 0、A 1、A 2、……、A n-2构成的边界即为舌体轮廓线。 In step 5, the boundary formed by the tracked boundary points A 0 , A 1 , A 2 ,..., A n-2 is the contour line of the tongue.
  8. 如权利要求6所述的基于舌体轮廓线的舌体齿痕识别方法,其特征在于,所述根据舌体轮廓线计算舌体质心的步骤包括如下步骤:The tongue tooth mark recognition method based on the tongue contour line according to claim 6, wherein the step of calculating the tongue center of mass based on the tongue contour line comprises the following steps:
    采用一个零阶矩来计算二值图像的面积,所述零阶矩表示为:
    Figure 561958dest_path_image008
    ,其中
    Figure 16073dest_path_image009
    表示像素点在二值图像在(i,j)点上的灰度值,M 00是二值图像中白色区域灰度值的总和;
    A zero-order moment is used to calculate the area of the binary image, which is expressed as:
    Figure 561958dest_path_image008
    ,among them
    Figure 16073dest_path_image009
    Represents the gray value of the pixel at the (i, j) point of the binary image, and M 00 is the sum of the gray values of the white area in the binary image;
    采用一阶矩和二值图像的面积M 00计算二值图像的质心作为舌体质心,所述一阶矩表示为:
    Figure 325832dest_path_image010
    Figure 396556dest_path_image011
    ,,其中M 10是二值图像上所有白色区域x坐标值的累加和,M 01是二值图像上所有白色区域y坐标值的累加和;
    The first-order moment and the area M 00 of the binary image are used to calculate the centroid of the binary image as the center of mass of the tongue. The first-order moment is expressed as:
    Figure 325832dest_path_image010
    ,
    Figure 396556dest_path_image011
    , Where M 10 is the cumulative sum of the x-coordinate values of all white areas on the binary image, and M 01 is the cumulative sum of the y-coordinate values of all white areas on the binary image;
    根据如下公式:
    Figure 43438dest_path_image006
    Figure 883218dest_path_image007
    ,计算二值图像的质心作为舌体质心,其中x c和y c是二值图像的质心坐标。
    According to the following formula:
    Figure 43438dest_path_image006
    ,
    Figure 883218dest_path_image007
    , Calculate the centroid of the binary image as the tongue centroid, where x c and y c are the coordinates of the centroid of the binary image.
  9. 如权利要求6所述的基于舌体轮廓线的舌体齿痕识别方法,其特征在于,所述根据舌体轮廓线计算舌体轮廓凸包作为近似舌体齿痕轮廓线的步骤包括步骤:将舌体轮廓线中点集里面的n个点两两配对,组成n(n-1)/2条直线;对于任一两点确定的每条直线,遍历该两点剩余之外(n-2)个点是否在该条直线的同一侧,如果存在于该条直线一侧的点,则将该点加入到凸包集合,直到所有直线都被遍历完毕为止,并将凸包集合作为近似舌体齿痕轮廓线。The tongue tooth mark recognition method based on the tongue outline according to claim 6, wherein the step of calculating the tongue outline convex hull as the approximate tongue tooth mark outline based on the tongue outline includes the steps: Pair the n points in the set of points in the contour line of the tongue to form n (n-1) / 2 straight lines; for each straight line determined by any two points, traverse the rest of the two points (n- 2) Whether the points are on the same side of the line, if there are points on one side of the line, then add the point to the convex hull set until all the lines have been traversed, and use the convex hull set as an approximation Tongue tooth mark contour.
  10. 如权利要求6所述的基于舌体轮廓线的舌体齿痕识别方法,其特征在于,所述根据舌体轮廓线计算舌体轮廓凸包作为近似舌体齿痕轮廓线的步骤包括步骤:假设近似舌体齿痕轮廓线上共有m个点,将每相邻两点相连构成m条直线,m条边中每条直线L的两个端点在舌体轮廓线相对应的两个端点之间在舌体轮廓线上有p个点,分别计算这p个点到直线L的距离,其中最大距离记为D;如果最大距离D大于预定义的阈值θ,则标记这p个点所对应的区域存在齿痕,并保存对应为最大距离D所对应的点C为齿痕位置。The tongue tooth mark recognition method based on the tongue outline according to claim 6, wherein the step of calculating the tongue outline convex hull as the approximate tongue tooth mark outline based on the tongue outline includes the steps: Assume that there are m points on the contour line of the approximate tongue tooth mark. Each adjacent two points are connected to form m straight lines. The two endpoints of each straight line L in the m edges are between the two endpoints corresponding to the contour line of the tongue. There are p points on the contour line of the tongue. Calculate the distances from the p points to the straight line L, where the maximum distance is recorded as D. If the maximum distance D is greater than the predefined threshold θ, then the corresponding p points are marked. There are tooth marks in the area of d and the point C corresponding to the maximum distance D is stored as the tooth mark position.
PCT/CN2019/103416 2018-08-30 2019-08-29 Device and method for recognizing tooth mark on tongue using tongue contour WO2020043178A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811001462.XA CN110929544A (en) 2018-08-30 2018-08-30 Tongue tooth mark recognition device and method based on tongue contour line
CN201811001462.X 2018-08-30

Publications (1)

Publication Number Publication Date
WO2020043178A1 true WO2020043178A1 (en) 2020-03-05

Family

ID=69643962

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/103416 WO2020043178A1 (en) 2018-08-30 2019-08-29 Device and method for recognizing tooth mark on tongue using tongue contour

Country Status (2)

Country Link
CN (1) CN110929544A (en)
WO (1) WO2020043178A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111681256A (en) * 2020-05-07 2020-09-18 浙江大华技术股份有限公司 Image edge detection method and device, computer equipment and readable storage medium
CN112419357A (en) * 2020-11-18 2021-02-26 方正株式(武汉)科技开发有限公司 Method and system for generating image entity outline one-stroke path
CN112699845A (en) * 2021-01-14 2021-04-23 浙江德菲洛智能机械制造有限公司 Online non-contact palm vein region-of-interest extraction method
CN113052866A (en) * 2021-03-29 2021-06-29 天津大学 Ultrasonic image tongue contour extraction method based on local binary fitting model
CN116740054A (en) * 2023-08-08 2023-09-12 天筛(聊城)生物科技有限公司 Tongue image tooth trace detection method based on image processing

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113192097B (en) * 2021-07-05 2021-09-17 季华实验室 Industrial part pose identification method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009028058A (en) * 2007-07-24 2009-02-12 Saieco:Kk System, apparatus, method and program for tongue diagnosis
CN106999045A (en) * 2014-11-12 2017-08-01 柯尼卡美能达株式会社 Organic image filming apparatus and program
CN106999099A (en) * 2014-10-06 2017-08-01 韩国韩医学研究院 A kind of dental impression evaluation index guiding device handled by tongue image and method
JP2017148386A (en) * 2016-02-26 2017-08-31 大日本印刷株式会社 Tongue image processing device, tongue image processing method and tongue image processing program
CN108403085A (en) * 2018-02-10 2018-08-17 珠海市俊凯机械科技有限公司 A kind of lingual diagnosis method of view-based access control model image procossing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009028058A (en) * 2007-07-24 2009-02-12 Saieco:Kk System, apparatus, method and program for tongue diagnosis
CN106999099A (en) * 2014-10-06 2017-08-01 韩国韩医学研究院 A kind of dental impression evaluation index guiding device handled by tongue image and method
CN106999045A (en) * 2014-11-12 2017-08-01 柯尼卡美能达株式会社 Organic image filming apparatus and program
JP2017148386A (en) * 2016-02-26 2017-08-31 大日本印刷株式会社 Tongue image processing device, tongue image processing method and tongue image processing program
CN108403085A (en) * 2018-02-10 2018-08-17 珠海市俊凯机械科技有限公司 A kind of lingual diagnosis method of view-based access control model image procossing

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
LI, HUANHUAN ET AL.: "The Improvement of the Tooth-marked Recognition Method on the Tongue Images", PROCEEDINGS OF 2013 ICME, 28 May 2013 (2013-05-28), pages 412 - 415, XP032432399 *
ZHONG, SHAODAN ET AL.: "Research on a Tooth-Marked Rapid Locating method Base on Convex Hulls", MICROCOMPUTER INFORMATION, vol. 25, no. 3, 3, 31 December 2009 (2009-12-31) *
ZHONG, SHAODAN ET AL.: "Researches on Tooth-marked Tonguer Econgition Method", JOURNAL OF HANSHAN NORMAL UNIVERSITY, vol. 29, no. 6, 31 December 2008 (2008-12-31), XP055696886 *
ZHUMU, LANGMA ET AL.: "Research on Douglas-Peucker Method in Feature Extraction from 55 Cases of Tooth-Marked Tongue Images", CHINESE ARCHIVES OF TRADITIONAL CHINESE MEDICINE, vol. 32, no. 9, 30 September 2014 (2014-09-30), XP055696885 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111681256A (en) * 2020-05-07 2020-09-18 浙江大华技术股份有限公司 Image edge detection method and device, computer equipment and readable storage medium
CN111681256B (en) * 2020-05-07 2023-08-18 浙江大华技术股份有限公司 Image edge detection method, image edge detection device, computer equipment and readable storage medium
CN112419357A (en) * 2020-11-18 2021-02-26 方正株式(武汉)科技开发有限公司 Method and system for generating image entity outline one-stroke path
CN112419357B (en) * 2020-11-18 2023-06-30 方正株式(武汉)科技开发有限公司 Method and system for generating image entity outline-stroke path
CN112699845A (en) * 2021-01-14 2021-04-23 浙江德菲洛智能机械制造有限公司 Online non-contact palm vein region-of-interest extraction method
CN113052866A (en) * 2021-03-29 2021-06-29 天津大学 Ultrasonic image tongue contour extraction method based on local binary fitting model
CN113052866B (en) * 2021-03-29 2022-11-18 天津大学 Ultrasonic image tongue contour extraction method based on local binary fitting model
CN116740054A (en) * 2023-08-08 2023-09-12 天筛(聊城)生物科技有限公司 Tongue image tooth trace detection method based on image processing
CN116740054B (en) * 2023-08-08 2023-10-20 天筛(聊城)生物科技有限公司 Tongue image tooth trace detection method based on image processing

Also Published As

Publication number Publication date
CN110929544A (en) 2020-03-27

Similar Documents

Publication Publication Date Title
WO2020043178A1 (en) Device and method for recognizing tooth mark on tongue using tongue contour
US20220092882A1 (en) Living body detection method based on facial recognition, and electronic device and storage medium
JP5504928B2 (en) Biometric authentication device, biometric authentication method, and program
US9489561B2 (en) Method and system for estimating fingerprint pose
TW202011733A (en) Method and device for performing target sampling on pictures
CN112287866A (en) Human body action recognition method and device based on human body key points
CN103488984A (en) Method and device for identifying second-generation identity cards based on intelligent mobile equipment
CN112287868B (en) Human body action recognition method and device
CN104809464A (en) Fingerprint information processing method
US11682231B2 (en) Living body detection method and device
US8478070B2 (en) Information processing apparatus, block detection method, and program
WO2020038312A1 (en) Multi-channel tongue body edge detection device and method, and storage medium
US11270100B2 (en) Face image detection method and terminal device
CN110852311A (en) Three-dimensional human hand key point positioning method and device
CN102938062A (en) Document image slant angle estimation method based on content
WO2017113692A1 (en) Method and device for image matching
CN111695498A (en) Wood identity detection method
WO2020108436A1 (en) Tongue surface image segmentation device and method, and computer storage medium
WO2020108437A1 (en) Sublingual vein feature extraction apparatus and method
TW550517B (en) Image pre-processing method for improving correction rate of face detection
JP2010240215A (en) Vein depth determination apparatus, vein depth determination method and program
WO2023174317A1 (en) Method and apparatus for acquiring biometric feature of palm, and storage medium and device
CN112348069B (en) Data enhancement method, device, computer readable storage medium and terminal equipment
CN108629786B (en) Image edge detection method and device
CN110737364B (en) Control method for touch writing acceleration under android system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19853908

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19853908

Country of ref document: EP

Kind code of ref document: A1