Traditional Chinese medicine inspection diagnosis image enhancement method based on computer vision

Through computer vision technology, the exposure and illumination loss of tongue image are evaluated, and targeted enhancement processing is carried out, which solves the problem of light interference in traditional Chinese medicine's observation diagnosis, and improves the quality and diagnostic accuracy of tongue image.

CN119251122AInactive Publication Date: 2025-01-03DALIAN RANXING INFORMATION TECH CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411774868.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-01-03
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In traditional Chinese medicine diagnosis, differences in the collection environment of the patient's tongue image lead to light interference, affecting image quality and diagnostic results.

Method used

Using a computer vision-based method, the tongue area is extracted and divided into sub-regions by obtaining the grayscale image of the tongue. Combining the morphological characteristics, channel differences and adjacent areas grayscale, the exposure degree and illumination loss degree are evaluated, and the contrast enhancement amplitude is calculated. , carry out targeted image enhancement processing.

Benefits of technology

Effectively reduce light interference, highlight the details of the tongue, improve the contrast and clarity of the tongue image, and improve diagnostic accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251122A_ABST
    Figure CN119251122A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer vision, in particular to a traditional Chinese medicine inspection diagnosis image enhancement method based on computer vision, which comprises the following steps: dividing a tongue body region in a tongue image gray level image into a plurality of sub-regions, and combining morphological characteristics of the sub-regions, gray level differences between an R channel and other channels and gray level of adjacent sub-regions, obtaining the exposure degree of the sub-region; based on the gray level distribution difference of the tongue image gray level image under each channel, screening out an illumination abnormal tongue body image; according to the gray value distribution condition of pixel points of each sub-region in the abnormal illumination tongue body image on all channels, the contrast enhancement amplitude of the sub-region is obtained; and respectively combining the exposure degree, the illumination missing degree and the contrast enhancement degree so as to carry out image enhancement processing on different illumination abnormal tongue body images. According to the invention, the detail features and contrast of the tongue body part in the tongue picture image are effectively enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer vision, and in particular to a computer vision-based TCM visual diagnosis image enhancement method. Background Art

[0002] Traditional Chinese medicine relies on visual observation of the patient's external appearance, and the advancement of computer vision technology has provided a new method to improve the quality of visual diagnosis images. Through image preprocessing, feature extraction and deep learning technologies, the clarity and details of the image can be effectively enhanced, helping doctors make more accurate diagnoses.

[0003] Observation diagnosis is to infer the pathology in the body by observing the patient's external appearance. Observation of the tongue is to infer the pathological state of the human body by observing the color and shape of the tongue. However, in the process of visually collecting the patient's tongue image, due to the large differences in the environment in which different patients are photographed, the interference of external light will cause some information in the tongue image in the final collected image to be unclear, thus affecting the doctor's diagnosis. Summary of the invention

[0004] The present invention provides a computer vision-based TCM visual diagnosis image enhancement method to solve the existing problems.

[0005] The present invention provides a computer vision-based TCM visual diagnosis image enhancement method using the following technical solutions: An embodiment of the present invention provides a method for enhancing images of TCM visual diagnosis based on computer vision, the method comprising the following steps: Obtain the patient's RGB tongue image and perform preprocessing to obtain a tongue grayscale image; Obtain the tongue body area in the tongue grayscale image and divide the tongue body area into several sub-areas, and obtain the exposure degree of the sub-area by combining the morphological characteristics of any sub-area, the grayscale difference between the R channel and other channels, and the grayscale level of adjacent sub-areas of the sub-area; Based on the grayscale distribution difference of the tongue grayscale image in each channel, the degree of illumination deficiency of the tongue grayscale image is obtained to screen out tongue images with abnormal illumination; According to the gray value distribution of each sub-region pixel point in the abnormal lighting tongue image in all channels, the contrast enhancement amplitude of the sub-region is obtained; The exposure degree, the light deficiency degree and the contrast enhancement degree are respectively combined to perform image enhancement processing on tongue images with different light abnormalities.

[0006] The specific method of obtaining the tongue body area in the tongue image grayscale image and dividing the tongue body area into a plurality of sub-areas includes: The tongue area in the tongue grayscale image is obtained by using semantic segmentation technology; The tongue area is divided into several sub-areas using the superpixel segmentation algorithm.

