Tongue image automatic segmentation method for traditional Chinese medicine surgery department

Through image pixel processing and edge detection, combined with equidistant line division and midline positioning, the problem of poor segmentation effect in the automatic segmentation method of traditional Chinese medicine surgical tongue images is solved, and more accurate and automated tongue image segmentation is achieved.

CN120807553APending Publication Date: 2025-10-17CAPITAL UNIVERSITY OF MEDICAL SCIENCES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510950102.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-10
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing automatic segmentation methods for tongue images in Traditional Chinese Medicine surgery have problems such as poor segmentation effect, inability to adapt to the diversity and complexity of tongue images, reliance on fixed points leading to inaccurate segmentation results, and manual labeling affecting the degree of automation and consistency.

Method used

A method based on image pixel processing is used to obtain the RGB values ​​of the tongue image and extract the red component for image separation. Combined with edge detection and equidistant line segmentation, the tongue area is automatically identified and accurately segmented through midline positioning and edge change detection, reducing the impact of custom thresholds and ensuring segmentation accuracy and consistency.

Benefits of technology

The accuracy and automation of tongue image segmentation are improved, the variability of manual judgment is reduced, and the accuracy and reliability of the segmentation results are ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120807553A_ABST
    Figure CN120807553A_ABST
Patent Text Reader

Abstract

The invention discloses a traditional Chinese medicine surgery tongue image automatic segmentation method, relates to the field of image segmentation, solves the problem of insufficient accuracy of existing tongue image automatic segmentation, and comprises the following steps: S1, obtaining tongue image information; s2, processing the pixels of the tongue image, and extracting the image area of the tongue; image pixels in the image area of the tongue are recorded, and area pixels are obtained; edge points are obtained, edge extraction is carried out according to the edge points, an image contour is obtained, and the image area of the tongue is inspected through the image contour; s3, dividing the image to obtain divided blocks, and obtaining pixels of the divided blocks to obtain block pixels; performing image detection on each divided block; and S4, labeling the abnormal blocks and the abnormal points, uploading the image, and performing processing by medical staff according to the image. The tongue image segmentation accuracy can be effectively improved, and the applicability of the segmentation method is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of image segmentation, and relates to the technology of traditional Chinese surgical science, and particularly relates to a tongue image automatic segmentation method for traditional Chinese surgical science. BACKGROUND

[0002] The existing tongue image automatic segmentation method for traditional Chinese surgical science has the following defects in processing: Most of the existing methods extract tongue images through threshold segmentation, and the extraction effect is not good. The method depends on the preset threshold or edge detection operator, and it is difficult to adapt to the diversity and complexity of tongue images and to meet the existing tongue image automatic segmentation demand.

[0003] The existing segmentation method usually connects according to fixed points. The segmentation method depends on the fixed points or marker points preset on the tongue image. For tongue bodies with various shapes and diverse changes, the segmentation method cannot adapt to all situations, resulting in inaccurate segmentation results. Due to the complexity of tongue body shape and individual differences, the segmentation method based on fixed point connection may not accurately capture the subtle changes of the tongue body, thereby affecting the accuracy of diagnosis.

[0004] The existing tongue image segmentation method for traditional Chinese surgical science often needs manual annotation, which limits the automation degree and efficiency of the segmentation method to some extent. Different experts may have subjective judgment differences, and the subjectivity affects the consistency and reliability of annotation.

[0005] Therefore, the application provides a tongue image automatic segmentation method for traditional Chinese surgical science. SUMMARY

[0006] In view of the deficiencies of the prior art, the application aims to provide a tongue image automatic segmentation method for traditional Chinese surgical science, and aims to improve the accuracy of tongue image segmentation.

[0007] In order to achieve the above purpose, the application adopts the following technical scheme: a tongue image automatic segmentation method for traditional Chinese surgical science, comprising: Step S1: obtaining tongue image information; Step S2: obtaining tongue image pixels according to the tongue image information, processing the tongue image pixels, extracting the image area of the tongue, recording the image pixels in the image area of the tongue, obtaining an edge position of the image area of the tongue as an edge point, extracting the edge according to the edge point, obtaining the image contour, and verifying the image area of the tongue through the image contour; Step S3: dividing the image according to the image contour to obtain a division block, obtaining the pixels of the division block through the region pixels, comparing the block pixels of the plurality of division blocks to determine the overall anomaly of the division block, and obtaining an abnormal block; and performing image detection on each division block to extract an abnormal point; Step S4: labeling the abnormal block and the abnormal point, uploading the image, and processing the image according to the image by medical staff.

