A lingual surface adaptive partitioning method, system, and medium

By using an adaptive zoning method, key points of tongue surface zoning are dynamically located, solving the problem of inaccurate zoning caused by fixed templates in existing technologies. This enables personalized tongue surface zoning and quantitative analysis of tongue images, providing reliable technical support for the objective study of tongue diagnosis.

CN121353290BActive Publication Date: 2026-04-10GUANGZHOU UNIVERSITY OF CHINESE MEDICINE
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-19
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing tongue zoning methods use fixed templates, which are difficult to adapt to individual differences in tongue morphology, resulting in inaccurate and unreliable zoning results and failing to meet the needs of personalized quantitative tongue image analysis.

Method used

The tongue surface adaptive partitioning method is adopted. By acquiring the original image, extracting the tongue body morphology parameters, dynamically locating the key points of partitioning, calculating the partitioning coordinates based on the multi-parameter nonlinear coupling model, and dividing the tongue surface into multiple sub-regions corresponding to the internal organs, a partitioning result map is generated.

Benefits of technology

It achieves personalized tongue surface partitioning, ensuring that the partitioning results correspond to the actual physiological structure of the tongue surface, providing clear partitioning criteria, and providing a reliable foundation for the objectification of tongue diagnosis and clinical analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121353290B_ABST
    Figure CN121353290B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of image processing, and discloses a tongue surface adaptive partitioning method, a tongue surface adaptive partitioning system and a medium. The method comprises the following steps: acquiring an original image containing a tongue body, performing tongue body segmentation on the original image to obtain a binary mask; extracting a tongue body contour and calculating a tongue body morphological parameter based on the binary mask; then calculating partitioning key point coordinates through a dynamic positioning formula according to the morphological parameter; then dividing the tongue surface into a plurality of sub-regions corresponding to viscera based on key point connecting lines; and finally fusing sub-region boundary information and the original image to generate and output a partitioning result image. The method provided by the application can adapt to individual tongue shape differences, significantly improves the partitioning accuracy, provides a standardized region division basis for tongue diagnosis objectification, and can be automatically implemented, the result is intuitive and easy to understand, and is convenient for clinical and scientific research application.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of image processing, and in particular to a tongue surface adaptive partitioning method, system and medium. BACKGROUND

[0002] Tongue diagnosis is an important part of TCM inspection, which can infer the physiological function and pathological changes of zang-fu organs by observing the changes of tongue appearance. It has a long history and rich practical experience. Traditional Chinese medicine theory divides the tongue surface into several specific areas, which correspond to different zang-fu organs such as heart, lung, spleen, liver and kidney. For example, the tongue tip belongs to heart and lung, the middle tongue belongs to spleen and stomach, the tongue root belongs to kidney, and the tongue edge belongs to liver and gallbladder. This "zang-fu attribution" theory provides valuable guidance for clinical diagnosis.

[0003] With the development of computer image processing technology, techniques for automatic tongue surface partitioning using computers have emerged, which provides a new way to realize the objectification of tongue diagnosis. Existing tongue surface partitioning methods are mostly aimed at converting traditional Chinese medical experience into computer executable rules. However, these methods still have obvious limitations in practical application. The core problem is that they usually use pre-set, fixed geometric models or proportional relationships to divide the tongue surface. Due to significant differences in individual tongue size, length-width ratio, and contour shape, and the difficulty in completely uniforming the shooting angle, this "one-size-fits-all" fixed template partitioning method is difficult to adapt to the diverse individual tongue shapes.

[0004] Therefore, there is an urgent need in the art for a tongue surface partitioning method that can overcome the limitations of the fixed template, adapt to the morphological changes of different individuals, and achieve more accurate, reliable and personalized tongue surface area division, thereby laying a solid technical foundation for high-level tongue appearance quantitative analysis. SUMMARY

[0005] To overcome the limitations of the existing technology that the fixed template is difficult to adapt to individual tongue shapes, resulting in inaccurate partitioning results, the present application provides a tongue surface adaptive partitioning method, system and storage medium.

[0006] According to a first aspect of the embodiments of the present disclosure, the present application provides a tongue surface adaptive partitioning method, which adopts the following technical solution:

[0007] A tongue surface adaptive partitioning method, comprising:

[0008] obtaining an original image containing a tongue body;

[0009] performing tongue body segmentation on the original image to obtain a binary mask of the tongue body;

[0010] extracting the tongue body contour and calculating the tongue body morphological parameters based on the binary mask;

[0011] According to the tongue shape parameter, the coordinates of the partition key points are calculated through a dynamic positioning formula;

[0012] Based on the connection of the partition key points, the tongue surface is divided into a plurality of sub-regions corresponding to the viscera;

[0013] The boundary information of the sub-regions is fused with the original image to generate and output a partition result image.

[0014] Optionally, the tongue segmentation on the original image to obtain a binary mask of the tongue body includes:

[0015] The original image is converted from an RGB color space to an HSV color space;

[0016] A threshold range of the tongue color is set, wherein the H component is between Hmin and Hmax, the S component is between Smin and Smax, and the V component is between Vmin and Vmax;

[0017] The image is segmented according to the threshold range to generate an initial binary mask;

[0018] The initial binary mask is sequentially subjected to morphological opening operation and closing operation to remove noise and fill holes;

[0019] Through connected region analysis, the largest connected region in area is selected as the final binary mask of the tongue body.

[0020] Optionally, the tongue body contour is extracted and the tongue shape parameter is calculated based on the binary mask, including:

[0021] The binary mask is subjected to contour detection to obtain at least one candidate contour;

[0022] The largest candidate contour in area is selected from the at least one candidate contour as the tongue body contour;

[0023] The tongue body contour is converted into an ordered contour point sequence,

[0024] The ordered contour point sequence is subjected to smoothing or polygon approximation processing to obtain an optimized tongue body contour point sequence , wherein, represents the coordinates of the i-th point on the contour;

[0025] The tongue shape parameter is calculated based on the optimized tongue body contour point sequence.

[0026] Optionally, the tongue shape parameter includes tongue length L, tongue maximum width Wmax, length-width ratio R, tongue root width Wroot, width inflection point ordinate Yp, and symmetry index S.​

[0027] The calculation of tongue morphological parameters based on the optimized tongue contour point sequence includes:

[0028] In the optimized tongue contour point sequence, the maximum and minimum points of the ordinate are determined and designated as the tongue root point Proot and the tongue tip point Ptip, respectively, and the difference between their ordinates is defined as the tongue length L = Yroot - Ytip.

[0029] Traverse the optimized tongue contour point sequence, calculate the tongue width corresponding to each row of contour points, and define the maximum tongue width in all rows as the maximum tongue width Wmax.

[0030] Based on the tongue length L and the maximum tongue width Wmax, the length-to-width ratio R = L / Wmax is calculated.

[0031] Determine a horizontal measurement line by offsetting a certain distance upwards from the lowest point of the tongue root, Yroot, along the central axis;

[0032] Calculate the horizontal distance between the intersection points of the horizontal measurement line and the two sides of the optimized tongue contour point sequence, as the tongue root width Wroot, where the upward offset distance is the product of the tongue length L and a predetermined coefficient δ;

[0033] Along the longitudinal axis of the tongue, multiple ordinates are sampled at predetermined intervals from the root of the tongue to the tip of the tongue, and the tongue width W(y) corresponding to each sampled ordinate y is calculated to generate a tongue width sequence.