[0007] The exposure degree of the sub-region is obtained by combining the morphological features of any sub-region, the grayscale difference between the R channel and other channels, and the grayscale levels of adjacent sub-regions of the sub-region, including the specific method of: Obtain the average grayscale of any sub-region in each color channel, and obtain the R difference parameter of the sub-region according to the difference between the average grayscale of the R channel of any sub-region and other channels; The exposure degree of the sub-region is obtained according to the morphological characteristics of the sub-region, the R difference parameter, and the grayscale levels of other sub-regions adjacent to the sub-region.

[0008] The specific method for obtaining the exposure degree is: The area of ​​the sub-region and the area of ​​the corresponding minimum circumscribed circle are obtained, and the exposure degree of the sub-region is obtained by combining the difference between the area of ​​the sub-region and the area of ​​the corresponding minimum circumscribed circle, the R difference parameter of the sub-region, and the average grayscale of other sub-regions adjacent to the sub-region; The specific calculation method of the exposure degree of any sub-area is: ; in, Indicates The exposure level of each sub-area; Indicates The area of ​​the sub-region; Indicates The area of ​​the smallest circumscribed circle of each sub-region; Indicates R difference parameter of each sub-region; Indicates The average grayscale of all adjacent sub-regions of a sub-region; Used to describe the The morphological characteristics of the sub-regions.

[0009] The method of obtaining the degree of illumination deficiency of the tongue grayscale image based on the grayscale distribution difference of the tongue grayscale image in each channel to screen out tongue images with abnormal illumination includes the following specific methods: Analyze the grayscale distribution differences of the tongue grayscale image in each channel, and calculate the low grayscale expression degree and low grayscale expression differences of the tongue grayscale image; Combining the difference in low grayscale expression of the tongue grayscale image and the degree of low grayscale expression in all channels, the degree of illumination deficiency of the tongue grayscale image is obtained, and the tongue grayscale image is screened to obtain the tongue image with abnormal illumination.

[0010] The specific calculation method of the low grayscale expression degree is: ; in , Indicates the grayscale image of the tongue The degree of low grayscale expression under the channel; represents the grayscale mean of the tongue grayscale image, Represents the grayscale span of the tongue grayscale image, Represents the grayscale variance of the tongue grayscale image; express aisle; express aisle; express aisle; represents the linear normalization function.

[0011] The specific method for obtaining the degree of light deficiency is: The mean of the low grayscale expression degree in all channels of any tongue grayscale image and the low grayscale expression difference of the tongue grayscale image are respectively obtained, and the illumination deficiency degree of the tongue grayscale image is obtained according to the mean and the low grayscale expression difference, wherein the mean is positively correlated with the illumination deficiency degree, and the low grayscale expression difference is negatively correlated with the illumination deficiency degree.

[0012] The specific method of obtaining the contrast enhancement amplitude of the sub-region according to the gray value distribution of the pixel points of each sub-region in the abnormal illumination tongue image in all channels includes: For any tongue image with abnormal lighting, obtain the array composed of the grayscale values ​​of the three channels R, G, and B for each pixel in any sub-region, and record it as the color array of the corresponding pixel; obtain the average color array of all pixels in any sub-region as the average color array of the corresponding sub-region; Obtaining the channel discreteness of the sub-region according to the distance between the color arrays of all pixels in any sub-region and the average color array of the sub-region; The grayscale discreteness of any sub-region is obtained. When the channel discreteness of the sub-region is greater than the grayscale discreteness of the sub-region, the contrast enhancement amplitude of the sub-region is obtained according to the difference between the channel discreteness and the grayscale discreteness of the sub-region.

[0013] The specific calculation method of the channel discrete degree is: ; in, Indicates The channel discreteness of each sub-region; Indicates The number of pixels in each sub-region; Indicates obtaining the Euclidean distance; Indicates In the sub-area The color array of pixels; Indicates The average color array of sub-regions; represents the linear normalization function.

[0014] The exposure degree, the light deficiency degree and the contrast enhancement degree are respectively combined to perform image enhancement processing on tongue images with different light abnormalities, and the specific methods include: The grayscale distribution in the sub-region is adjusted according to the exposure degree of the sub-region and in combination with the contrast enhancement amplitude to obtain the adjusted grayscale value of each pixel in the sub-region; According to the degree of illumination loss of the grayscale image of the tongue and the contrast enhancement amplitude of the sub-region, the grayscale distribution in the sub-region is adjusted to obtain the adjusted grayscale value of each pixel in the sub-region.