[0008] Further, the specific steps of the step S2 are as follows: Step S21: obtaining a tongue image according to tongue image information, traversing the pixel points of the tongue image to obtain the color components of each pixel point, and distinguishing the image according to the color components and analyzing the distinguished image to extract an image region of the tongue; Step S22: obtaining edge points of the image region of the tongue, performing edge detection on the tongue image according to the edge points to obtain an image contour, comparing the image contour with the image region of the tongue, and verifying the image region of the tongue.

[0009] Further, the specific steps of the step S21 are as follows: Step S211: representing the tongue image by coordinates, taking the lower left corner of the tongue image as the origin, obtaining the number of pixel points in the horizontal direction of the tongue image, denoted as x, obtaining the number of pixel points in the vertical direction of the tongue image, denoted as y, and representing the pixel points on the tongue image by ST(i,j); ST(i,j) represents the i-th pixel point in the horizontal direction and the j-th pixel point in the vertical direction of the tongue image; wherein i∈[1,x], j∈[1,y]; Step S212: traversing the pixel points ST(i,j) on the tongue image according to the number x of pixel points in the horizontal direction and the number y of pixel points in the vertical direction, obtaining the RGB value of each pixel point, extracting the red component in the RGB value of the pixel point, and performing image separation on the tongue image according to the value of the red component; Step S213: performing pixel point statistics on the separated image, analyzing the statistical result, and obtaining the image region of the tongue.

[0010] Further, the specific steps of the step S212 are as follows: obtaining the RGB value of each pixel point, denoted as RGB(i,j); RGB(i,j)=(r,g,b); extracting the red component in the RGB value of the pixel point, retaining the red component, and assigning 0 to the green component and the blue component; so that RGB(i,j)=(r,0,0); and recording the value of the extracted red component as rz(i,j); According to the rz(i, j) on the tongue image separation operation, the average value of rz(i, j) on the tongue image is calculated, and the separation threshold fyz is obtained; ; Wherein: x is the upper limit of i, y is the upper limit of j; The tongue image is traversed and compared by the separation threshold: If rz(i, j) > fyz; rz(i, j) is assigned as the upper limit of the red component value 255; If rz(i, j) ≤ fyz; rz(i, j) is assigned as the lower limit of the red component value 0; After the traversal is completed, rz(i, j) is saved to obtain a separation image.

[0011] Further, the specific steps of the step S213 are as follows: A pixel point fxs(i, j) on the separation image is obtained, and the surrounding of the pixel point fxs(i, j) is diffused, if the red separation value rz(i, j) corresponding to the pixel point fxs(i, j) is 255, the point is recorded, and if the red separation value rz(i, j) corresponding to the pixel point fxs(i, j) is 0, the last position is returned and the position is recorded; The number of the red separation value rz(i, j) corresponding to the pixel point fxs(i, j) is 255 is counted to obtain the area fmj of the separation image, and the separation image with the largest area fmj of the separation image is obtained to obtain the image region of the tongue.

[0012] Further, the specific steps of the step S22 are as follows: Step S221: According to the image region of the tongue, a pixel point position on the edge of the image region is obtained as an edge point, the edge of the tongue image is detected with the edge point as the reference, the result of the edge detection is counted, and the image contour is obtained; The edge point byd(i, j) is obtained, and for the edge point byd(i, j), the value of the red component around it is 0 and 255 at the same time; that is, the edge point is assigned by the average value of the red component around the edge point byd(i, j); ; When the value of the edge point byd(i, j) is 0 or 255, it indicates that it is not an edge point; The edge point byd(i+1, j), byd(i-1, j), byd(i, j+1), and byd(i, j-1) are judged, and when they are edge points, the surrounding is repeatedly judged with them as the reference point; when the edge point judgment coincides, all the edge points are extracted to obtain the image contour; Step S222: comparing the image region of the tongue according to the image contour, and checking the image region of the tongue by overlapping the pixel position of the image contour with the pixel position of the image region of the tongue; Mapping the image contour with the image region of the tongue, for the pixel position (i, j) on the image contour, judging whether the pixel position at the corresponding position of (i+1, j), (i-1, j), (i, j+1) and (i, j-1) belongs to the image region of the tongue; if not, indicating that the image contour is wrong, and re-acquiring the image contour.