[0034] Calculate the first-order difference sequence dW(y) of the tongue width sequence, which represents the rate of change of the tongue width;

[0035] Locate the global minimum point in the first-order difference sequence dW(y), and define the original ordinate corresponding to this point as the ordinate of the width inflection point Yp, which represents the position where the tongue width significantly narrows;

[0036] Based on the optimized tongue contour point sequence and the calculated tongue midline, the tongue region is divided into a left half and a right half, and the area of ​​the left half SL and the area of ​​the right half SR are calculated respectively.

[0037] Calculate the symmetry index .

[0038] Optionally, the step of calculating the coordinates of key points in the partition based on the tongue morphology parameters using a dynamic positioning formula includes:

[0039] Based on a multi-parameter nonlinear coupling model, the ordinates of points A and B at the tongue root boundary are calculated:

[0040] ;

[0041] in, , , , , , For predefined model coefficients, This represents the starting offset of the standard tongue-shaped lower partition. The adjustment intensity of the partition position based on the aspect ratio. The adjustment strength of tongue root width to the partition position. This is a reference value for the aspect ratio of a standard tongue shape. To determine the degree of nonlinearity of the aspect ratio effect, The degree of nonlinearity of the influence of tongue root width;

[0042] Based on the ordinate Y AB Determine the x-coordinate of point A. A For the horizontal line Y=Y AB The x-coordinate of point B is determined by the x-coordinate of the intersection point with the left contour of the optimized tongue contour point sequence. B For the horizontal line Y=Y AB The x-coordinate of the intersection point with the right contour of the optimized tongue contour point sequence;

[0043] Based on a multi-parameter nonlinear coupling model, the ordinate of the core boundary point E is calculated:

[0044] ;

[0045] in, , , , , For predefined model coefficients, The relative position of point E under the standard tongue shape on the lower half of the tongue body. The adjustment intensity of the aspect ratio to the position of point E. The degree to which the asymmetry of the tongue modulates the position of point E. This is the scaling factor inside the tanh function, controlling the saturation rate affected by the aspect ratio. The standard for symmetry of the ideal tongue body;

[0046] Determine the x-coordinate of point E. E The central axis of the tongue lies on the vertical coordinate Y=Y E The x-coordinate of the location;

[0047] The coordinates of point A are determined by P. A (X) A Y AB The coordinates of point B are P.B (X B , Y AB ), the coordinates of point E are P E (X E , Y E ).

[0048] Optionally, the tongue surface is divided into a plurality of sub-regions corresponding to viscera based on the connection line of the key points in the partition, and the method comprises the following steps:

[0049] Connecting a left side point A of the tongue root and a right side point B of the tongue root to obtain a line segment AB;

[0050] Calculating a point F as a midpoint of the line segment AB;

[0051] Calculating a point G as a midpoint of the line segment AF;

[0052] Calculating a point H as a midpoint of the line segment FB;

[0053] Connecting the point F and the point E to form a central axis FE;

[0054] Drawing a straight line GC parallel to the central axis FE through the point G;

[0055] Drawing a straight line HD parallel to the central axis FE through the point H;

[0056] The straight line GC intersects a horizontal line passing through the point E and parallel to AB at a point C;

[0057] The straight line HD intersects the horizontal line passing through the point E and parallel to AB at a point D;

[0058] The line segment GC divides the left side of the tongue surface into a region 1 and a region 3;

[0059] The line segment HD divides the right side of the tongue surface into a region 2 and a region 4;

[0060] The line segment CD and the central axis FE divide the lower part of the tongue surface into a region 5 and a region 6.

[0061] Optionally, the boundary information of the sub-regions is fused with the original image to generate and output a partition result image, and the method comprises the following steps:

[0062] Creating a transparent layer, drawing a boundary line of each sub-region on the transparent layer by using an anti-aliasing rendering algorithm, and fusing the transparent layer with the original image by using an Alpha blending algorithm to generate a partition result image;

[0063] Displaying the partition result image on a display device and / or saving the partition result image as an image file.

[0064] According to a second aspect of the embodiments of the present disclosure, the present application provides a tongue surface adaptive partition system, which comprises:

[0065] an image acquisition module configured to acquire an original image containing a tongue body;

[0066] an image processing module in communication connection with the image acquisition module, the image processing module being configured to:

[0067] perform tongue body segmentation on the original image to obtain a binary mask of the tongue body;

[0068] extract a tongue body contour and calculate tongue body morphological parameters based on the binary mask;

[0069] calculate coordinates of partition key points through a dynamic positioning formula according to the tongue body morphological parameters;

[0070] divide a tongue surface into a plurality of sub-regions corresponding to viscera based on connecting lines of the partition key points;

[0071] a display output module in communication connection with the image processing module, the display output module being configured to fuse boundary information of the sub-regions with the original image to generate and output a partition result image.

[0072] Optionally, the system further comprises an interactive processing module in communication connection with the display output module, the interactive processing module being configured to:

[0073] receive a selection instruction of any sub-region in the partition result image by a user;

[0074] in response to the selection instruction, control the display output module to highlight the selected sub-region on the partition result image and display, in association, viscera information corresponding to the sub-region.

[0075] According to a third aspect of the embodiments of the present disclosure, the present application provides a computer readable storage medium, and the computer program is executed by a processor to implement the tongue surface adaptive partitioning method according to any one of the above embodiments.

[0076] In summary, the present application provides a tongue surface adaptive partitioning method, system and medium. The tongue surface adaptive partitioning method provided by the present application extracts a binary mask based on a tongue original image, and then calculates morphological parameters such as tongue length, aspect ratio and symmetry. The key points of partitioning are determined by a dynamic positioning formula. Regardless of the differences in size, contour shape and aspect ratio of individual tongues, or the slight differences in shooting angles, personalized partitioning can be achieved through parameterized dynamic adjustment, ensuring the correspondence consistency of each sub-region with the actual physiological structure of the tongue surface. The boundary information of each sub-region is fused with the original image to generate a partitioning result image, clearly presenting the boundary and positional relationship of each sub-region corresponding to the viscera. The complete information of the original tongue image is retained, and the partitioning range is intuitively marked, facilitating medical personnel to quickly locate the tongue surface area corresponding to a specific viscera, providing clear and traceable partitioning basis for pathological analysis, efficacy evaluation and other clinical scenarios, and tongue diagnosis big data research.

[0077] Other features and advantages of the present application will be described in detail in the following specific embodiments. BRIEF DESCRIPTION OF DRAWINGS

[0078] The accompanying drawings are included to provide a further understanding of the present disclosure and constitute a part of the specification, and together with the specific embodiments below, serve to explain the present disclosure but do not constitute a limitation thereof. In the drawings:

[0079] Figure 1 FIG. 1 is a flowchart of a tongue surface adaptive partitioning method according to an exemplary embodiment.

[0080] Figure 2 FIG. 2 is a flowchart of a method of tongue segmentation of an original image to obtain a binary mask according to an exemplary embodiment.

[0081] Figure 3 FIG. 3 is a flowchart of a method of extracting a tongue contour and calculating tongue morphological parameters based on a binary mask according to an exemplary embodiment.

[0082] Figure 4 FIG. 4 is a flowchart of a method of calculating tongue morphological parameters based on an optimized tongue contour point sequence according to an exemplary embodiment.

[0083] Figure 5 FIG. 5 is a flowchart of a method of fusing boundary information of a sub-region with the original image to generate and output a partitioning result image according to an exemplary embodiment.