[0015] The beneficial effect of the technical solution of the present invention is: by accurately extracting the collected tongue area and identifying and obtaining independent sub-areas, feature comparison is performed on these sub-areas in the grayscale image of the RGB three channels to evaluate their exposure level and the overall degree of insufficient lighting. In addition, through in-depth analysis and comparison of the pixels in the sub-areas, the contrast enhancement coefficient of each area is calculated. Based on this coefficient, targeted enhancement processing is performed on the tongue area under different lighting conditions, reducing the interference of external ambient light on the image quality, and effectively highlighting the detailed features on the tongue coating, effectively enhancing the detailed features and contrast of the tongue part in the tongue image. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 A flowchart of the steps of a method for enhancing images of TCM visual diagnosis based on computer vision according to the present invention; Figure 2 is the grayscale image of tongue; Figure 3 The basic process of the exposure degree analysis method of a sub-region provided by an embodiment of the present invention; Figure 4 Schematic diagram of several sub-regions of the tongue area. DETAILED DESCRIPTION

[0018] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of a computer vision-based TCM visual diagnosis image enhancement method proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0019] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0020] The following is a detailed description of a computer vision-based TCM visual diagnosis image enhancement method provided by the present invention in conjunction with the accompanying drawings.

[0021] See also Figure 1 , which shows a flowchart of a method for enhancing images of TCM visual diagnosis based on computer vision provided by an embodiment of the present invention, the method comprising the following steps: Step S001: Acquire the patient's RGB tongue image and perform preprocessing to obtain a tongue grayscale image.

[0022] It should be noted that during online remote diagnosis, patients need to take relevant tongue images and upload them themselves, so as to facilitate visual diagnosis based on the patient's tongue images. Usually, the uploaded tongue images should be pre-processed in the system to reduce their noise. For the convenience of processing, they will be converted into grayscale images during pre-processing.

[0023] Specifically, in order to implement the computer vision-based TCM visual diagnosis image enhancement method proposed in this embodiment, it is first necessary to collect tongue images. The specific process is as follows: First, the RGB tongue smell image is grayed to obtain a tongue grayscale image.

[0024] Then, Gaussian filtering is used to reduce the noise of the tongue grayscale image. Figure 2 Shown is a grayscale image of the tongue.

[0025] So far, the grayscale image of the tongue is obtained through the above method.

[0026] Step S002: Obtain the tongue body area in the tongue grayscale image and divide the tongue body area into several sub-areas, and obtain the exposure degree of the sub-area by combining the morphological characteristics of any sub-area, the grayscale difference between the R channel and other channels, and the grayscale level of adjacent sub-areas of the sub-area.

[0027] It should be noted that due to the different environments of different patients during the shooting process, the actual process of collecting tongue images will be affected. When the overall light intensity of the tongue image taken by the patient is low and the resolution of the tongue image is low, some information in the tongue image will not be obvious, which will affect the results of TCM inspection. Therefore, in order to assist the TCM inspection process, the embodiment of the present invention chooses to enhance the tongue grayscale image to make the tongue information more prominent.

[0028] See also Figure 3 , which shows the basic process of the exposure degree analysis method of the sub-area provided by an embodiment of the present invention.

[0029] Specifically, in step S201, the tongue body region in the tongue grayscale image and a plurality of sub-regions in the tongue body region are segmented.

[0030] It should be noted that, in general, in addition to the tongue area, the patient's tongue grayscale image may also contain non-tongue areas such as teeth, lips, and face. Therefore, in the process of enhancing the tongue area in the tongue grayscale image, since the grayscale features corresponding to different areas are different, the non-tongue area will interfere with the enhancement process of the tongue area. Therefore, the tongue area in the tongue grayscale image should be extracted and segmented first.

[0031] It should be noted that in traditional Chinese medicine, the morphological characteristics of the tongue reflect the corresponding symptoms of the patient's body. Usually, the color, shape and texture characteristics of the tongue area are observed. However, different lighting conditions cause different degrees of interference to the tongue image. When the light intensity is too strong, high exposure may occur in some areas of the tongue, and when the light intensity is insufficient, detail information will be missing in the entire tongue area. Therefore, the embodiment of the present invention analyzes the tongue area and performs image enhancement processing on it.

[0032] Firstly, semantic segmentation technology is used to obtain the tongue area in the tongue grayscale image.

[0033] As an embodiment, the segmentation process of the tongue region includes: Firstly, the Mask R-CNN network is used to perform semantic segmentation on the tongue in the grayscale image of the tongue, and the tongue area is separated from other non-tongue areas to obtain a MASK binary image.

[0034] Then, the grayscale image and the binary image are combined by binary masking to set the grayscale value of the tongue area to 1 and the grayscale values ​​of the remaining non-tongue areas to 0, thereby segmenting the tongue area.