[0013] Further, the specific steps of the step S3 are as follows: Step S31: obtaining the middle line of the image region of the tongue through the image contour, and dividing the image region into the root of the tongue, the middle of the tongue, the tip of the tongue and the edge of the tongue according to the middle line to obtain the divided blocks; Step S32: obtaining the pixels of the divided blocks to obtain the block pixels, and judging the color of the root of the tongue, the middle of the tongue, the tip of the tongue and the edge of the tongue according to the block pixels, and recording the judgment results.

[0014] Further, the specific steps of the step S31 are as follows: Step S311: obtaining the pixel position corresponding to the minimum j value on the image contour as the vertex dd(i, j) according to the image contour; obtaining the zlk(i, j) and ylk(i, j) on both sides of the vertex as the reference; and calculating the distance ratio jbl according to zlk(i, j), ylk(i, j) and dd(i, j); ; Wherein: zlk(i) refers to the i value in zlk(i, j), zlk(j) refers to the j value in zlk(i, j); dd(i) refers to the i value in dd(i, j), dd(j) refers to the j value in dd(i, j); ylk(i) refers to the i value in ylk(i, j), ylk(j) refers to the j value in ylk(i, j); According to the contour point with the distance ratio jbl being 1, an equidistant line is set; and the midpoint position of the equidistant line is calculated through zlk(i, j) and ylk(i, j) to obtain the equidistant midpoint djz(i, j); ; Step S312: calculating all equidistant midpoints in the image contour, connecting the equidistant midpoints with the vertex to obtain the middle line zx of the image region; Obtaining the standard division image information of the tongue, and obtaining the division proportion of the root of the tongue, the middle of the tongue and the tip of the tongue on the length of the tongue according to the standard division image information of the tongue, respectively denoted as sg, sz and sj; preliminarily dividing the root of the tongue, the middle of the tongue and the tip of the tongue according to the division proportion sg, sz and sj and the middle line zx; Step S313: obtaining the width proportion bk of the tongue edge; symmetrically dividing the tongue edge through the middle line; obtaining the corresponding width kd of the tongue edge of the image region; extending bk×kd through the edge measurement, and obtaining the division of the tongue edge.

[0015] Further, the specific steps of the step S312 are as follows: Calculating the middle line zx and the division proportion sj of the tip of the tongue to obtain the corresponding point sjd of the tip of the tongue on the middle line; ; Obtaining the equidistant line corresponding to sjd, and obtaining the division region of the tip of the tongue according to the equidistant line corresponding to sjd; Similarly, obtaining the corresponding point szd of the middle of the tongue on the middle line, and obtaining the middle region according to the equidistant line corresponding to szd and the equidistant line corresponding to sjd; Setting the remaining region as the root region; Calculating the change rate of the edge of the image region to obtain the change point bhd(i, j); changing j by Δj, calculating the distance between bhd(i, j) and bhd(i, j+Δj) to obtain g interval distances jg(1), jg(2), …, jg(g); calculating the abnormal value bhl of the edge change rate according to the interval distance; ; Wherein: bhl(z) represents the abnormal value of the zth edge change rate; jg(z) represents the zth interval distance; Obtaining the maximum value zdj and the minimum value zxj of the first z-1 interval distances; calculating the change threshold bhy according to the maximum value zdj and the minimum value zxj of the first z interval distances; ; Judging the abnormal value bhl of the edge change rate according to the change threshold bhy: If bhl(z)>bhy, it indicates that the edge change rate is abnormal, and the change point corresponding to the zth interval distance is obtained, and the equidistant line of the adjacent region of the change point is offset.

[0016] Further, the specific steps of the step S32 are as follows: Step S321: obtaining each divided block pixel to obtain a block pixel, and recording the block pixel as qk, qk including qk1, qk2, qk3, qk4 and qk5; recording the number of pixels in each block pixel as u, u including u1, u2, u3, u4 and u5; Step S322: traversing each block pixel, accumulating the block pixel, and performing mean value calculation to obtain a block mean value kjz; ; Obtaining a pixel interval of a normal tongue; comparing the block mean value with the pixel interval of the normal tongue to judge the tongue image for abnormality; Step S323: performing difference calculation on the block pixel and the block mean value, recording the block pixel according to the descending order of the absolute value of the difference, uploading the recording result, and obtaining an abnormal point according to the recording result.

[0017] As described above, due to the adoption of the above technical solutions, the present application has the following beneficial effects: 1. The rgb value of the image is used to calculate the separation threshold value, the image is separated by combining the separation threshold value, the influence of the custom threshold value is reduced, the separated image is more accurate, the separated image is subjected to edge detection, and the accuracy of the separated image is ensured.