[0084] Figure 6 FIG. 6 is a block diagram of a tongue surface adaptive partitioning system according to an exemplary embodiment.

[0085] Figure 7is a block diagram of another tongue adaptive partitioning system according to an example embodiment.

[0086] Figure 8 is a tongue adaptive partitioning result map according to an example embodiment. DETAILED DESCRIPTION

[0087] The technical solutions in the present application will be described clearly and completely below in conjunction with the drawings in the present application. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. The components of the present application described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application. It should be noted that: similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. Meanwhile, in the description of the present application, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.

[0088] In the example embodiments disclosed in the present application, a tongue adaptive partitioning method is provided, aiming to solve the technical problem that the "one-size-fits-all" fixed template partitioning method in the prior art cannot adapt to individual tongue morphology differences, resulting in inaccurate partitioning and low analysis reliability.

[0089] Specifically, as shown in Figure 1 The tongue adaptive partitioning method disclosed in the embodiments of the present application includes the following steps:

[0090] Step S101: Obtain an original image containing a tongue.

[0091] This step is not limited to a specific shooting device, and can be adapted to various image collection tools commonly used in clinics, such as tongue image collection instruments and smart phones, as long as the image can clearly present the complete morphology and surface features of the tongue. The original image needs to cover the key parts of the tongue body, tongue tip, tongue edge, tongue root, etc., to provide comprehensive image data support for subsequent segmentation and partitioning.

[0092] Step S102: Perform tongue segmentation on the original image to obtain a binary mask of the tongue.

[0093] In step S102, the core goal of tongue segmentation is to accurately separate the tongue region from the background, such as oral mucosa, teeth, lips, etc., from the original image to obtain a binary mask. In the tongue adaptive partitioning method of the present application, the binary mask has the same size as the original image, and the white area (value 1 or 255) is marked in the simplest way, which is the tongue we want, and the black area (value 0) is the background, such as lips, teeth, facial skin, etc.

[0094] Step S103: Based on the binary mask, the tongue contour is extracted and the tongue shape parameters are calculated.

[0095] In step S103, through contour detection, main contour screening and contour optimization, a continuous and smooth tongue contour is obtained, avoiding contour edge fluctuations or impurity contour interference, and ensuring the accuracy of subsequent shape parameter calculation. The calculated tongue shape parameters depict individual tongue shape differences from multiple dimensions, and convert the traditional qualitative description of tongue shape by traditional Chinese medicine into quantitative parameters, providing personalized basis for subsequent dynamic partitioning.

[0096] Step S104: According to the tongue shape parameters, the coordinates of the partition key points are calculated by a dynamic positioning formula.

[0097] In step S104, the dynamic positioning formula takes the tongue shape parameters as variables, and combines the pre-defined clinical calibration coefficients to adaptively adjust the key point coordinates for different tongue shapes.

[0098] Step S105: Based on the connection line of the partition key points, the tongue surface is divided into multiple sub-regions corresponding to the viscera.

[0099] In step S105, the tongue surface is divided into multiple sub-regions corresponding to the viscera by the key point connection line rule, which converts the empirical partitioning of traditional Chinese medicine into a standardized process of parameterized key points and fixed connection line rules. Different operators and different devices can obtain consistent partitioning results, avoiding subjective differences in traditional manual partitioning, and the partitioning results are consistent with the traditional Chinese tongue diagnosis theory, providing a standardized partitioning basis for the objectification of tongue diagnosis.

[0100] Step S106: The boundary information of the sub-regions is fused with the original image to generate and output the partitioning result image.

[0101] The fused partitioning result image is in a general image format, which can be adapted to multiple output devices: on a professional tongue diagnosis instrument, the result image can be displayed full screen, which is convenient for doctors to observe in detail; on a portable device such as a tablet computer in a primary medical setting, the result image can be compressed and displayed clearly, meeting the needs of mobile diagnosis and treatment; in the context of home health monitoring, the tongue image taken by a smartphone can be processed to generate a lightweight result image, which can be pushed to the user through an APP, realizing self-checking of tongue image at home and remote guidance by a doctor. In this way, it is adapted to multiple application scenarios.

[0102] In the example embodiments disclosed in the present application, the tongue surface adaptive partitioning method provided by the present application uses dynamic parameter fitting to replace fixed template partitioning, adapts to individual tongue shape differences, and improves partitioning accuracy; uses algorithm adaptation to replace manual subjective judgment, establishes a standardized process, and promotes the objectivity of tongue diagnosis; uses original image fusion to replace single partition data, balances diagnostic practicality and traceability, and meets the dual needs of clinical and scientific research.

[0103] For example, as shown in FIG. 1, in the example embodiments disclosed in the present application, step S102: tongue segmentation is performed on the original image to obtain a binary mask, which specifically includes the following steps: Figure 2

[0104] Step S201: converting the original image from the RGB color space to the HSV color space.

[0105] In the example embodiments disclosed in the present application, the original image is usually stored in the RGB color space, which has a high degree of coupling between color and brightness. For example, in the same tongue area, the R, G, and B channel values all increase under strong light and all decrease under weak light, which makes the color difference between the tongue and the background easily obscured by light interference, making direct segmentation difficult. This step converts the original image to the HSV color space, which describes color characteristics through three independent components: H (hue) only represents color categories and is not affected by brightness, which is the core dimension for distinguishing the tongue from the background; S (saturation) describes the degree of color brightness, and the tongue usually has a higher saturation than the pale pink of the background mucosa and the low-saturation white of the teeth due to the presence of hemoglobin; V (value) reflects brightness alone and can filter the brightness fluctuations caused by uneven light through subsequent threshold adjustment. Through space conversion, the difference between the tongue and the background is transformed from RGB three-channel mixed interference to HSV three-independent dimensions, providing a basis for subsequent threshold segmentation.

[0106] Step S202: setting the threshold range of the tongue color, wherein the H component is between Hmin and Hmax, the S component is between Smin and Smax, and the V component is between Vmin and Vmax.

[0107] ​In the exemplary embodiment of the present disclosure, based on statistical analysis of a large amount of clinical tongue image data, a dedicated threshold range of the tongue body in the HSV space is preset, ensuring that only the tongue body region can fall within the range. The setting of the range follows the following principles: the tongue body H component threshold (Hmin, Hmax) is set according to the hue range of normal and pathological tongue colors, covering the core hue characteristics of light red, red, and garnet red tongue colors. The lower limit of the preferred range is 0, and the upper limit is set to a value significantly lower than the typical H component value of the common background. In this embodiment, the upper limit value can be set to no more than 25. By controlling the upper limit of the tongue body H component to a lower level, it can be effectively isolated from the background region. For example, the hue of teeth is usually distributed in a higher yellow color interval (H>30), while the hue of oral mucosa and lips is mainly concentrated in the orange / pink color interval of 25 to 35. By setting the threshold, the background interference is maximally excluded in the hue dimension. The S component threshold (Smin to Smax) is set to [20%, 80%] based on the characteristic that the saturation of the tongue body is generally higher than that of the background, so as to effectively exclude the low-saturation tooth reflection (<15%) and high-saturation dark background (>85%). At the same time, the V component threshold (Vmin to Vmax) is set to [30%, 90%] for the problem of uneven illumination, so as to filter out the over-bright area (>90%) caused by strong light and the over-dark area (<30%) caused by shadows.