[0035] It should be noted that the Mask R-CNN network is an existing semantic segmentation neural network, so it is not described in detail in this embodiment.

[0036] Then, the tongue area is divided into several sub-areas using a superpixel segmentation algorithm.

[0037] It should be noted that the color differences and texture features at different positions in the tongue area reflect the physiological health status of the human body. Therefore, when performing image enhancement on the tongue area, the grayscale conditions and light reflection conditions at different positions in the tongue area should be specifically considered to achieve adaptive enhancement at different regional positions. Then, the areas at different positions in the tongue area should be obtained first. The embodiment of the present invention chooses to divide the areas according to grayscale features.

[0038] As an embodiment, the method for obtaining the sub-region includes: performing super-pixel segmentation on the tongue region using a super-pixel segmentation algorithm to obtain a plurality of super-pixel blocks, and recording any super-pixel block as a sub-region of the tongue region, such as Figure 4 Shown are schematic diagrams of several sub-regions of the tongue body area.

[0039] Step S202 , analyzing the exposure levels of different sub-regions in the tongue region by combining the morphological features of any sub-region, the grayscale difference between the R channel and other channels, and the grayscale levels of adjacent sub-regions of the sub-region.

[0040] It should be noted that due to the complex and changeable lighting environment when the patient collects images, the image may have regional reflections or be overall dark due to insufficient lighting, which may have an adverse effect on subsequent diagnosis. Since the abnormal features of the tongue area are mostly manifested on the surface of the tongue, and the background is generally red, when analyzing the exposure, the specific reflection conditions at different positions of the tongue area are analyzed by comparing the grayscale performance of the tongue area in different color channels. Specifically, in the corresponding R, G, and B channels of the tongue area, the high grayscale area may represent the white covering above the tongue, and the highlight reflection will also show corresponding characteristics in the grayscale images of each channel.

[0041] First, the average grayscale of any sub-region in each color channel is obtained, and the R difference parameter of the sub-region is obtained according to the difference in average grayscale between the R channel of any sub-region and other channels.

[0042] It should be noted that in order to determine whether the current connected domain belongs to a high-exposure area, we first extract the R, G, and B three-channel grayscale images of the tongue area image, and divide the area according to the superpixel segmentation results. Then, for any single connected domain, we evaluate its exposure by comparing the grayscale difference in its three-channel grayscale image, as well as the grayscale difference between the region's morphology and the surrounding adjacent areas. If the area is determined to be a high-exposure area, it will appear as a high grayscale value area in the RGB three-channel grayscale image, and the regional morphology will be relatively full, and the surrounding connected domains will also be affected by it and show a certain degree of highlight.

[0043] As an embodiment, the specific calculation method of the R difference parameter is: ; in, Indicates R difference parameter of each sub-region; Indicates Sub-regions in The average grayscale under the channel; Indicates Sub-regions in The average grayscale under the channel; express aisle; express aisle; Represents the absolute value symbol.

[0044] Then, the exposure degree of the sub-region is obtained according to the morphological characteristics of the sub-region, the R difference parameter, and the grayscale levels of other sub-regions adjacent to the sub-region.

[0045] As an embodiment, a specific method for obtaining the exposure degree includes: obtaining the area of ​​a sub-region and the area of ​​the corresponding minimum circumscribed circle, combining the difference between the area of ​​the sub-region and the area of ​​the corresponding minimum circumscribed circle, the R difference parameter of the sub-region, and the average grayscale of other sub-regions adjacent to the sub-region to obtain the exposure degree of the sub-region.

[0046] As an embodiment, a specific method for calculating the exposure degree of any sub-region is as follows: ; in, Indicates The exposure level of each sub-area; Indicates The area of ​​the sub-region; Indicates The area of ​​the smallest circumscribed circle of each sub-region; Indicates R difference parameter of each sub-region; Indicates The average grayscale of all adjacent sub-regions of a sub-region.

[0047] It should be noted that The ratio of the area of ​​the sub-region to the area of ​​its own minimum circumscribed circle reflects the morphological characteristics of the sub-region. The larger the value, the fuller the outline of the region and the more similar its morphology is to the exposure area. The smaller the value is, the smaller the difference between the grayscale of the sub-region under the R channel and the grayscale of other channels is. The closer the grayscale of the region is to grayish white, the higher the possibility that the sub-region is a high-exposure region. The larger the value, the higher the possibility that the sub-region is an exposed region.

[0048] Step S003, based on the grayscale distribution difference of the tongue grayscale image in each channel, the degree of illumination deficiency of the tongue grayscale image is obtained to screen out tongue images with abnormal illumination.