[0018] 2. The tongue area is judged by the equidistant line, the division difference of the tongue with different shapes is reduced, the division area is positioned by the center line, the division standard is established, the division is accurately divided by combining the division ratio, the division area is verified and changed by introducing the edge change detection, the subtle changes of the tongue body are accurately captured, and the division result is more detailed.

[0019] 3. The division area is subjected to automatic inspection, the pixels of the area are inspected to judge the abnormal point, and the areas are compared to judge the area abnormality; the difference of manual judgment is reduced; and the consistency and reliability of the inspection are ensured. DETAILED DESCRIPTION

[0020] In order to facilitate the understanding of those skilled in the art, the present application will be further described below with reference to the accompanying drawings.

[0021] Figure 1 The present application is a method schematic diagram; Figure 2 The present application is an image processing schematic diagram; Figure 3 The present application is an image segmentation schematic diagram; DETAILED DESCRIPTION

[0022] The technical solutions of the present application will be described clearly and completely below in connection with the embodiments. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.

[0023] Embodiment one Please refer to Figure 1 The present application provides a technical solution: a tongue image automatic segmentation method for traditional Chinese surgery comprises: Step S1: obtaining tongue image information.

[0024] Step S2: according to the tongue image information, obtaining the tongue image pixel, processing the tongue image pixel, extracting the image area of the tongue, and recording the image pixel in the image area of the tongue to obtain the area pixel; obtaining an edge position of the image area of the tongue as an edge point, performing edge extraction according to the edge point to obtain an image contour, and verifying the image area of the tongue through the image contour; Step S21: according to the tongue image information, obtaining the tongue image, traversing the pixel points of the tongue image, obtaining the color component of each pixel point; according to the color component, distinguishing the image, analyzing the distinguished image, and extracting the image area of the tongue; Step S211: coordinate representation is performed on the tongue image, the lower left corner of the tongue image is taken as the origin, the number of pixel points in the horizontal direction of the tongue image is obtained and recorded as x, the number of pixel points in the vertical direction of the tongue image is obtained and recorded as y, and the pixel points on the tongue image are represented by ST(i,j); ST(i,j) represents the i-th pixel point in the horizontal direction of the tongue image and the j-th pixel point in the vertical direction; wherein i∈[1,x] and j∈[1,y].

[0025] Step S212: according to the number x of pixel points in the horizontal direction of the tongue image and the number y of pixel points in the vertical direction, traversing the pixel points ST(i,j) on the tongue image, obtaining the RGB value of each pixel point, extracting the red component in the rgb value of the pixel point, and performing image separation operation on the tongue image according to the value of the red component; It should be noted that: in a color image, each pixel point is represented by the values of red (R), green (G) and blue (B) three channels to represent the color. The value range of each channel is 0 to 255, so each pixel point has three values. For example, RGB(10,47,200) represents that the red value of a pixel point is 10, the green value is 47, and the blue value is 200.

[0026] Step S2121: Obtain the RGB value of each pixel point, denoted as RGB(i, j); RGB(i, j)=(r, g, b); extract the red component in the RGB value of the pixel point, retain the red component, and assign 0 to the green component and the blue component; so that RGB(i, j)=(r, 0, 0); record the value of the extracted red component as rz(i, j); It should be noted that: in the color image, the red component of the tongue is the most prominent, and the separation calculation of the image is simplified by extracting the red component.

[0027] Step S2122: Perform a separation operation on the tongue image according to rz(i, j), calculate the average value of rz(i, j) on the tongue image, and obtain a separation threshold fyz; ; Wherein: x is the upper limit of i, and y is the upper limit of j; Step S2123: Traverse and compare the tongue image by the separation threshold: If rz(i, j)> fyz; assign rz(i, j) to the upper limit of the red component value 255; If rz(i, j)≤ fyz; assign rz(i, j) to the lower limit of the red component value 0; After traversal, rz(i, j) is saved to obtain a separation image.

[0028] Step S213: Perform pixel point statistics on the separated image, and analyze the statistical results to obtain the image area of the tongue; Obtain the number of separation images fs; count the pixel points of each separation image, as follows: Obtain a pixel point fxs(i, j) on the separation image; diffuse around the pixel point fxs(i, j), if the red separation value rz(i, j) corresponding to the pixel point fxs(i, j) is 255, record the point, if the red separation value rz(i, j) corresponding to the pixel point fxs(i, j) is 0, return to the last position and record the position; Count the number of red separation values rz(i, j) corresponding to the pixel point fxs(i, j) with a value of 255 to obtain the area fmj of the separation image; obtain the separation image with the largest area fmj of the separation image to obtain the image area of the tongue.