[0108] The above threshold range is not a fixed value, and can be fine-tuned according to the color characteristics of different shooting devices, taking into account universality and adaptability.

[0109] Step S203: segmenting the image according to the threshold range to generate an initial binary mask.

[0110] This step is based on the HSV threshold range set in step S202 to classify the converted image pixel by pixel to generate an initial binary mask. The specific determination logic is: only when the H, S, and V component values of a pixel simultaneously fall within its preset threshold range (i.e. H∈[Hmin, Hmax] and S∈[Smin, Smax] and V∈[Vmin, Vmax]), the pixel is classified as tongue body foreground and assigned a value of 1 (or 255) in the mask; otherwise, it is classified as background and assigned a value of 0. This process initially constructs a binary image composed of only white tongue body regions and black backgrounds. However, due to the inherent "range" characteristics of the threshold, the initial mask often has two typical defects: first, the interference objects in the background with similar tongue color (such as hair and saliva reflection points) may be mistakenly included, forming "noise points"; second, the dark areas inside the tongue body caused by texture (such as cracks) or uneven illumination may not meet the threshold conditions and be mistakenly excluded (False Negative), forming "holes".

[0111] Step S204: Morphological opening and closing operations are sequentially performed on the initial binary mask to remove noise and fill holes.

[0112] This step aims to optimize the noise and hole problems existing in the initial binary mask by morphological processing, and strictly follows the operation sequence of "opening first and then closing" to ensure the optimization of the processing effect.

[0113] The first step of morphological opening operation, namely, erosion followed by dilation, is mainly used to remove noise. First, by erosion operation, a preset size of structural element, such as a 3x3 rectangular kernel, is used to scan the initial binary mask, which can effectively eliminate isolated noise points with a size smaller than the element, such as hair and reflective points. Subsequently, by dilation operation with the same scale, the shrinkage of the tongue body edge caused by erosion is repaired, the original contour is restored, and the integrity of the tongue body region is ensured.

[0114] The second step of morphological closing operation, namely, dilation followed by erosion, is mainly used to fill holes. First, by dilation operation, adjacent tongue body regions are connected and internal holes smaller than the structural element, such as cracks, are filled. Then, by erosion operation with the same scale, the overexpansion of the edge produced in the dilation process is eliminated, the tongue body contour is restored to smoothness, and the continuity and integrity of the final mask region are ensured.

[0115] Through the combined processing of noise removal by opening operation and hole filling by closing operation, the quality of the initial binary mask is significantly improved, providing a pure and complete tongue body region for subsequent analysis.

[0116] Step S205: Through connected region analysis, the largest connected region in area is selected as the final tongue binary mask.

[0117] In the oral image, after the previous processing, there may still be multiple white connected regions, such as tongue region or a small amount of misjudged white regions on the tooth surface. This step selects the unique tongue region through connected region analysis. Specifically, this step will traverse the entire initial binary mask, identify and mark each independent white region, and then calculate their pixel areas. Since the tongue usually has the largest surface area in the oral cavity, by arranging all connected regions in descending order of area, the largest area can be easily identified as the real tongue. Finally, the region is retained and assigned a value of "1", and other connected regions are assigned a value of "0", and a pure and complete tongue binary mask is finally generated.

[0118] For example, as shown in Figure 3 In the example embodiment disclosed in the present application, step S103: based on the binary mask, the tongue contour is extracted and the tongue shape parameters are calculated, which specifically includes the following steps:

[0119] Step S301: Perform contour detection on the binary mask to obtain at least one candidate contour.

[0120] After obtaining a clean and complete binary mask of the tongue, the next step is to extract the tongue's contour. Since the binary mask consists only of a tongue foreground with a value of 1 and a background with a value of 0, its contour is essentially the pixel boundary between the two. This step uses a mature contour detection algorithm, such as the `findContours` function in OpenCV, to scan the binary mask according to preset rules, such as prioritizing outer contours and traversing clockwise. It detects pixel value abrupt changes (from 0 to 1 or from 1 to 0) row by row and column by column, connecting consecutive abruptly changing pixels to form closed curves, i.e., candidate contours. Because the binary mask may contain a small amount of residual noise, such as incompletely removed tiny impurities or optimized fine boundaries inside the tongue, at least one candidate contour will be generated after detection. This includes the outer contour that encloses the entire tongue, and may also include the tiny contours corresponding to impurities or the optimized inner contours of the original holes inside the tongue. The goal of this step is to comprehensively capture all potential boundaries, providing a complete candidate set for subsequent tongue contour screening and avoiding missing tongue boundaries due to missed contours.

[0121] Step S302: Select the candidate contour with the largest area from at least one candidate contour as the tongue contour.

[0122] In a binary mask, different candidate contours have different physical meanings: the tongue, as the largest soft tissue in the oral cavity, has a corresponding outer contour that is necessarily the largest candidate contour. Conversely, impurities such as hair and tiny reflective points have extremely small contour areas, and the inner contour area of ​​the tongue is also much smaller than its outer contour. Based on this objective characteristic, this step uses area sorting to filter and lock in the tongue contour. Specifically, the pixel area of ​​each candidate contour is first calculated, i.e., the total number of white pixels enclosed by the contour; all candidate contours are sorted from largest to smallest area; the contour with the largest area is selected as the tongue contour, and the remaining smaller candidate contours are directly eliminated.

[0123] Step S303: Convert the tongue outline into an ordered sequence of outline points.

[0124] After processing in the previous steps, the tongue contour is represented by a set of pixels that characterize a closed region. This set lacks a clear order and cannot be directly used for parameter calculations requiring directionality and continuity. The purpose of this step is to reorganize this pixel set into a structured, ordered geometric entity. Specifically, contour tracing algorithms, such as Freeman chain codes or the Suzuki85 algorithm, are used to find and determine a pixel traversal order along the contour boundary, connecting the beginning and end of the pixels in the initial pixel set. This process transforms the originally disordered set into an ordered sequence of contour points.

[0125] Step S304: Smooth or polygon approximation processing is performed on the ordered contour point sequence to obtain an optimized tongue contour point sequence wherein, represent the coordinates of the i-th point on the contour.

[0126] The ordered contour point sequence output in step S303 is the data source for subsequent tongue morphology parameter calculation, and its quality directly determines the accuracy of the partition result. However, this initial sequence has two inherent defects: one is pixel-level sawtooth, which is caused by the discrete sampling of digital images, resulting in high-frequency fluctuations on the contour edge; the other is point density redundancy, which exists in unnecessary high point density in the flat curve area. If these problems are not handled, a series of errors such as length calculation bias, width measurement instability, and curvature analysis inaccuracy will be caused. This step optimizes the contour through smoothing processing or polygon approximation in two ways, which can be selected according to the adaptation scenario:

[0127] 1. Smoothing processing, suitable for scenarios where the tongue edge is relatively smooth. A Gaussian filter or moving average algorithm is used to process the ordered point sequence. For each point Pi, the average value is calculated according to the coordinates of the predetermined number of adjacent points (such as the previous 3 and the next 3) before and after it, and the coordinates of Pi are updated with the average value. Through the fusion of the coordinates of the adjacent points, the small fluctuations on the contour edge are eliminated, and the point sequence forms a continuous and smooth curve, which is more consistent with the real physiological edge of the tongue.