[0049] It should be noted that by comparing and analyzing the grayscale levels of the sub-areas under the three RGB color channels, the exposure levels of different sub-areas were obtained. In the process of shooting the patient's tongue image, in addition to the negative effects that may be caused by high exposure, special attention should be paid to the low exposure problem caused by insufficient light. Low exposure will cause the overall image to be dark, which will cause the details of the tongue coating area to be blurred or difficult to identify. Unlike high exposure, low exposure will have a significant impact on the global area of ​​the image. Therefore, in the process of image evaluation, it is necessary to fully consider whether there are low-exposure areas.

[0050] In addition, when an image shows low brightness due to insufficient light, all its internal regions will show the commonality of low brightness, which is specifically manifested as a narrow grayscale range and a reduction in the overall grayscale variance. This feature is reflected in the grayscale images of the three RGB color channels.

[0051] Step S301, analyzing the grayscale distribution differences of the tongue grayscale image in each channel, and calculating the low grayscale expression degree and low grayscale expression difference of the tongue grayscale image.

[0052] Specifically, as an embodiment, the method for obtaining the low grayscale expression degree includes: obtaining the low grayscale expression degree of the tongue grayscale image in the corresponding channel according to the grayscale distribution of the tongue grayscale image in any channel.

[0053] As an embodiment, a specific method for calculating the low gray level expression degree of the tongue gray image in any channel is as follows: ; in , Indicates the grayscale image of the tongue The degree of low grayscale expression under the channel; represents the grayscale mean of the tongue grayscale image, Represents the grayscale span of the tongue grayscale image, Represents the grayscale variance of the tongue grayscale image; express aisle; express aisle; express aisle; represents the linear normalization function.

[0054] The grayscale span is the difference between the maximum grayscale value and the minimum grayscale value in the tongue grayscale image.

[0055] It should be noted that when the grayscale image of the tongue has a low grayscale mean in a single channel, and its grayscale is concentrated in the low grayscale area and the grayscale span is small, the low grayscale expression degree of the image is high.

[0056] Secondly, according to the difference in the low grayscale expression degree of the tongue grayscale image in the R channel and in other channels, the difference in the low grayscale expression of the tongue grayscale image is obtained.

[0057] As an embodiment, the specific calculation method of the low grayscale expression difference of the tongue grayscale image is: ; in, Indicates the difference in low grayscale performance of the grayscale image of the tongue; express aisle; express aisle; Indicates the grayscale image of the tongue The degree of low grayscale expression under the channel; Represents the absolute value symbol.

[0058] It should be noted that, in general, for a grayscale image of the tongue under normal illumination, the grayscale distribution span is relatively large, and there are a certain number of highlight areas. It represents the difference between the low grayscale expression degree of the grayscale image of the R channel and the other two channels. The smaller the result is, the smaller it is, which means that the segmented images of each channel of the current image are all low grayscale features.

[0059] Step S302, combining the difference in low grayscale expression of the tongue grayscale image and the degree of low grayscale expression in all channels, obtains the degree of illumination deficiency of the tongue grayscale image, and screens the tongue grayscale image to obtain a tongue image with abnormal illumination.

[0060] It should be noted that the above process uses multi-channel tongue image area comparison to analyze the high exposure and insufficient lighting conditions of the images taken by the patient. To this end, it is first necessary to screen the relevant tongue area images taken by the patient according to the above analysis. The high-exposure image can be obtained by performing the highest exposure analysis on the corresponding area with the highest exposure in the image, while the insufficiently lit image can be obtained by analyzing the degree of light loss in the image.

[0061] Specifically, as an embodiment, the specific method for obtaining the degree of illumination deficiency is: respectively obtain the mean of the low grayscale expression degree in all channels of any tongue grayscale image, and the low grayscale expression difference of the tongue grayscale image, and obtain the degree of illumination deficiency of the tongue grayscale image according to the mean and the low grayscale expression difference, wherein the mean is positively correlated with the degree of illumination deficiency, and the low grayscale expression difference is negatively correlated with the degree of illumination deficiency.

[0062] As an embodiment, a specific method for calculating the degree of illumination loss of any tongue grayscale image is as follows: ; in, Indicates the degree of illumination loss in the grayscale image of the tongue. It represents the mean value of low gray level expression in all channels of the tongue gray image; Indicates the difference in low grayscale performance of the grayscale image of the tongue; represents the linear normalization function.

[0063] Then, according to the degree of illumination deficiency in the grayscale image of the tongue, the tongue image with abnormal illumination is screened.