[0029] It should be noted that: in the tongue image, the tongue occupies the largest red pixel area.

[0030] Step S22: Obtain edge points of the image region of the tongue, perform edge detection on the tongue image according to the edge points, obtain an image contour, perform edge comparison between the image contour and the image region of the tongue, and perform inspection on the image region of the tongue; Step S221: Obtain a pixel point position on the edge side of the image region of the tongue as an edge point, perform edge detection on the tongue image according to the edge point, and obtain an image contour by counting the edge detection result; Obtain the edge point byd(i, j), and the red component values around the edge point byd(i, j) are 0 and 255 at the same time; that is, the edge point is assigned by the average value of the red component around the edge point byd(i, j); ; When the value of the edge point byd(i, j) is 0 or 255, it indicates that it is not an edge point.

[0031] Perform edge point judgment on byd(i+1, j), byd(i-1, j), byd(i, j+1), and byd(i, j-1), and when it is an edge point, repeat the edge point judgment around it as a base point; when the edge point judgment coincides, extract all the edge points to obtain an image contour; Step S222: Compare the image region of the tongue according to the image contour, and perform inspection on the image region of the tongue by analyzing the coincidence between the pixel point position of the image contour and the pixel point position of the image region of the tongue; Map the image contour and the image region of the tongue, and for the pixel point position (i, j) on the image contour, the pixel point positions at the corresponding positions of (i+1, j), (i-1, j), (i, j+1), and (i, j-1) belong to the image region of the tongue; if not, it indicates that the image contour is incorrect, and the image contour is reacquired.

[0032] Step S3: Divide the image according to the image contour to obtain a division block, obtain the pixels of the division block by the region pixels, compare the block pixels of a plurality of division blocks, judge the overall abnormality of the division block, obtain an abnormal block, and perform image detection on each division block to extract an abnormal point; Step S31: Obtain the middle line of the image region of the tongue by the image contour, divide the image region according to the middle line, divide it into the tongue root, the middle tongue, the tongue tip, and the tongue edge, wherein the tongue edge is divided into the left tongue edge and the right tongue edge; and obtain a division block.

[0033] Please refer to Figure 2; step S311: obtaining the pixel point position corresponding to the minimum j value on the image contour according to the image contour as the vertex dd(i, j); taking the vertex as a reference, obtaining the contour points on both sides to obtain zlk(i, j) and ylk(i, j); calculating the distance according to zlk(i, j), ylk(i, j) and dd(i, j) to obtain the distance ratio jbl; ; It should be noted that: zlk(i) refers to the i value in zlk(i, j), and zlk(j) refers to the j value in zlk(i, j); dd(i) refers to the i value in dd(i, j), and dd(j) refers to the j value in dd(i, j); ylk(i) refers to the i value in ylk(i, j), and ylk(j) refers to the j value in ylk(i, j).

[0034] According to the contour points with the distance ratio jbl being 1, an isometric line is set; the midpoint position of the isometric line is calculated through zlk(i, j) and ylk(i, j) to obtain the isometric midpoint djz(i, j); ; Step S312: calculating all isometric midpoints in the image contour, connecting the isometric midpoints and the vertex to obtain the center line zx of the image area; Obtaining standard division image information of the tongue, obtaining the division ratios of the tongue root, the middle of the tongue and the tip of the tongue on the length of the tongue according to the standard division image information of the tongue, and recording them as sg, sz and sj respectively; preliminarily dividing the tongue root, the middle of the tongue and the tip of the tongue according to the division ratios sg, sz and sj and the center line zx; Step S3121: calculating the center line zx and the division ratio sj of the tip of the tongue to obtain the corresponding point sjd of the tip of the tongue on the center line; ; Obtaining the isometric line corresponding to sjd, obtaining the division area of the tip of the tongue according to the isometric line corresponding to sjd; Similarly, obtaining the corresponding point szd of the middle of the tongue on the center line, and obtaining the middle of the tongue area according to the isometric line corresponding to szd and the isometric line corresponding to sjd; Setting the remaining area as the tongue root area.