[0128] 2. Polygon approximation, suitable for scenarios where the tongue edge has obvious turning points, such as sharp tongue tip and tongue edge protrusions. Based on the Douglas-Peucker algorithm, the contour point sequence is simplified according to a predetermined precision threshold (such as a maximum allowed deviation of 1 pixel); the feature points on the contour that play a key role in the shape, such as the tongue tip vertex and tongue edge inflection points, are retained, and the redundant points that have little effect on the shape are removed. Finally, a polygon contour point sequence formed by connecting the feature points is generated, which not only simplifies the data volume but also accurately retains the key shape features of the tongue, avoiding the blurring of turning features caused by smoothing processing.

[0129] The core goal of both optimization methods is to improve contour accuracy and reduce computational load to ensure that the optimized contour point sequence can truly reflect the tongue shape and be convenient for subsequent parameter calculation.

[0130] Step S305: Calculate the tongue shape parameters based on the optimized tongue contour point sequence.

[0131] The optimized contour point sequence contains complete and accurate coordinate information of the tongue, and this step calculates the tongue shape parameters based on this sequence, quantifies the tongue shape features from multiple dimensions, converts the traditional qualitative description of tongue shape into quantitative data, and constructs a personalized feature model of one tongue shape.

[0132] ​Specifically, as shown in Figure 4 In the exemplary embodiments disclosed in the present application, the tongue morphology parameters include tongue length L, tongue maximum width Wmax, length-width ratio R, root width Wroot, width inflection point ordinate Yp, and symmetry index S.

[0133] Step S305: Based on the optimized tongue contour point sequence, calculate the tongue morphology parameters, including the following steps:

[0134] Step S401: In the optimized tongue contour point sequence, determine the maximum and minimum points of the ordinate as the root point Proot and the tip point Ptip, respectively, and define the difference between the two ordinate values as the tongue length L=Yroot-Ytip.

[0135] This step calculates the tongue length L, which is a basic parameter representing the longitudinal dimension of the tongue. In the optimized contour point sequence, the point with the maximum Y value is selected as the root point (point Proot, the last end of the tongue connected to the oral cavity), and the point with the minimum Y value is selected as the tip point (point Ptip, the most forward end of the tongue); the tongue length L is defined as the difference between the two ordinate values L=Yroot-Ytip, which avoids the interference of the horizontal coordinate and ensures that the length quantification only reflects the longitudinal extension characteristics.

[0136] Step S402: Traverse the optimized tongue contour point sequence to calculate the tongue width corresponding to each row of contour points, and define the maximum tongue width in all rows as the tongue maximum width Wmax.

[0137] This step calculates the tongue maximum width Wmax, which reflects the size of the widest part of the tongue. By traversing all different ordinate values (Y values) in the contour point sequence, the horizontal distance (W=Xmax-Xmin) is calculated for the left and right contour points corresponding to each Y value (left Xmin and right Xmax), which is the width of the tongue in that row. The maximum value is extracted from all row width values as Wmax, ensuring that the widest part of the tongue is captured (usually located in the middle or middle-back section of the tongue). This step avoids the limitations of traditional fixed position measurement (such as measuring only the middle section of the tongue), and can more comprehensively reflect the transverse size characteristics of the tongue.

[0138] Step S403: Calculate the length-width ratio R=L / Wmax based on the tongue length L and the tongue maximum width Wmax.

[0139] This step calculates the tongue length-width ratio, which is a core parameter for comprehensively representing the "slim / wide" morphology of the tongue. R>1.5 usually corresponds to a "slim tongue" in traditional Chinese medicine, and R<1.2 corresponds to a "wide tongue", providing a quantitative basis for subsequent dynamic partitioning and proportion adaptation.

[0140] Step S404: A horizontal measurement line is determined by offsetting a distance from the lowest point of the root Yroot along the central axis upward;

[0141] Step S405: The horizontal distance between the intersection points of the horizontal measurement line and the optimized tongue contour point sequence on both sides is calculated as the root width Wroot, wherein the offset distance is the product of the tongue length L and a predetermined coefficient δ;

[0142] Steps S404-S405 are used to calculate the root width Wroot, which represents the local morphology of the posterior end of the tongue. A horizontal measurement line is determined by offsetting a distance Lxδ from the root point Yroot (the Y value of point Proot) along the central axis (the left-right symmetry axis of the tongue), wherein L is the tongue length and δ is a predetermined coefficient calibrated by clinical data, with an exemplary value of 0.15, thereby ensuring the relative consistency of the measurement position with respect to the root in different individuals. Subsequently, the transverse distance between the intersection points of the horizontal measurement line and the tongue contour on both sides is calculated, which is Wroot. This parameter compensates for the limitations of the traditional maximum width index in describing the local morphology of the root region, and can provide key local morphological basis for the boundary positioning of the corresponding viscera partition of the root (such as the “root of the tongue belongs to the kidney” in traditional Chinese medicine theory).

[0143] Step S406: A plurality of longitudinal coordinates are sampled at a predetermined interval from the root point to the tip point along the longitudinal axis of the tongue, and the tongue width W(y) corresponding to each sampling longitudinal coordinate y is calculated to generate a tongue width sequence;

[0144] Step S407: A first-order difference sequence dW(y) of the tongue width sequence is calculated, which represents the change rate of the tongue width;

[0145] Step S408: The global minimum point in the first-order difference sequence dW(y) is located, and the original longitudinal coordinate corresponding to the point is defined as the width inflection point longitudinal coordinate Yp, which represents the position where the tongue width significantly narrows.

[0146] Steps S406-S408 are used to calculate the width inflection point longitudinal coordinate Yp, which reflects the turning position of the tongue from wide to narrow. In step S406, the longitudinal coordinate y is sampled at a predetermined interval, such as 5 pixels, from the root to the tip along the Y axis, and the tongue width W(y) corresponding to each y is calculated to form the width sequence {W(y1), W(y2),..., W(yn)}. In step S407, the width change rate is calculated by first-order difference dW(y)=W(y+1)-W(y), and a negative value of dW(y) indicates that the width narrows, and the larger the absolute value, the more significant the narrowing. In step S408, the global minimum point of dW(y) (the most significant narrowing position) is screened, and the longitudinal coordinate corresponding to the point is Yp. This point is usually the morphological turning point of the tongue from the middle to the tip.

[0147] Step S409: Based on the optimized tongue contour point sequence and the calculated tongue median axis, the tongue area is divided into left and right halves, and the left half area SL and the right half area SR are calculated respectively;

[0148] Step S410: Calculate the symmetry index .

[0149] Step S409-Step 410 are used to calculate the symmetry index , which represents the difference in morphology between the left and right sides of the tongue. The tongue median axis is constructed using the geometric center line method, from the tongue root to the tongue tip, and the midpoint coordinates of the left and right boundary points of the optimized tongue contour point sequence are calculated row by row. Connecting all the calculated midpoints in order generates a smooth median axis that runs through the center of the tongue. Steps S409-S410 divide the tongue area into left and right halves using the contour point sequence and the tongue median axis as boundaries, and count the pixel areas SL and SR of the left and right halves respectively. The symmetry index S is calculated according to the above formula , with a value range of [0, 1]. The closer S is to 0, the better the symmetry, and S>0.1 usually corresponds to the asymmetric features of traditional Chinese medicine such as "tongue body skew". This parameter converts the subjective judgment of traditional Chinese medicine on whether the tongue is symmetrical into a numerical judgment, providing a quantitative basis for adjusting the left and right boundaries of the tongue edge corresponding to the zang-fu partition (such as "tongue edge belongs to liver and gallbladder").