[0064] As an embodiment, the specific method for screening tongue images with abnormal lighting is: when there is a sub-area in the tongue grayscale image with an exposure degree greater than or equal to 0.8, or the degree of illumination loss in the tongue grayscale image is greater than or equal to 0.6, the tongue grayscale image is a tongue image with abnormal lighting, wherein when there is a sub-area in the tongue grayscale image with an exposure degree greater than or equal to 0.8, the corresponding tongue grayscale image is recorded as an overexposed tongue image, and when the degree of illumination loss in the tongue grayscale image is greater than or equal to 0.6, the corresponding tongue grayscale image is recorded as an underexposed tongue image.

[0065] At this point, the tongue image with abnormal lighting is obtained through the above method.

[0066] Step S004: Obtain the contrast enhancement amplitude of the sub-region according to the gray value distribution of all pixels in each sub-region in the tongue image with abnormal illumination on each channel.

[0067] It should be noted that for tongue images with abnormal lighting, we can make overall adjustments based on the degree of lighting deviation to improve image quality. However, in the process of adjusting the tongue area, the contrast level relationship between the various areas must be carefully considered to ensure that while enhancing the overall image effect, it can effectively compensate for the interference caused by insufficient light and significantly improve the detail clarity of the tongue area.

[0068] It should be noted that, under normal circumstances, the corresponding grayscale features between sub-regions in the grayscale image of the tongue are often similar. If there is a sub-region with high texture complexity, the grayscale values ​​of the RGB three channels can be regarded as multi-dimensional features of the pixels. When the multi-channel dimensional features of the pixels in the region show a high discreteness, while the grayscale difference in the grayscale image is relatively small, it indicates that the contrast of the sub-region needs to be enhanced. Based on this, the embodiment of the present invention further calculates the contrast enhancement amplitude required within the sub-region to achieve more accurate and effective image optimization.

[0069] Specifically, first, for any tongue image with abnormal lighting, obtain an array composed of the grayscale values ​​of the three channels R, G, and B for each pixel in any sub-region, which is recorded as the color array of the corresponding pixel; obtain the average color array of all pixels in any sub-region, which is used as the average color array of the corresponding sub-region.

[0070] Then, according to the distance between the color arrays of all pixels in any sub-region and the average color array of the sub-region, the channel discreteness of the sub-region is obtained.

[0071] As an embodiment, a specific method for calculating the channel discreteness of the sub-region is as follows: ; in, Indicates The channel discreteness of each sub-region; Indicates The number of pixels in each sub-region; Indicates obtaining the Euclidean distance; Indicates In the sub-area The color array of pixels; Indicates The average color array of sub-regions; represents the linear normalization function.

[0072] Finally, the grayscale discreteness of any sub-region is obtained. When the channel discreteness of the sub-region is greater than the grayscale discreteness of the sub-region, the contrast enhancement amplitude of the sub-region is obtained according to the difference between the channel discreteness and the grayscale discreteness of the sub-region.

[0073] As an embodiment, the method for obtaining the contrast enhancement amplitude is: Get the The standard deviation of the grayscale values ​​of all pixels in the sub-region is calculated and normalized to obtain the grayscale discreteness of the sub-region.

[0074] ; in, Indicates The contrast enhancement amplitude of each sub-region; Indicates The channel discreteness of each sub-region; Indicates The grayscale discreteness of each sub-region.

[0075] So far, the contrast enhancement amplitude of the sub-region is obtained through the above method.

[0076] Step S005: respectively combining the exposure degree, the light deficiency degree and the contrast enhancement degree, so as to perform image enhancement processing on the tongue images with different light abnormalities.

[0077] It should be noted that for any tongue image with abnormal illumination, if it is an overexposed tongue image, the exposure level of each sub-area will be reduced to reduce the internal grayscale value, and the internal pixels will be further fine-tuned according to the corresponding contrast enhancement range. On the contrary, if it is an underexposed tongue image, the grayscale value of the image will be globally increased according to the degree of overall illumination loss, and the internal pixels will be deeply adjusted in combination with the corresponding contrast enhancement range to optimize the image quality.

[0078] Specifically, the overexposed tongue image is enhanced. As an embodiment, the specific method is as follows: The grayscale distribution in the sub-region is adjusted according to the exposure degree of the sub-region and in combination with the contrast enhancement amplitude to obtain the adjusted grayscale value of each pixel in the sub-region.