[0035] Please refer to Figure 3 ; step S3122: calculating the change rate of the edge of the image area, Obtaining the change point bhd(i, j); changing j by Δj, calculating the distance between bhd(i, j) and bhd(i, j+Δj) to obtain g interval distances jg(1), jg(2), …, jg(g); calculating the abnormal value bhl of the edge change rate according to the interval distance. ; It should be noted that bhl(z) represents the abnormal value of the edge change rate of the zth point; the change average of the first z points is proportionally calculated by the edge change rate of the zth point; The maximum value zdj and the minimum value zxj of the first z-1 interval distances are obtained; the change threshold bhy is calculated according to the maximum value zdj and the minimum value zxj of the first z interval distances; ; The abnormal value bhl of the edge change rate is judged according to the change threshold bhy: If bhl(z) > bhy, it indicates that the edge change rate is abnormal, and the change point corresponding to the zth interval distance is obtained, and the offset of the equidistant line of the adjacent region is performed by the change point. It should be noted that the equidistant line of the adjacent region refers to the equidistant line corresponding to szd and the equidistant line corresponding to sjd.

[0036] Step S313: Obtain the width proportion bk of the tongue edge; divide the tongue edge symmetrically by the center line; obtain the width kd of the tongue edge corresponding to the image region; extend the center line by bk×kd by edge measurement, and obtain the division of the tongue edge.

[0037] It should be noted that the division method is more flexible than the prior art, and the prior art usually connects multiple points by a straight line, which is difficult to clearly divide the tongue image with distorted image or strange shape, and the fixed point connection method has low application scope and is difficult to be widely applied; the present application judges the tongue region by equidistant line, positions and divides the region by center line, accurately divides by division proportion, and introduces edge change detection to verify and change the division region, so that the result is more accurate.

[0038] Step S32: Obtain the pixels of the divided blocks to obtain block pixels, and perform abnormal judgment on the colors of the tongue root, the middle of the tongue, the tip of the tongue and the edge of the tongue according to the block pixels; record the judgment result; Step S321: Obtain the pixels of each divided block to obtain block pixels, and record the block pixels as qk, qk including qk1, qk2, qk3, qk4 and qk5; record the number of pixels in each block pixel as u, u including u1, u2, u3, u4 and u5; Step S322: Traverse each block pixel, accumulate the block pixels, and calculate the mean value kjz. ; Obtain the pixel interval of the normal tongue; compare the block mean value with the pixel interval of the normal tongue, and perform abnormal judgment on the tongue image.

[0039] Step S323: difference calculation is performed on the pixels in the block and the block average value, the absolute value of the difference is sorted in descending order to record the pixels in the block, and the recording result is uploaded; and the abnormal points are obtained according to the recording result; Step S4: the abnormal block and the abnormal point are marked, and the image is uploaded for processing by medical staff according to the image.

[0040] In the present application, if the corresponding calculation formula appears, the above calculation formula is a dimensionless value calculation, and the weight coefficient, the proportion coefficient and other coefficients in the formula are set to obtain a result value of the quantization of each parameter. The size of the weight coefficient and the proportion coefficient only needs to not affect the proportional relationship between the parameters and the result value.

[0041] The preferred embodiments of the application disclosed above are only used to help explain the application. The preferred embodiments do not describe all the details and limit the application to the specific embodiments. Obviously, according to the content of the specification, many modifications and changes can be made. The specification selects and describes these embodiments in order to better explain the principles and practical applications of the application, so that those skilled in the art can well understand and utilize the application. The application is limited by the claims and their entire scope and equivalents.

Claims

1. A method for automatic segmentation of tongue images in traditional Chinese medicine surgery, characterized in that: include: Step S1: Obtain tongue image information; Step S2: Based on the tongue image information, obtain tongue image pixels, process the tongue image pixels, and extract the tongue image region; record the image pixels within the tongue image region to obtain region pixels; obtain an edge position of the tongue image region as an edge point, perform edge extraction based on the edge point to obtain an image contour, and inspect the tongue image region using the image contour; Step S3: Divide the image according to the image contour to obtain divided blocks, and obtain the pixels of the divided blocks through the regional pixels to obtain block pixels; Comparing the block pixels of multiple divided blocks, judging the overall abnormality of the divided blocks, and obtaining abnormal blocks; Perform image detection on each divided block and extract abnormal points; Step S4: Mark the abnormal blocks and abnormal points, upload the image, and the medical staff process it according to the image.

2. The method for automatic segmentation of tongue images in traditional Chinese medicine surgery according to claim 1, characterized in that: The specific steps of step S2 are as follows: Step S21: Based on the tongue image information, a tongue image is obtained, pixels of the tongue image are traversed, and the color component of each pixel is obtained; the image is differentiated based on the color component, and the differentiated image is analyzed to extract the image region of the tongue; Step S22: Obtain edge points of the tongue image area, perform edge detection on the tongue image based on the edge points to obtain an image contour, perform edge comparison between the image contour and the tongue image area, and inspect the tongue image area.