[0150] For example, in the example embodiment disclosed in the present application, step S104: calculating the coordinates of the partition key points according to the tongue morphology parameters through a dynamic positioning formula, specifically including:

[0151] Based on a multi-parameter nonlinear coupling model, the longitudinal coordinates of the tongue root boundary points A and B are calculated:

[0152] ;

[0153] wherein, , , , , , are predefined model coefficients, represents the starting offset of the partition under the standard tongue shape, ensuring that the basic positioning conforms to the theory of traditional Chinese medicine, is the adjustment strength of the length-width ratio on the partition position, is the adjustment strength of the tongue root width on the partition position, is the length-width ratio reference value of the standard tongue shape, is the degree of nonlinearity of the length-width ratio influence, is the degree of nonlinearity of the tongue root width influence; is the tongue root point longitudinal coordinate (reference starting point), for the length of the tongue (scaling reference), by a nonlinear exponent the effect of scaling the aspect ratio, by the ratio of the width to the length of the tongue root and a nonlinear exponent to adjust the position.

[0154] based on the ordinate Y AB , the abscissa X A of the intersection of the horizontal line Y=Y AB with the left profile of the optimized sequence of points of the tongue profile, the abscissa X B of the intersection of the horizontal line Y=Y AB with the right profile of the optimized sequence of points of the tongue profile;

[0155] based on a multi-parameter nonlinear coupling model, the ordinate Y of the core dividing point E is calculated:

[0156] ;

[0157] wherein, , , , , are predefined model coefficients, is the relative position of the point E in the lower half of the tongue for a standard tongue shape, is the adjustment intensity of the aspect ratio on the position of the point E, is the adjustment intensity of the tongue asymmetry on the position of the point E, is a scaling factor inside the tanh function, controlling the saturation rate of the effect of the aspect ratio, is the standard of symmetry of the ideal tongue; the term adjusts the effect of the aspect ratio by a hyperbolic tangent function (tanh): controlling the saturation rate of the effect, when the tongue is elongated (thin tongue), this term makes move down, expanding the tip area, and the effect tends to stabilize as R increases; the term adjusts the position by the deviation of the symmetry exponent from the standard value : when the tongue is asymmetric (asymmetric tongue), this term makes deviate.

[0158] the abscissa X E of the point E is the abscissa of the central axis of the tongue at the ordinate Y=Y E ;

[0159] the coordinates of the point A are P A (XA , Y AB ), the coordinates of point B are P B (X B , Y AB ), the coordinates of point E are P E (X E , Y E ).

[0160] The application calculates the coordinates of the partition key points through a multi-parameter nonlinear coupling model, including the tongue root boundary points A and B and the core boundary point E, introduces the tongue shape parameters into the positioning formula, dynamically optimizes the coordinates through the nonlinear coupling model, and realizes the adaptive adjustment of the key point coordinates with the tongue shape. The positions of the traditional partition key points are fixed, such as the tongue root boundary being set at 1 / 5 length from the tongue root, which cannot adapt to individual tongue shape differences, resulting in the tongue root area of long and thin tongue being excessively compressed and the tongue tip area of wide and short tongue being insufficiently divided. The application solves the problem in the following way: the parameters such as the length-width ratio R, the tongue root width Wroot, and the symmetry index S directly participate in the formula calculation, so that Y AB , Y E changes continuously with the tongue shape characteristics, for example, when R increases by 10%, Y AB moves up by about 5% L, and Y E moves down by about 3% (Ytip-Yp). The nonlinear correlation between the parameters and the positioning is realized through the exponential function and the tanh function, such as the influence of the length-width ratio on the positioning tending to saturation at the extreme value, avoiding excessive deviation, so that the key point coordinate positioning conforms to the physiological law of tongue shape change.

[0161] For example, in the example embodiment disclosed in the application, step S105: based on the connection line of the partition key points, the tongue surface is divided into a plurality of sub-regions corresponding to the viscera, including:

[0162] Connecting the left side point A of the tongue root and the right side point B of the tongue root to obtain a line segment AB;

[0163] Calculating point F as the midpoint of line segment AB;

[0164] Calculating point G as the midpoint of line segment AF;

[0165] Calculating point H as the midpoint of line segment FB;

[0166] Connecting point F and point E to form a central axis FE;

[0167] Drawing a straight line GC parallel to the central axis FE through point G;

[0168] Drawing a straight line HD parallel to the central axis FE through point H;

[0169] The straight line GC intersects with a horizontal line passing through point E and parallel to AB at point C;

[0170] The straight line HD intersects with a horizontal line passing through point E and parallel to AB at point D;

[0171] The line segment GC divides the left side of the tongue surface into region 1 and region 3;

[0172] The line segment HD divides the right side of the tongue surface into region 2 and region 4;

[0173] The line segment CD and the central axis FE divide the lower part of the tongue surface into region 5 and region 6.

[0174] The tongue surface system is divided into a plurality of sub-regions corresponding to the theory of Chinese medicine viscera by connecting the key points and geometric division rules. The core logic is to take the key points as the basis, take the geometric rules as the framework, and take the correspondence of viscera as the target. The specific division steps and region definitions are as follows:

[0175] 1. Midpoint calculation: based on the tongue root boundary points A and B, the midpoint F of the line segment AB is calculated, which is the intersection point of the tongue transverse midline and the tongue root boundary; further, the midpoint G of the line segment AF is subdivided, which is the midpoint of the left tongue root region, the midpoint H of the line segment FB, which is the midpoint of the right tongue root region, forming the basis for dividing nodes on the left, right and center.

[0176] 2. Axis and parallel line construction: connecting the midpoint F and the core dividing point E forms the central axis FE running through the longitudinal direction of the tongue, which is not only the symmetry reference of the tongue, but also the longitudinal core axis of the viscera partition; draw a straight line GC parallel to FE through point G, which is the left longitudinal division line, and draw a straight line HD parallel to FE through point H, which is the right longitudinal division line, ensuring that the left and right division lines are equidistantly parallel to the central axis and maintaining the symmetry of the partition; draw a horizontal line parallel to AB through the core dividing point E, which is the transverse division line, intersecting with the straight lines GC and HD at points C and D respectively to form the transverse boundary.

[0177] Through the intersection combination of the above lines, the tongue surface is divided into 6 clear sub-regions, each of which corresponds to a specific viscera in the theory of traditional Chinese medicine: region 1 is enclosed by straight line GC, central axis FE, tongue root boundary AB and transverse division line CD, corresponding to the left middle tongue region, associated with the "spleen and stomach" viscera in traditional Chinese medicine. Region 2 is enclosed by straight line HD, central axis FE, tongue root boundary AB and transverse division line CD, corresponding to the right middle tongue region, also associated with the "spleen and stomach" viscera. Region 1 and region 2 are both anatomically in the middle of the tongue, corresponding to the theory of traditional Chinese medicine that "the middle of the tongue belongs to the spleen and stomach", but the tongue image characteristics of the left middle region 1 focus on reflecting the "spleen" ascending clear function state, such as the spleen's transportation, blood regulation function, while the tongue image characteristics of the right middle region 2 focus on reflecting the "stomach" descending turbid function state, such as the stomach's reception, descending function.