[0079] As an embodiment, the method for calculating the adjusted grayscale value of any pixel in any sub-region is: ; in, Indicates In the sub-area The adjusted gray value of pixels; Indicates In the sub-area The original gray value of each pixel; Indicates The exposure level of each sub-area; Indicates The grayscale mean of all pixels in the sub-region is Represents the grayscale mean of all pixels in the tongue area of ​​the overexposed tongue image; Indicates The contrast enhancement of each sub-region.

[0080] It should be noted that Indicates the overall decreased grayscale value of the sub-region. When the difference between the grayscale value of the sub-region and the overall grayscale mean is greater, the grayscale value of the sub-region needs to be adjusted more. When the exposure level of the sub-region is higher, the grayscale value of the sub-region needs to be lowered more. It represents the gray value of a single pixel point in the sub-region after the overall down-regulation, and finally enhances it according to different gray values ​​in combination with the contrast enhancement degree of the region itself. In this way, the contrast of the feature information is improved while adjusting the overall image exposure. The embodiment of the present invention adjusts the overexposed tongue image, reduces the grayscale of the overexposed region based on the overall grayscale mean value, and adjusts it in combination with the contrast enhancement amplitude of the corresponding sub-region.

[0081] Image enhancement is performed on the underexposed tongue image. As an embodiment, the specific method includes: According to the degree of illumination loss of the grayscale image of the tongue and the contrast enhancement amplitude of the sub-region, the grayscale distribution in the sub-region is adjusted to obtain the adjusted grayscale value of each pixel in the sub-region.

[0082] As an embodiment, the method for calculating the adjusted grayscale value of any pixel in any sub-region is: ; in, Indicates In the sub-area The adjusted gray value of pixels; Indicates In the sub-area The original gray value of each pixel; Indicates the degree of illumination loss in the grayscale image of the tongue; Indicates The grayscale mean of all pixels in the sub-area; Indicates The contrast enhancement of each sub-region.

[0083] It should be noted that the embodiment of the present invention processes the overall illumination deficiency degree of the underexposed tongue image, linearly improves the grayscale mean of the corresponding area, and adjusts the contrast enhancement scale of the corresponding area at the same time.

[0084] It should be noted that in current medical practice, tongue images taken by patients themselves are often interfered by external light factors. To solve this problem, the embodiment of the present invention adopts image enhancement processing technology. Through this technology, not only the overall grayscale value of the image can be adjusted, but also the contrast of abnormal tongue coating areas can be significantly enhanced. This measure effectively reduces the error caused by external environmental interference to the diagnostic results, thereby improving the accuracy and reliability of subsequent visual diagnosis results.

[0085] At this point, this embodiment is completed.

[0086] It should be noted that the The model is only used to represent negative correlation and constrain the output of the model to be in In the specific implementation, it can be replaced by other models with the same purpose. This embodiment is only based on The model is described as an example without any specific limitation. is the input to the model.

[0087] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A computer vision-based TCM image enhancement method, characterized in that: The method comprises the following steps: Obtain the patient's RGB tongue image and perform preprocessing to obtain a tongue grayscale image; Obtain the tongue body area in the tongue grayscale image and divide the tongue body area into several sub-areas, and obtain the exposure degree of the sub-area by combining the morphological characteristics of any sub-area, the grayscale difference between the R channel and other channels, and the grayscale level of adjacent sub-areas of the sub-area; Based on the grayscale distribution difference of the tongue grayscale image in each channel, the degree of illumination deficiency of the tongue grayscale image is obtained to screen out tongue images with abnormal illumination; According to the gray value distribution of each sub-region pixel point in the abnormal lighting tongue image in all channels, the contrast enhancement amplitude of the sub-region is obtained; The exposure degree, the light deficiency degree and the contrast enhancement degree are combined respectively, so as to perform image enhancement processing on tongue images with different light abnormalities; The exposure degree of the sub-region is obtained by combining the morphological features of any sub-region, the grayscale difference between the R channel and other channels, and the grayscale levels of adjacent sub-regions of the sub-region, including the specific method of: Obtain the average grayscale of any sub-region in each color channel, and obtain the R difference parameter of the sub-region according to the difference between the average grayscale of the R channel of any sub-region and other channels; Obtaining the exposure degree of the sub-region according to the morphological characteristics of the sub-region, the R difference parameter, and the gray levels of other sub-regions adjacent to the sub-region; The specific method for obtaining the exposure degree is: The area of ​​the sub-region and the area of ​​the corresponding minimum circumscribed circle are obtained, and the exposure degree of the sub-region is obtained by combining the difference between the area of ​​the sub-region and the area of ​​the corresponding minimum circumscribed circle, the R difference parameter of the sub-region, and the average grayscale of other sub-regions adjacent to the sub-region; The specific calculation method of the exposure degree of any sub-area is: in, Indicates The exposure level of each sub-area; Indicates The area of ​​the sub-region; Indicates The area of ​​the smallest circumscribed circle of each sub-region; Indicates R difference parameter of each sub-region; Indicates The average grayscale of all adjacent sub-regions of a sub-region; Used to describe the The morphological characteristics of each sub-region; The specific method for obtaining the degree of light deficiency is: Respectively obtain the mean of the low grayscale expression degree under all channels of any tongue grayscale image and the low grayscale expression difference of the tongue grayscale image, and obtain the illumination deficiency degree of the tongue grayscale image according to the mean and the low grayscale expression difference, wherein the mean is positively correlated with the illumination deficiency degree, and the low grayscale expression difference is negatively correlated with the illumination deficiency degree; The specific method of obtaining the contrast enhancement amplitude of the sub-region according to the gray value distribution of the pixel points of each sub-region in the abnormal illumination tongue image in all channels includes: For any tongue image with abnormal lighting, obtain the array composed of the grayscale values ​​of the three channels R, G, and B for each pixel in any sub-region, and record it as the color array of the corresponding pixel; obtain the average color array of all pixels in any sub-region as the average color array of the corresponding sub-region; Obtaining the channel discreteness of the sub-region according to the distance between the color arrays of all pixels in any sub-region and the average color array of the sub-region; The grayscale discreteness of any sub-region is obtained. When the channel discreteness of the sub-region is greater than the grayscale discreteness of the sub-region, the contrast enhancement amplitude of the sub-region is obtained according to the difference between the channel discreteness and the grayscale discreteness of the sub-region.