3. The method for automatic segmentation of tongue images in traditional Chinese medicine surgery according to claim 2, characterized in that: The specific steps of step S21 are as follows: Step S211: Coordinates are expressed for the tongue image. Taking the lower left corner of the tongue image as the origin, the number of pixels in the horizontal direction of the tongue image is obtained, denoted as x; the number of pixels in the vertical direction of the tongue image is obtained, denoted as y; and the pixels in the tongue image are expressed as ST(i, j). ST(i, j) represents the i-th pixel in the horizontal direction and the j-th pixel in the vertical direction of the tongue image. where i∈[1,x], j∈[1,y]; Step S212: Based on the number of pixels x in the horizontal direction and the number of pixels y in the vertical direction of the tongue image, the pixels ST(i, j) on the tongue image are traversed to obtain the RGB value of each pixel; the red component in the RGB value of the pixel is extracted; and an image separation operation is performed on the tongue image based on the value of the red component; Step S213: performing pixel count on the separated image, analyzing the statistical results, and obtaining the image area of ​​the tongue.

4. The method for automatic segmentation of tongue images in traditional Chinese medicine surgery according to claim 3, characterized in that: The specific steps of step S212 are as follows: Get the RGB value of each pixel, recorded as RGB(i, j); RGB(i, j) = (r, g, b); extract the red component from the RGB value of the pixel, retain the red component, and assign 0 to the green and blue components, so that RGB(i, j) = (r, 0, 0); record the value of the extracted red component as rz(i, j); Perform a separation operation on the tongue image according to rz(i, j), calculate the average value of rz(i, j) on the tongue image, and obtain the separation threshold fyz; ; Among them: x is the upper limit of i, y is the upper limit of j; Perform traversal comparison on the tongue image by separation threshold: If rz(i, j)>fyz, assign rz(i, j) to the upper limit of the red component, 255; If rz(i, j)≤fyz; assign rz(i, j) to the lower limit of the red component 0; After the traversal is completed, rz(i, j) is saved to obtain the separated image.

5. The method for automatic segmentation of tongue images in traditional Chinese medicine surgery according to claim 3, characterized in that: The specific steps of step S213 are as follows: Get a pixel point fxs(i, j) on the separated image; diffuse the pixel point fxs(i, j) around it. If the red separation value rz(i, j) corresponding to the pixel point fxs(i, j) is 255, record the point. When the red separation value rz(i, j) corresponding to the pixel point fxs(i, j) is 0, return to the previous position and record the position. The number of red separation values ​​rz(i, j) corresponding to the pixel point fxs(i, j) that are 255 is counted to obtain the area fmj of the separation image; the separation image with the largest area fmj is obtained to obtain the image area of ​​the tongue.

6. The method for automatic segmentation of tongue images in traditional Chinese medicine surgery according to claim 2, characterized in that: The specific steps of step S22 are as follows: Step S221: Based on the image area of ​​the tongue, a pixel position on the edge side of the image area is obtained as an edge point. Based on the edge point, edge detection is performed on the tongue image. The edge detection results are counted to obtain the image contour. Get the edge point byd(i, j). For the edge point byd(i, j), the red component values ​​around it are both 0 and 255. That is, the edge point is assigned a value by the average value of the red components around the edge point byd(i, j). ; When the value of edge point byd(i, j) is 0 or 255, it indicates that it is not an edge point; Perform edge point judgment on byd(i+1,j), byd(i-1,j), byd(i,j+1), byd(i,j-1). If it is an edge point, repeat the edge point judgment around it. If the edge points are coincident, extract all edge points to obtain the image contour. Step S222: comparing the tongue image area according to the image contour, and inspecting the tongue image area by performing an overlap analysis between the pixel positions of the image contour and the pixel positions of the tongue image area; The image contour is mapped to the image area of ​​the tongue. For the pixel position (i, j) on the image contour, it is determined whether the pixel positions at the corresponding positions (i+1, j), (i-1, j), (i, j+1) and (i, j-1) belong to the image area of ​​the tongue. If not, it indicates that the image contour is incorrect and the image contour is reacquired.