[0178] Region 3 is enclosed by straight line GC, tongue root boundary AB, horizontal division line CD and tongue tip contour, corresponding to the left side tongue edge region, associated with "liver and gall" viscera; Region 4 is enclosed by straight line HD, tongue root boundary AB, horizontal division line CD and tongue tip contour, corresponding to the right side tongue edge region, associated with "liver and gall" viscera. Region 3 and Region 4 are both anatomically tongue edges, corresponding to the theory of "tongue edge belonging to liver and gall" in traditional Chinese medicine, but each has its own focus in functional information representation. The left side Region 3 corresponds to the function of liver qi rising and liver storing blood, and the right side Region 4 corresponds to the function of gall qi dredging and descending.

[0179] Region 5 is enclosed by central axis FE, horizontal division line CD and left contour, corresponding to the left side tongue tip region, associated with "heart and lung" viscera; Region 6 is enclosed by central axis FE, horizontal division line CD and right contour, corresponding to the right side tongue tip region, associated with "heart and lung" viscera. Region 5 and Region 6 are both anatomically tongue tips, corresponding to the theory of "tongue tip corresponding to heart and lung" in traditional Chinese medicine, but the tongue tip region 5 on the left side focuses on reflecting the functional state of heart and blood. The tongue tip region 6 on the right side focuses on reflecting the functional state of lung and qi.

[0180] For example, as shown in FIG. 6, in the example embodiment disclosed in the present application, step S106: the boundary information of the sub-region is fused with the original image to generate and output a partition result image, including: Figure 5

[0181] Step S501: create a transparent layer, draw the boundary lines of each sub-region on the transparent layer using an anti-aliasing rendering algorithm, and fuse the transparent layer with the original image through an Alpha blending algorithm to generate a partition result image;

[0182] In step S501, a transparent layer completely consistent with the size of the original image is newly created, and the initial Alpha channel value of the layer is 0 (fully transparent), which is only used to carry the sub-region boundary line information and does not interfere with the original image content. On the transparent layer, the boundary lines of each sub-region are drawn using an anti-aliasing rendering algorithm, which generates transition color pixels around the boundary pixels to eliminate the jagged blur of traditional hard edge drawing and makes the boundary lines smooth and clear. At the same time, the recognition degree can be enhanced through differential design, different color boundary lines are used in different viscera corresponding regions, and the line width is set to 1-2 pixels, ensuring visibility while not blocking details. The transparent layer with drawn boundary lines is pixel-level superimposed with the original image. The Alpha value of the boundary line region is set to 0.7-0.8 (semi-transparent state), which ensures clear and identifiable boundary lines and does not block the color, texture, moss quality and other diagnostic key information in the original image; the non-boundary line region remains fully transparent, ensuring the integrity of the original tongue image.

[0183] Step S502: display the partition result image on a display device, and / or save it as an image file. ​

[0184] In step S502, the generated partition result map can be output in two ways. One is to directly display on a display device, which is convenient for doctors to view the association between partition and tongue features in real time. The other is to save the result map in JPG, PNG or other general image formats, which can be connected to electronic medical record system, scientific research database, or used for follow-up comparison, multi-center research data sharing.

[0185] FIG. 6 is a block diagram of a tongue adaptive partitioning system according to an exemplary embodiment, as shown, the system comprises: Figure 6 An image acquisition module 601 for acquiring an original image containing a tongue body;

[0186] An image processing module 602 in communication connection with the image acquisition module 601, the image processing module 602 is configured to:

[0187] Perform tongue segmentation on the original image to obtain a binary mask of the tongue body;

[0188] Based on the binary mask, extract the tongue contour and calculate the tongue shape parameters;

[0189] According to the tongue shape parameters, calculate the coordinates of the partition key points through the dynamic positioning formula;

[0190] Based on the connection line of the partition key points, divide the tongue surface into multiple sub-regions corresponding to the viscera;

[0191] A display output module 603 in communication connection with the image processing module 602, for fusing the boundary information of the sub-regions with the original image, generating and outputting a partition result map.

[0192] As shown in the example,

[0193] The tongue adaptive partitioning result map output by the system has clear partition boundary lines superimposed on the original tongue image. These boundary lines are connected by the partition key points calculated by the system, which divide the tongue surface into multiple sub-regions, each sub-region corresponds to a different viscera, and can intuitively present the partition result of the tongue surface and the viscera, which is convenient for subsequent viewing and analysis. Figure 8 Figure 8

[0194] ​​The tongue surface adaptive partition system provided by the application realizes full-process automatic processing through a modular architecture of image acquisition, image processing and display output. The image acquisition module 601 is compatible with multiple types of devices to obtain original images. The image processing module 602 sequentially completes tongue segmentation, contour extraction, morphological parameter calculation, dynamic key point positioning and dirty-organ corresponding sub-region division. The display output module 603 generates intuitive result images through image fusion, retains original tongue image diagnosis information, clearly labels the partition boundary, supports real-time display and file saving, and adapts to electronic medical records and scientific research archiving needs.

[0195] As shown in the example embodiment disclosed in the application, Figure 7 The system further includes an interactive processing module 604 in communication with the display output module 603. The interactive processing module 604 is configured to:

[0196] receive a selection instruction of any sub-region in the partition result image by the user;

[0197] In response to the selection instruction, the display output module highlights the selected sub-region on the partition result image and displays the corresponding dirty-organ information associated with the sub-region.

[0198] By setting the interactive processing module 604, the user can directly select a specific sub-region in the partition result image. The system highlights the target region to enhance the recognition degree, and simultaneously presents the corresponding dirty-organ information, such as region 3-tongue left side-corresponding liver, so that the doctor can quickly establish an intuitive association between the tongue surface region and the dirty-organ, without the need to consult additional theoretical materials, thereby improving the diagnosis efficiency. For patients, the combination of highlighted display and dirty-organ information can help them better understand the correlation between their tongue image and dirty-organ health, thereby reducing the cost of doctor-patient communication. In addition, this function can also assist in traditional Chinese medicine teaching, helping learners to intuitively master the corresponding relationship between tongue surface partition and dirty-organ attribution, thereby expanding the application scenarios of the system.

[0199] In the example embodiment disclosed in the application, the application further provides a computer readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the tongue surface adaptive partition method provided in the above embodiment.

[0200] The terms "comprise", "contain" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device.

[0201] The above description is only the preferred embodiment of the present application and the explanation of the technical principles. It should be understood by those skilled in the art that the application scope of the present application is not limited to the technical solutions with the specific combination of the above technical features, and should also cover other technical solutions formed by combining the above technical features or their equivalent features without departing from the concept of the application. For example, the technical solutions formed by replacing the above features with the technical features with similar functions disclosed in the present application (but not limited to) with each other.

Claims