2. According to the computer vision-based TCM image enhancement method of claim 1, it is characterized in that: The specific method of obtaining the tongue body area in the tongue image grayscale image and dividing the tongue body area into a plurality of sub-areas includes: The tongue area in the tongue grayscale image is obtained by using semantic segmentation technology; The tongue area is divided into several sub-areas using the superpixel segmentation algorithm.

3. According to the computer vision-based TCM image enhancement method of claim 1, it is characterized in that: The method of obtaining the degree of illumination deficiency of the tongue grayscale image based on the grayscale distribution difference of the tongue grayscale image in each channel to screen out tongue images with abnormal illumination includes the following specific methods: Analyze the grayscale distribution differences of the tongue grayscale image in each channel, and calculate the low grayscale expression degree and low grayscale expression differences of the tongue grayscale image; Combining the difference in low grayscale expression of the tongue grayscale image and the degree of low grayscale expression in all channels, the degree of illumination deficiency of the tongue grayscale image is obtained, and the tongue grayscale image is screened to obtain the tongue image with abnormal illumination.

4. According to the computer vision-based TCM image enhancement method of claim 3, it is characterized in that: The specific calculation method of the low grayscale expression degree is: in , Indicates the grayscale image of the tongue The degree of low grayscale expression under the channel; represents the grayscale mean of the tongue grayscale image, Represents the grayscale span of the tongue grayscale image, Represents the grayscale variance of the tongue grayscale image; express aisle; express aisle; express aisle; represents the linear normalization function.

5. According to the computer vision-based TCM image enhancement method of claim 1, it is characterized in that: The specific calculation method of the channel discrete degree is: in, Indicates The channel discreteness of each sub-region; Indicates The number of pixels in each sub-region; Indicates obtaining the Euclidean distance; Indicates In the sub-area The color array of pixels; Indicates The average color array of sub-regions; represents the linear normalization function.

6. According to the computer vision-based TCM image enhancement method of claim 1, it is characterized in that: The exposure degree, the light deficiency degree and the contrast enhancement degree are respectively combined to perform image enhancement processing on tongue images with different light abnormalities, and the specific methods include: The grayscale distribution in the sub-region is adjusted according to the exposure degree of the sub-region and in combination with the contrast enhancement amplitude to obtain the adjusted grayscale value of each pixel in the sub-region; According to the degree of illumination loss of the tongue grayscale image and the contrast enhancement amplitude of the sub-region, the grayscale distribution in the sub-region is adjusted to obtain the adjusted grayscale value of each pixel in the sub-region.

Citation Information

Cited By

  • Traditional Chinese medicine tongue diagnosis tongue image processing method based on computer vision

    CN120411078A

  • Traditional Chinese medicine tongue image recognition method and system based on image processing

    CN120726059A

  • A traditional Chinese medicine tongue image recognition method and system based on image processing

    CN120726059B