7. The method for automatic segmentation of tongue images in traditional Chinese medicine surgery according to claim 1, characterized in that: The specific steps of step S3 are as follows: Step S31: obtaining the center line of the tongue image area through the image contour, and dividing the image area according to the center line into tongue root, tongue middle, tongue tip and tongue edge to obtain divided blocks; Step S32: Acquire the pixels of the divided blocks to obtain block pixels, perform abnormality judgment on the colors of the tongue root, tongue middle, tongue tip, and tongue edge based on the block pixels, and record the judgment results.

8. The method for automatic segmentation of tongue images in traditional Chinese medicine surgery according to claim 7, characterized in that: The specific steps of step S31 are as follows: Step S311: Obtain the pixel position corresponding to the minimum j value on the image contour according to the image contour, and use it as the vertex dd(i, j); using the vertex as a reference, obtain the contour points on both sides to obtain zlk(i, j) and ylk(i, j); perform distance calculation based on zlk(i, j), ylk(i, j) and dd(i, j) to obtain the distance ratio jbl; ; Where: zlk(i) refers to the value of i in zlk(i, j), zlk(j) refers to the value of j in zlk(i, j); dd(i) refers to the value of i in dd(i, j), dd(j) refers to the value of j in dd(i, j); ylk(i) refers to the value of i in ylk(i, j), ylk(j) refers to the value of j in ylk(i, j); According to the contour points with a distance ratio of jbl of 1, an equidistant line is set; the midpoint position of the equidistant line is calculated by zlk(i, j) and ylk(i, j) to obtain the equidistant midpoint djz(i, j); ; Step S312: Calculate all equidistant midpoints within the image contour, connect the equidistant midpoints with the vertices, and obtain the midline zx of the image area; Obtain standard segmentation image information of the tongue, and determine the division ratios of the tongue root, tongue middle, and tongue tip along the tongue length based on the standard segmentation image information, which are denoted as sg, sz, and sj, respectively; perform a preliminary division of the tongue root, tongue middle, and tongue tip based on the division ratios sg, sz, and sj and the midline zx; Step S313: Obtain the width ratio bk of the tongue edge; divide the tongue edge symmetrically along the center line; obtain the corresponding width kd of the tongue edge in the image area; and extend the center line bk×kd by edge measurement to obtain the division of the tongue edge.

9. The method for automatic segmentation of tongue images in traditional Chinese medicine surgery according to claim 8, characterized in that: The specific steps of step S312 are as follows: Calculate the division ratio sj between the midline zx and the tongue tip to obtain the corresponding point sjd of the tongue tip on the midline; ; Get the isodistance line corresponding to sjd, and obtain the divided area of ​​the tongue tip based on the isodistance line corresponding to sjd; Similarly, obtain the corresponding point szd on the midline of the tongue, and obtain the mid-tongue area according to the isometric line corresponding to szd and the isometric line corresponding to sjd; Set the remaining area as the tongue base area; Calculate the change rate of the edge of the image area to obtain the change point bhd(i, j); make an equal change of Δj on j, calculate the distance between bhd(i, j) and bhd(i, j + Δj), and obtain g interval distances jg(1), jg(2), ..., jg(g); calculate the abnormal value bhl of the edge change rate based on the interval distance; ; Where: bhl(z) represents the outlier value of the z-th edge change rate; jg(z) represents the z-th interval distance; Obtain the maximum value zdj and the minimum value zxj of the first z-1 interval distances; calculate the change threshold bhy based on the maximum value zdj and the minimum value zxj of the first z interval distances; ; The abnormal value bhl of the edge change rate is judged according to the change threshold bhy: If bhl(z)>bhy, it indicates that the edge change rate is abnormal. The change point corresponding to the z-th interval distance is obtained, and the equidistant lines of the adjacent area are offset based on the change point.

10. The method for automatic segmentation of tongue images in traditional Chinese medicine surgery according to claim 7, characterized in that: The specific steps of step S32 are as follows: Step S321: Obtain pixels of each divided block to obtain block pixels, and record the block pixels as qk, where qk includes qk1, qk2, qk3, qk4, and qk5; record the number of pixels in each block as u, where u includes u1, u2, u3, u4, and u5; Step S322: traverse each block pixel, accumulate the block pixels, calculate the mean, and obtain the block mean kjz; ; Get the pixel interval of a normal tongue; Compare the block mean with the pixel interval of a normal tongue to determine the abnormality of the tongue image; Step S323: Calculate the difference between the pixels in the block and the block mean, sort the absolute values ​​of the differences in descending order, record the pixels in the block, and upload the recorded results; Obtain the abnormal points based on the recorded results.