1. A tongue-surface adaptive partitioning method, characterized in that, The method includes: Obtain the original image containing the tongue; The original image is segmented to obtain a binary mask of the tongue. Based on the binary mask, the tongue contour is extracted and the tongue morphology parameters are calculated; Based on the tongue morphology parameters, the coordinates of key points in the partition are calculated using a dynamic positioning formula; Based on the connection of the key points of the partition, the tongue surface is divided into multiple sub-regions corresponding to the internal organs; The boundary information of the sub-region is fused with the original image to generate and output a partitioned result map; The step of extracting the tongue contour and calculating tongue morphology parameters based on the binary mask includes: Perform contour detection on the binary mask to obtain at least one candidate contour; The candidate contour with the largest area is selected from the at least one candidate contour and used as the tongue body contour. The tongue contour is converted into an ordered sequence of contour points. The ordered sequence of contour points is smoothed or approximated using polygonal processing to obtain an optimized sequence of tongue contour points. ,in, The first one on the outline The coordinates of the points; Based on the optimized tongue contour point sequence, the tongue morphological parameters are calculated; The tongue morphological parameters include tongue length L and maximum tongue width W. max Aspect ratio R, tongue midline, and tongue root width W root , width inflection point ordinate Y p And the symmetry index S; The calculation of tongue morphological parameters based on the optimized tongue contour point sequence includes: In the optimized tongue contour point sequence, the maximum and minimum points of the ordinate are determined and designated as the tongue root points P. root and the tip of the tongue P tip The difference between their ordinates is defined as the tongue length L=Y. root -Y tip ; Iterate through the optimized tongue contour point sequence, calculate the tongue width corresponding to each row of contour points, and define the maximum tongue width W across all rows as the maximum tongue width. max ; Based on the tongue length L and the maximum tongue width W max Calculate the aspect ratio R = L / W max ; The tongue's central axis is constructed using the geometric centerline method. From the root of the tongue to the tip, the midpoint coordinates of the left and right boundary points of the optimized tongue contour point sequence are calculated line by line. By connecting all the calculated midpoints in sequence, a smooth central axis running through the center of the tongue can be generated. From the lowest point of the root of the tongue Y root A horizontal measuring line is determined by offsetting a certain distance upward along the central axis of the tongue. Calculate the horizontal distance between the intersection points of the horizontal measurement line and the two sides of the optimized tongue contour point sequence, and use this distance as the tongue root width W. root The upward offset distance is the product of the tongue length L and a predetermined coefficient δ; Along the longitudinal axis of the tongue, multiple ordinates are sampled at predetermined intervals from the root of the tongue to the tip of the tongue, and the tongue width W(y) corresponding to each sampled ordinate y is calculated to generate a tongue width sequence. Calculate the first-order difference sequence dW(y) of the tongue width sequence, which represents the rate of change of the tongue width; Locate the global minimum point in the first-order difference sequence dW(y), and define the original ordinate corresponding to this point as the ordinate of the width inflection point Y. p The vertical axis represents the location where the width of the tongue becomes significantly narrower; Based on the optimized tongue contour point sequence and the tongue midline, the tongue region is divided into a left half and a right half, and the area S of the left half is calculated respectively. L Area S of the right half R ; Calculate the symmetry index .

2. The tongue surface adaptive partitioning method according to claim 1, characterized in that, The step of segmenting the tongue body in the original image to obtain a binary mask of the tongue body includes: The original image is converted from the RGB color space to the HSV color space; Set a threshold range for tongue color, where the H component is between H min To H max The S component is between S min To S max The V component is between V min To V max between; The image is segmented according to the threshold range to generate an initial binary mask; Morphological opening and closing operations are sequentially performed on the initial binary mask to remove noise and fill holes; Through connected component analysis, the connected component with the largest area is selected as the final binary mask for the tongue.

3. The tongue surface adaptive partitioning method according to claim 1, characterized in that, The step of calculating the coordinates of key points in a partition based on the tongue morphology parameters using a dynamic positioning formula includes: Based on a multi-parameter nonlinear coupling model, the ordinates of points A and B at the tongue root boundary are calculated: ; in, , , , , , For predefined model coefficients, This represents the starting offset of the standard tongue-shaped lower partition. The adjustment intensity of the partition position based on the aspect ratio. The adjustment strength of tongue root width to the partition position. This is a reference value for the aspect ratio of a standard tongue shape. To determine the degree of nonlinearity of the aspect ratio effect, The degree of nonlinearity of the influence of tongue root width; Based on the ordinate Y AB Determine the x-coordinate of point A. A For the horizontal line Y=Y AB The x-coordinate of point B is determined by the x-coordinate of the intersection point with the left contour of the optimized tongue contour point sequence. B For the horizontal line Y=Y AB The x-coordinate of the intersection point with the right contour of the optimized tongue contour point sequence; Based on a multi-parameter nonlinear coupling model, the ordinate of the core boundary point E is calculated: ; in, , , , , For predefined model coefficients, The relative position of point E under the standard tongue shape on the lower half of the tongue body. The adjustment strength of the aspect ratio to the position of point E. The degree to which the asymmetry of the tongue modulates the position of point E. This is the scaling factor inside the tanh function, controlling the saturation rate affected by the aspect ratio. The standard for symmetry of the ideal tongue body; Determine the x-coordinate of point E. E The central axis of the tongue lies on the vertical coordinate Y=Y E The x-coordinate of the location; The coordinates of point A are determined by P. A (X) A Y AB The coordinates of point B are P. B (X) B Y AB The coordinates of point E are P. E (X) E Y E ).

4. The tongue surface adaptive partitioning method according to claim 3, characterized in that, The lines connecting the key points of the partition divide the tongue surface into multiple sub-regions corresponding to the internal organs, including: Connect point A on the left side of the root of the tongue and point B on the right side of the root of the tongue to obtain line segment AB; Calculate point F as the midpoint of line segment AB; Calculate point G as the midpoint of line segment AF; Calculate point H as the midpoint of line segment FB; Connect points F and E to form the central axis FE; Draw a straight line GC through point G, parallel to the central axis FE; Draw a straight line HD through point H, parallel to the central axis FE; The straight line GC intersects the horizontal line passing through point E and parallel to AB at point C; The straight line HD intersects the horizontal line passing through point E and parallel to AB at point D; The line segment GC divides the left side of the tongue into region 1 and region 3; Line segment HD divides the right side of the tongue into region 2 and region 4; Line segment CD and the central axis FE divide the lower part of the tongue into region 5 and region 6.

5. The tongue surface adaptive partitioning method according to claim 1, characterized in that, The step of fusing the boundary information of the sub-region with the original image to generate and output a partitioned result map includes: Create a transparent layer, draw the boundary lines of each sub-region on the transparent layer using an anti-aliasing rendering algorithm, and then fuse the transparent layer with the original image using an alpha blending algorithm to generate a partitioned result image; The partitioning result image is displayed on a display device and / or saved as an image file.

6. A tongue-surface adaptive partitioning system for executing the tongue-surface adaptive partitioning method as described in claim 1, characterized in that, include: The image acquisition module is used to acquire raw images containing the tongue. An image processing module is communicatively connected to the image acquisition module, and the image processing module is configured to: The original image is segmented to obtain a binary mask of the tongue. Based on the binary mask, the tongue contour is extracted and the tongue morphology parameters are calculated; Based on the tongue morphology parameters, the coordinates of key points in the partition are calculated using a dynamic positioning formula; Based on the connection of the key points of the partition, the tongue surface is divided into multiple sub-regions corresponding to the internal organs; The display output module is communicatively connected to the image processing module and is used to fuse the boundary information of the sub-region with the original image to generate and output a partitioned result map.

7. The tongue-surface adaptive partitioning system according to claim 6, characterized in that, The system further includes an interaction processing module, communicatively connected to the display output module, the interaction processing module being configured to: Receive user selection instructions for any sub-region in the partitioning result graph; In response to the selection command, the display output module is controlled to highlight the selected sub-region on the partition result map and display the organ information corresponding to the sub-region.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the tongue-surface adaptive partitioning method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Traditional Chinese medicine tongue image viscera partitioning method based on edge detection

    CN119624988A