A computer vision-based method for enhancing images of tongue diagnosis in traditional Chinese medicine

Through computer vision technology, the brightness and color consistency of the tongue diagnosis image are obtained, the reference image is screened and the light compensation is performed, which solves the problem of color deviation of the tongue diagnosis image and improves the enhancement effect and diagnostic accuracy of the tongue diagnosis image.

CN118822858BActive Publication Date: 2024-11-15TIANJIN MEDVALLEY TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411303452.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2024-11-15
Estimated Expiration
2044-09-19

AI Technical Summary

Technical Problem

The color of the tongue diagnosis image may be biased and distorted, resulting in inconsistent diagnostic results. The existing light compensation algorithm has poor enhancement effect when the ambient light intensity is uncertain.

Method used

Using a computer vision-based method, by obtaining the brightness consistency and color consistency of the tongue diagnosis image, the quality score and correction quality score are calculated, the reference image is selected, and the light compensation is performed according to the ambient light intensity to generate a tongue diagnosis enhanced image.

Benefits of technology

It improves the accuracy of quantification of brightness characteristics and image enhancement effect of tongue diagnosis images, enhances the consistency of color distribution of tongue diagnosis images, and improves the objectivity and accuracy of diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118822858B_ABST
    Figure CN118822858B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image technology, and in particular to a computer vision-based method for enhancing a tongue diagnosis image of traditional Chinese medicine, comprising: obtaining a tongue diagnosis image to be detected and a plurality of tongue diagnosis images and their ambient light intensities. Dividing each tongue diagnosis image into a plurality of regions, and calculating the brightness consistency. Performing color quantization on each tongue diagnosis image, and calculating the color complexity of each region in blocks. Calculating the color consistency according to the V channel value and the color complexity. Combining the brightness consistency and the color consistency, obtaining a quality score for each tongue diagnosis image, and further calculating a corrected quality score; screening a reference image to be detected from the tongue diagnosis image according to the corrected quality score; and obtaining a tongue diagnosis enhanced image according to the ambient light intensity of the reference image to be detected. The present invention improves the effect of enhancing the tongue diagnosis image to be detected by analyzing the pixel points of the tongue diagnosis image and the tongue diagnosis image to be detected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Tongue diagnosis, as an important part of traditional Chinese medicine diagnosis, has always been used to diagnose diseases with its unique perspective and methods. However, direct observation during tongue diagnosis is limited by the doctor's subjective experience and diagnostic environment, which can easily lead to inconsistent diagnostic results. With the development of digital and intelligent technology, the establishment and improvement of tongue diagnosis image acquisition systems has become a key technical path to improve the objectivity and accuracy of tongue diagnosis.

[0003] Due to the influence of different acquisition equipment, environmental conditions, individual differences and other factors, the color of the tongue diagnosis image may be biased and distorted. For example, when the ambient light intensity of the tongue diagnosis image is uncertain, directly using the illumination compensation algorithm to enhance the image will not have a very good enhancement effect. Summary of the invention

[0004] The present invention provides a computer vision-based traditional Chinese medicine tongue diagnosis image enhancement method to solve the existing problems.

[0005] The computer vision-based TCM tongue diagnosis image enhancement method of the present invention adopts the following technical solution:

[0006] An embodiment of the present invention provides a method for enhancing a tongue diagnosis image in traditional Chinese medicine based on computer vision, the method comprising the following steps:

[0007] Acquire a tongue diagnosis image to be detected, a plurality of tongue diagnosis images, and the ambient light intensity of each tongue diagnosis image;

[0008] Each tongue diagnosis image is equally divided into a number of tongue diagnosis block areas; according to the grayscale values ​​of all pixels of each tongue diagnosis image and the number of tongue diagnosis block areas, the brightness consistency of each tongue diagnosis image is obtained;

[0009] Obtain a color quantized tongue diagnosis image corresponding to each tongue diagnosis image; divide each color quantized tongue diagnosis image into a number of color quantized tongue diagnosis block areas; construct a rectangular coordinate system for each color quantized tongue diagnosis image, and obtain the color complexity of each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image on the rectangular coordinate system according to the coordinates of all pixel points and the number of colors in each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image; obtain the color consistency of each color quantized tongue diagnosis image according to the V channel values ​​of all pixel points of each color quantized tongue diagnosis image and the color complexity of each color quantized tongue diagnosis block area;

[0010] Quantifying the color consistency of each tongue diagnosis image according to the brightness consistency of each tongue diagnosis image and the color corresponding to each tongue diagnosis image, and obtaining a quality score for each tongue diagnosis image;

[0011] According to the quality score of each tongue diagnosis image and the V channel values ​​of all pixel points in all color quantization tongue diagnosis block areas of the color quantization tongue diagnosis image corresponding to each tongue diagnosis image, the corrected quality score of each tongue diagnosis image is obtained; according to the acquisition method of the corrected quality score of each tongue diagnosis image, the corrected quality score of the tongue diagnosis image to be detected is obtained; according to the corrected quality score of each tongue diagnosis image and the tongue diagnosis image to be detected, the reference image to be detected is screened out from the tongue diagnosis images; according to the ambient light intensity of the reference image to be detected, the tongue diagnosis enhanced image is obtained.

[0012] Furthermore, according to the grayscale values ​​of all pixels of each tongue diagnosis image and the number of tongue diagnosis block areas, the specific calculation formula corresponding to the brightness consistency of each tongue diagnosis image is obtained as follows:

[0013]

[0014] in, Indicates Brightness consistency of tongue examination images; Indicates The number of tongue diagnosis block areas of the tongue diagnosis image; Indicates The mean gray value of all pixels in the tongue diagnosis image; Indicates Tongue diagnosis image The mean gray value of all pixels in the tongue diagnosis block area; represents the absolute value function.

[0015] Furthermore, the rectangular coordinate system of each color quantized tongue diagnosis image is constructed, and the color complexity of each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image is obtained according to the coordinates and color quantity of all pixel points of each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image on the rectangular coordinate system, and the specific steps included are as follows:

[0016] A rectangular coordinate system is constructed with the vertex of the lower left corner of each color quantization tongue diagnosis image as the origin, the horizontal right direction as the positive direction of the horizontal axis, and the vertical upward direction as the positive direction of the vertical axis, to obtain the horizontal and vertical coordinates of each pixel point of each color quantization tongue diagnosis image;

[0017] Obtain the degree of disorder of all pixels of each color in each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image according to the horizontal and vertical coordinates of all pixels of each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image in a rectangular coordinate system;

[0018] According to the disorder degree and the number of colors of all pixels of each color in each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image, the color complexity of each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image is obtained.

[0019] Furthermore, according to the degree of disorder and the number of colors of all pixels of each color in each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image, the specific calculation formula corresponding to the color complexity of each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image is obtained as follows:

[0020]

[0021] in, Indicates Color quantization tongue diagnosis image The color quantifies the color complexity of the tongue diagnosis block area; No. Color quantization tongue diagnosis image Each color quantifies the number of colors in the tongue diagnosis block area; No. Color quantization tongue diagnosis image Color quantification of tongue diagnosis block area The number of pixels of different colors; No. Color quantization tongue diagnosis image Color quantification of tongue diagnosis block area Color The horizontal coordinate of the pixel point; No. Color quantization tongue diagnosis image Color quantification of tongue diagnosis block area Color The vertical coordinate of the pixel; Indicates Color quantization tongue diagnosis image Color quantification of tongue diagnosis block area The mean of the horizontal coordinates of all pixels of the same color; Indicates Color quantization tongue diagnosis image Color quantification of tongue diagnosis block area The mean of the ordinates of all pixels of the same color; Indicates Color quantization tongue diagnosis image Color quantification of tongue diagnosis block area The degree of chaos of all pixels of a certain color.

[0022] Furthermore, the color consistency of each color quantization tongue diagnosis image is obtained according to the V channel values ​​of all pixels of each color quantization tongue diagnosis image and the color complexity of each color quantization tongue diagnosis block area, and the specific steps include the following:

[0023] calculate With The absolute value of the difference between the mean values ​​of the V channel values ​​of all pixels of the color quantized tongue diagnosis image is added to the absolute value of the difference. The reciprocal of the product of the color complexity standard deviations of all color quantized tongue diagnosis block areas of the color quantized tongue diagnosis image is recorded as The color consistency of the tongue diagnosis image is quantified by color; Indicates a preset constant.

[0024] Furthermore, the color consistency of the tongue diagnosis image is quantified according to the brightness consistency of each tongue diagnosis image and the color corresponding to each tongue diagnosis image to obtain the quality score of each tongue diagnosis image, and the specific steps include the following:

[0025] The first The brightness consistency of tongue diagnosis images is The normalized value of the inverse of the product of the color consistency of the color quantization tongue diagnosis image corresponding to the tongue diagnosis image is recorded as Quality scoring of tongue diagnosis images.

[0026] Furthermore, the corrected quality score of each tongue diagnosis image is obtained according to the quality score of each tongue diagnosis image and the V channel values ​​of all pixels of all color quantized tongue diagnosis block areas of the color quantized tongue diagnosis image corresponding to each tongue diagnosis image, and the specific steps include the following:

[0027] In the In the color quantization tongue diagnosis image corresponding to the tongue diagnosis image, the mean and sum of the V channel values ​​of all pixels in each color quantization tongue diagnosis block area are calculated. The absolute value of the difference between the mean V channel values ​​of all pixels in each color quantization tongue diagnosis block area and The maximum value of the absolute value of the difference minus The difference is recorded as The optimal adjustment value of the tongue diagnosis image; among them, Indicates a preset constant;

[0028] According to the optimal adjustment value and correction quality score of each tongue diagnosis image, the correction quality score of each tongue diagnosis image is obtained.

[0029] Furthermore, the step of obtaining the corrected quality score of each tongue diagnosis image according to the optimal adjustment value and the corrected quality score of each tongue diagnosis image includes the following specific steps:

[0030] The first The quality score of the tongue diagnosis image is minus the The difference between the optimal adjustment values ​​of the tongue diagnosis image is recorded as Corrected quality score of tongue examination images.

[0031] Furthermore, the method of selecting a reference image to be detected from the tongue diagnosis images according to the corrected quality score of each tongue diagnosis image and the tongue diagnosis image to be detected includes the following specific steps:

[0032] The tongue diagnosis image with the smallest absolute value of the difference between the corrected quality score of the image to be detected and the image to be detected is recorded as the reference image to be detected.

[0033] Furthermore, the step of obtaining the tongue diagnosis enhanced image according to the ambient light intensity of the reference image to be detected includes the following specific steps:

[0034] According to the ambient light intensity of the reference image to be detected, the illumination compensation algorithm is used to operate the tongue diagnosis image to be detected to obtain the tongue diagnosis enhanced image.

[0035] The beneficial effects of the technical solution of the present invention are:

[0036] Obtain the tongue diagnosis image to be detected, several tongue diagnosis images and the ambient light intensity of each tongue diagnosis image, obtain the brightness consistency of each tongue diagnosis image, and accurately reflect the brightness of each tongue diagnosis image. Obtain the color quantized tongue diagnosis image corresponding to each tongue diagnosis image, obtain the color complexity of each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image, and accurately reflect the color distribution of different areas of the tongue diagnosis image. Obtain the color consistency of each color quantized tongue diagnosis image, and further accurately reflect the color of the tongue diagnosis image. According to the brightness consistency of each tongue diagnosis image and the color consistency of the color quantized tongue diagnosis image corresponding to each tongue diagnosis image, obtain the quality score of each tongue diagnosis image, and accurately quantify the brightness characteristics of the tongue diagnosis image. Obtain the corrected quality score of each tongue diagnosis image, and further improve the accuracy of the quantization of the brightness characteristics of the tongue diagnosis image. According to the corrected quality score of each tongue diagnosis image and the tongue diagnosis image to be detected, select the reference image to be detected from the tongue diagnosis image, and improve the effect of subsequent image enhancement. According to the ambient light intensity of the reference image to be detected, obtain the tongue diagnosis enhanced image. The present invention improves the effect of enhancing the tongue diagnosis image to be detected by analyzing the pixel points of the tongue diagnosis image and the tongue diagnosis image to be detected. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] 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.

[0038] Figure 1 The present invention is a flowchart of the steps of a computer vision-based method for enhancing a traditional Chinese medicine tongue diagnosis image. DETAILED DESCRIPTION

[0039] 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 tongue 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.

[0040] 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.

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

[0042] See also Figure 1 , which shows a flowchart of a method for enhancing a tongue diagnosis image of traditional Chinese medicine based on computer vision provided by an embodiment of the present invention, the method comprising the following steps:

[0043] Step S001: obtaining a tongue diagnosis image to be detected, a plurality of tongue diagnosis images, and the ambient light intensity of each tongue diagnosis image.

[0044] It should be noted that since online TCM tongue diagnosis breaks through geographical restrictions, patients do not need to go to the hospital in person and can receive professional TCM diagnosis and treatment at home. Most of the images received by doctors are taken by patients themselves. Because the patients are in different lighting environments when taking pictures, these images will show a variety of different color characteristics, such as the aperture size of the equipment used by the patients when taking pictures, and the different light source environments when taking pictures, etc. Therefore, before performing image correction, the light intensity of the image should be obtained first to improve the image correction effect.

[0045] The patient's tongue is photographed at the same angle under 20 different light intensities to obtain 20 tongue diagnosis images, the ambient light intensity of each tongue diagnosis image is recorded, all tongue diagnosis images are stored in a database, and a tongue diagnosis image database is constructed. Then the tongue diagnosis image to be tested is obtained.

[0046] It should be noted that each tongue diagnosis image is in the format of a 400*400 resolution JPG image. The ambient light intensity of each tongue diagnosis image is recorded to facilitate subsequent light intensity matching. In this embodiment, tongue diagnosis images are analyzed. Tongue observation is the most representative method of tongue diagnosis. Its tongue image reflects various visceral lesions more accurately and has high practical value.

[0047] Step S002: Divide each tongue diagnosis image into a number of tongue diagnosis block areas; obtain the brightness consistency of each tongue diagnosis image according to the grayscale values ​​of all pixels of each tongue diagnosis image and the number of tongue diagnosis block areas.

[0048] It should be noted that the present invention does not focus on the differences in tongue quality, tongue coating, etc. shown in tongue slices of patients with different diseases, but focuses on minimizing the impact of external factors such as illumination on tongue slice images of different patients, that is, achieving this through brightness standardization. Therefore, in the present invention, it can be said that tongue slices taken under the same external environment are "similar", although they belong to different patients and their tongue images are different.

[0049] It is further necessary to explain that: for a tongue diagnosis image, the more consistent the overall brightness of the tongue diagnosis image is with the brightness of its various parts, the higher the quality of the tongue diagnosis image; if the overall brightness of the tongue diagnosis image is very different from the brightness of its various parts, it is considered that the tongue diagnosis image may have too strong or too weak illumination, resulting in a more prominent high-frequency or low-frequency area in the tongue diagnosis image, that is, the quality of the tongue diagnosis image is low.

[0050] use * The window divides each tongue diagnosis image into several equal areas, which are recorded as tongue diagnosis block areas. is the preset window threshold. The preset window threshold in this embodiment is The value is 8, and this is used as an example for description.

[0051] First Take the tongue diagnosis image as an example, then The specific calculation formula corresponding to the brightness consistency of the tongue diagnosis image is:

[0052]

[0053] in, Indicates Brightness consistency of tongue examination images; Indicates The number of tongue diagnosis block areas of the tongue diagnosis image; Indicates The mean gray value of all pixels in the tongue diagnosis image; Indicates Tongue diagnosis image The mean gray value of all pixels in the tongue diagnosis block area; represents the absolute value function.

[0054] What needs to be explained is: and Proportional, The larger the value of The greater the brightness consistency of the tongue diagnosis images, the greater the brightness consistency of the tongue diagnosis images. Among them, each tongue diagnosis image is grayed to obtain the gray value of each pixel of each tongue diagnosis image.

[0055] Through the above process, we obtain Brightness consistency of tongue diagnosis images.

[0056] Each tongue diagnosis image is operated according to the above process to obtain the brightness consistency of each tongue diagnosis image.

[0057] Step S003: Obtain the color quantized tongue diagnosis image corresponding to each tongue diagnosis image; divide each color quantized tongue diagnosis image into several color quantized tongue diagnosis block areas; construct a rectangular coordinate system for each color quantized tongue diagnosis image, and obtain the color complexity of each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image on the rectangular coordinate system according to the coordinates of all pixel points in each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image and the number of colors; obtain the color consistency of each color quantized tongue diagnosis image according to the V channel values ​​of all pixel points of each color quantized tongue diagnosis image and the color complexity of each color quantized tongue diagnosis block area.

[0058] It should be noted that: the brightness consistency of the tongue diagnosis image is calculated through the above process, and the color of the tongue diagnosis image needs to be taken into consideration next. Specifically, if the tongue diagnosis image is shot under strong or weak light, there will often be "overexposure" or "too dark" in the local area of ​​the tongue diagnosis image. In the tongue slice, the color difference between different areas is more obvious. For example, the colors of the tongue, teeth, cheek skin and other parts are different, while the color performance within each area is relatively consistent. The parts of the tongue diagnosis image that should have shown the same color will show different colors due to the influence of light; the RGB color space cannot express this situation very intuitively, so the HSV color model is used in the present invention to analyze the image color.

[0059] Each tongue diagnosis image is operated using the mutual conversion technology of RGB and HSV to obtain a number of HSV tongue diagnosis images. Among them, the mutual conversion technology of RGB and HSV is a well-known technology, and the specific method is not introduced here.

[0060] According to the preset number of target colors, the minimum variance quantization method is used to calculate each HSV tongue diagnosis image to obtain the color quantized tongue diagnosis image corresponding to each HSV tongue diagnosis image and the number of colors of each color quantized tongue diagnosis image. Among them, the preset number of target colors in this embodiment is 16, which is used as an example for description; the minimum variance quantization method is a well-known technology, and the specific method is not introduced here.

[0061] It should be noted that the minimum variance quantization method is an image quantization technology, whose goal is to minimize the quantization error of the image by selecting the optimal quantization level; color quantization is the number of colors of the tongue diagnosis image, that is, the number of types of grayscale values ​​after quantization.

[0062] According to the method of obtaining the tongue diagnosis block regions, a plurality of color quantization tongue diagnosis block regions are obtained for each color quantization tongue diagnosis image.

[0063] A rectangular coordinate system is constructed with the vertex of the lower left corner of each color quantization tongue diagnosis image as the origin, horizontally to the right as the positive direction of the horizontal axis, and vertically upward as the positive direction of the vertical axis to obtain the horizontal and vertical coordinates of each pixel point of each color quantization tongue diagnosis image.

[0064] First Take the color quantization tongue diagnosis image as an example, then Color quantization tongue diagnosis image The specific calculation formula corresponding to the color complexity of each color quantified tongue diagnosis block area is:

[0065]

[0066] in, Indicates Color quantization tongue diagnosis image The color quantifies the color complexity of the tongue diagnosis block area; No. Color quantization tongue diagnosis image Each color quantifies the number of colors in the tongue diagnosis block area; No. Color quantization tongue diagnosis image Color quantification of tongue diagnosis block area The number of pixels of different colors; No. Color quantization tongue diagnosis image Color quantification of tongue diagnosis block area Color The horizontal coordinate of the pixel point; No. Color quantization tongue diagnosis image Color quantification of tongue diagnosis block area Color The vertical coordinate of the pixel; Indicates Color quantization tongue diagnosis image Color quantification of tongue diagnosis block area The mean of the horizontal coordinates of all pixels of the same color; Indicates Color quantization tongue diagnosis image Color quantification of tongue diagnosis block area The mean value of the vertical coordinates of all pixels of the same color.

[0067] What needs to be explained is: and Proportional, The larger the value of Color quantization tongue diagnosis image There are many colors in the color quantification tongue diagnosis block area, so Color quantization tongue diagnosis image The greater the color complexity of the tongue diagnosis block area, the better the color quantification. Indicates Color quantization tongue diagnosis image Color quantification of tongue diagnosis block area The greater the degree of disorder of all pixels of a color, the Indicates Color quantization tongue diagnosis image The greater the color complexity of the tongue diagnosis block area, the better the color quantification.

[0068] Through the above process, we obtain Color quantization tongue diagnosis image The color quantifies the color complexity of the tongue diagnosis block area.

[0069] Each color quantized tongue diagnosis block region of each color quantized tongue diagnosis image is operated according to the above process to obtain the color complexity of each color quantized tongue diagnosis block region of each color quantized tongue diagnosis image.

[0070] The first The specific calculation formula corresponding to the color consistency of the color quantization tongue diagnosis image is:

[0071]

[0072] in, Indicates Zhang color quantifies the color consistency of tongue diagnosis images; Indicates The color complexity standard deviation of all color quantization tongue diagnosis block areas in the color quantization tongue diagnosis image; Indicates The mean value of the V channel value of all pixels in the color quantization tongue diagnosis image; Indicates a preset constant.

[0073] What needs to be explained is: Indicates The difference between the mean value of the V channel value of all pixels in the color quantization tongue diagnosis image and the median value of the brightness, The smaller the value of The more likely the lighting environment of the first color quantization tongue diagnosis image is standard lighting, the The greater the color consistency of the color quantified tongue diagnosis image; and Inversely proportional, The larger the value of The greater the color consistency of the color quantized tongue diagnosis image, the greater the color consistency of the color quantized tongue diagnosis image. The value is 0.5, and this example is used for description.

[0074] Through the above process, we obtain Color quantification of tongue diagnosis images.

[0075] Each color quantization tongue diagnosis image is operated according to the above process to obtain the color consistency of each color quantization tongue diagnosis image.

[0076] Step S004: quantifying the color consistency of each tongue diagnosis image according to the brightness consistency of each tongue diagnosis image and the color corresponding to each tongue diagnosis image, and obtaining a quality score for each tongue diagnosis image.

[0077] It should be noted that: through the above process, the brightness consistency of the tongue diagnosis image and the color consistency of the color quantized tongue diagnosis image corresponding to the tongue diagnosis image are obtained. Since the specific ambient light intensity of the tongue diagnosis image to be detected is unknown, an indicator is needed to match the tongue diagnosis image to be detected with the tongue diagnosis image with known ambient light intensity in the database, so as to determine the ambient light intensity of the tongue diagnosis image to be detected.

[0078] First Take the tongue diagnosis image as an example, then The specific calculation formula corresponding to the quality score of tongue diagnosis images is:

[0079]

[0080] in, Indicates Quality scoring of tongue examination images; Indicates Brightness consistency of tongue examination images; Indicates The color consistency of the tongue diagnosis image corresponding to the color quantification of the tongue diagnosis image; represents the linear normalization function.

[0081] What needs to be explained is: and Proportional, The larger the value of The greater the tongue diagnosis image quality score.

[0082] Through the above process, we obtain Quality scoring of tongue diagnosis images.

[0083] Each tongue diagnosis image is operated according to the above process to obtain the quality score of each tongue diagnosis image.

[0084] Step S005: Obtain a corrected quality score for each tongue diagnosis image according to the quality score of each tongue diagnosis image and the V channel values ​​of all pixel points in all color quantized tongue diagnosis block areas of the color quantized tongue diagnosis image corresponding to each tongue diagnosis image; obtain a corrected quality score for the tongue diagnosis image to be detected according to the method for obtaining the corrected quality score of each tongue diagnosis image; screen out a reference image to be detected from the tongue diagnosis images according to the corrected quality scores of each tongue diagnosis image and the tongue diagnosis image to be detected; obtain a tongue diagnosis enhanced image according to the ambient light intensity of the reference image to be detected.

[0085] It should be noted that: the quality score of each tongue diagnosis image is obtained through the above process, and each tongue diagnosis image corresponds to an ambient light intensity, so the quality score of the tongue diagnosis image to be detected is calculated, and then compared with the quality score of each tongue diagnosis image to be detected, and the tongue diagnosis image with the closest quality score to the tongue diagnosis image to be detected is found, and the ambient light intensity of the tongue diagnosis image is identified as the ambient light intensity of the tongue diagnosis image to be detected.

[0086] It is further necessary to explain that there are certain defects in obtaining the ambient light intensity by only calculating the quality score to compare the tongue diagnosis image to be detected with each tongue diagnosis image. Specifically, even if the quality score of the tongue diagnosis image to be detected is equal to or similar to the quality score of a tongue diagnosis image, the ambient light intensity of the tongue diagnosis image may be very different from that of the tongue diagnosis image to be detected. For example, if the tongue diagnosis image to be detected is overexposed, the local brightness may be abnormally prominent, and this abnormality may mistakenly indicate that the tongue diagnosis image to be detected was taken in a strong light environment.

[0087] It is further necessary to explain that in the HSV color space, the V channel value represents the brightness value of the color. The larger the V channel value, the brighter the color, and the smaller the V channel value, the darker the color. Under standard lighting, the mean V channel values ​​of all pixels in each block area of ​​the image should be similar. If the mean V channel value of all pixels in a block area of ​​the image is too different from that of other blocks (either too high or too low), it may indicate that the block area has a local brightness that is too high or too dark, which may be caused by exposure problems. In this case, the quality score of the image that is locally too bright should be appropriately reduced, while the quality score of the image that is locally too dark should be appropriately increased.

[0088] In the In the color quantization tongue diagnosis image corresponding to the tongue diagnosis image, the mean and sum of the V channel values ​​of all pixels in each color quantization tongue diagnosis block area are calculated. The absolute value of the difference between the mean V channel values ​​of all pixels in each color quantization tongue diagnosis block area and The maximum value of the absolute value of the difference minus The difference is recorded as The optimal adjustment value of the tongue diagnosis image. is a preset constant.

[0089] The first The specific calculation formula corresponding to the corrected quality score of the tongue diagnosis image is:

[0090]

[0091] in, Indicates Corrected quality score of tongue examination images; Indicates Quality scoring of tongue examination images; Indicates Optimal adjustment value for tongue diagnosis images.

[0092] What needs to be explained is: When the value of is less than 0, it means that The tongue examination image is partially dark. When the value of is greater than 0, it means that The tongue examination image is partially bright.

[0093] Through the above process, we obtain Corrected quality score of tongue examination images.

[0094] Each tongue diagnosis image is operated according to the above process to obtain a correction quality score of each tongue diagnosis image.

[0095] According to the method for obtaining the corrected quality score of each tongue diagnosis image, the corrected quality score of the tongue diagnosis image to be detected is obtained.

[0096] The tongue diagnosis image with the smallest absolute value of the difference between the corrected quality score of the image to be detected and the image to be detected is recorded as the reference image to be detected.

[0097] According to the ambient light intensity of the reference image to be detected, the tongue diagnosis image to be detected is calculated using an illumination compensation algorithm to obtain a tongue diagnosis enhanced image. The illumination compensation algorithm is a well-known technology and the specific method is not introduced here.

[0098] It should be noted that the training set of the CNN used for illumination compensation is the tongue diagnosis image database built in step one.

[0099] So far, the present invention is completed.

[0100] In summary, in an embodiment of the present invention, a tongue diagnosis image to be detected and several tongue diagnosis images and their ambient light intensities are obtained. Each tongue diagnosis image is divided into multiple regions, and the brightness consistency is calculated. Color quantization is performed on each tongue diagnosis image, and the color complexity of each region is calculated in blocks. Color consistency is calculated based on the V channel value and color complexity. Combining brightness consistency and color consistency, a quality score of each tongue diagnosis image is obtained, and a corrected quality score is further calculated; based on the corrected quality score, a reference image to be detected is screened out from the tongue diagnosis image; based on the ambient light intensity of the reference image to be detected, a tongue diagnosis enhanced image is obtained. The present invention improves the effect of enhancing the tongue diagnosis image to be detected by analyzing the pixel points of the tongue diagnosis image and the tongue diagnosis image to be detected.

[0101] 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 tongue diagnosis image enhancement method, characterized in that: The method comprises the following steps: Acquire a tongue diagnosis image to be detected, a plurality of tongue diagnosis images, and the ambient light intensity of each tongue diagnosis image; Each tongue diagnosis image is equally divided into a number of tongue diagnosis block areas; according to the grayscale values ​​of all pixels of each tongue diagnosis image and the number of tongue diagnosis block areas, the brightness consistency of each tongue diagnosis image is obtained; Obtain a color quantized tongue diagnosis image corresponding to each tongue diagnosis image; divide each color quantized tongue diagnosis image into a number of color quantized tongue diagnosis block areas; construct a rectangular coordinate system for each color quantized tongue diagnosis image, and obtain the color complexity of each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image on the rectangular coordinate system according to the coordinates of all pixel points and the number of colors in each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image; obtain the color consistency of each color quantized tongue diagnosis image according to the V channel values ​​of all pixel points of each color quantized tongue diagnosis image and the color complexity of each color quantized tongue diagnosis block area; Quantifying the color consistency of each tongue diagnosis image according to the brightness consistency of each tongue diagnosis image and the color corresponding to each tongue diagnosis image, and obtaining a quality score for each tongue diagnosis image; According to the quality score of each tongue diagnosis image and the V channel values ​​of all pixel points in all color quantization tongue diagnosis block areas of the color quantization tongue diagnosis image corresponding to each tongue diagnosis image, the corrected quality score of each tongue diagnosis image is obtained; according to the acquisition method of the corrected quality score of each tongue diagnosis image, the corrected quality score of the tongue diagnosis image to be detected is obtained; according to the corrected quality score of each tongue diagnosis image and the tongue diagnosis image to be detected, the reference image to be detected is screened out from the tongue diagnosis images; according to the ambient light intensity of the reference image to be detected, the tongue diagnosis enhanced image is obtained.

2. According to claim 1, a computer vision-based TCM tongue diagnosis image enhancement method is characterized in that: According to the grayscale values ​​of all pixels of each tongue diagnosis image and the number of tongue diagnosis block areas, the specific calculation formula corresponding to the brightness consistency of each tongue diagnosis image is obtained as follows: in, Indicates Brightness consistency of tongue examination images; Indicates The number of tongue diagnosis block areas of the tongue diagnosis image; Indicates The mean gray value of all pixels in the tongue diagnosis image; Indicates Tongue diagnosis image The mean gray value of all pixels in the tongue diagnosis block area; represents the absolute value function.

3. According to the computer vision-based TCM tongue diagnosis image enhancement method of claim 1, it is characterized in that: The rectangular coordinate system of each color quantized tongue diagnosis image is constructed, and the color complexity of each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image is obtained according to the coordinates and color quantity of all pixel points of each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image on the rectangular coordinate system, and the specific steps include the following: A rectangular coordinate system is constructed with the vertex of the lower left corner of each color quantization tongue diagnosis image as the origin, the horizontal right direction as the positive direction of the horizontal axis, and the vertical upward direction as the positive direction of the vertical axis, to obtain the horizontal and vertical coordinates of each pixel point of each color quantization tongue diagnosis image; Obtain the degree of disorder of all pixels of each color in each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image according to the horizontal and vertical coordinates of all pixels of each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image in a rectangular coordinate system; According to the disorder degree and the number of colors of all pixels of each color in each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image, the color complexity of each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image is obtained.

4. According to claim 3, a computer vision-based TCM tongue diagnosis image enhancement method is characterized in that: According to the degree of disorder and the number of colors of all pixels of each color in each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image, the specific calculation formula corresponding to the color complexity of each color quantized tongue diagnosis block area of ​​each color quantized tongue diagnosis image is obtained as follows: in, Indicates Color quantization tongue diagnosis image The color quantifies the color complexity of the tongue diagnosis block area; No. Color quantization tongue diagnosis image Each color quantifies the number of colors in the tongue diagnosis block area; No. Color quantization tongue diagnosis image Color quantification of tongue diagnosis block area The number of pixels of different colors; No. Color quantization tongue diagnosis image Color quantification of tongue diagnosis block area Color The horizontal coordinate of the pixel point; No. Color quantization tongue diagnosis image Color quantification of tongue diagnosis block area Color The vertical coordinate of the pixel; Indicates Color quantization tongue diagnosis image Color quantification of tongue diagnosis block area The mean of the horizontal coordinates of all pixels of the same color; Indicates Color quantization tongue diagnosis image Color quantification of tongue diagnosis block area The mean of the ordinates of all pixels of the same color; Indicates Color quantization tongue diagnosis image Color quantification of tongue diagnosis block area The degree of chaos of all pixels of a certain color.

5. According to the computer vision-based TCM tongue diagnosis image enhancement method of claim 1, it is characterized in that: The color consistency of each color quantization tongue diagnosis image is obtained according to the V channel values ​​of all pixels of each color quantization tongue diagnosis image and the color complexity of each color quantization tongue diagnosis block area, and the specific steps include the following: calculate With The absolute value of the difference between the mean values ​​of the V channel values ​​of all pixels of the color quantized tongue diagnosis image is added to the absolute value of the difference. The reciprocal of the product of the color complexity standard deviations of all color quantized tongue diagnosis block areas of the color quantized tongue diagnosis image is recorded as The color consistency of the tongue diagnosis image is quantified by color; Indicates a preset constant.

6. According to the computer vision-based TCM tongue diagnosis image enhancement method of claim 1, it is characterized in that: The method of quantifying the color consistency of each tongue diagnosis image according to the brightness consistency of each tongue diagnosis image and the color corresponding to each tongue diagnosis image to obtain the quality score of each tongue diagnosis image includes the following specific steps: The first The brightness consistency of tongue diagnosis images is The normalized value of the inverse of the product of the color consistency of the color quantization tongue diagnosis image corresponding to the tongue diagnosis image is recorded as Quality scoring of tongue diagnosis images.

7. According to claim 1, a computer vision-based TCM tongue diagnosis image enhancement method is characterized in that: The method of obtaining the corrected quality score of each tongue diagnosis image according to the quality score of each tongue diagnosis image and the V channel values ​​of all pixels of all color quantized tongue diagnosis block areas of the color quantized tongue diagnosis image corresponding to each tongue diagnosis image comprises the following specific steps: In the In the color quantization tongue diagnosis image corresponding to the tongue diagnosis image, the mean and sum of the V channel values ​​of all pixels in each color quantization tongue diagnosis block area are calculated. The absolute value of the difference between the mean V channel values ​​of all pixels in each color quantization tongue diagnosis block area and The maximum value of the absolute value of the difference minus The difference is recorded as The optimal adjustment value of the tongue diagnosis image; among them, Indicates a preset constant; According to the optimal adjustment value and correction quality score of each tongue diagnosis image, the correction quality score of each tongue diagnosis image is obtained.

8. According to the computer vision-based TCM tongue diagnosis image enhancement method of claim 7, it is characterized in that: The method of obtaining the corrected quality score of each tongue diagnosis image according to the optimal adjustment value and the corrected quality score of each tongue diagnosis image includes the following specific steps: The first The quality score of the tongue diagnosis image is minus the The difference between the optimal adjustment values ​​of the tongue diagnosis image is recorded as Corrected quality score of tongue examination images.

9. According to the computer vision-based TCM tongue diagnosis image enhancement method of claim 1, it is characterized in that: The method of selecting a reference image to be detected from the tongue diagnosis images according to the corrected quality score of each tongue diagnosis image and the tongue diagnosis image to be detected comprises the following specific steps: The tongue diagnosis image with the smallest absolute value of the difference between the corrected quality score of the image to be detected and the image to be detected is recorded as the reference image to be detected.

10. According to the computer vision-based TCM tongue diagnosis image enhancement method of claim 1, it is characterized in that: The step of obtaining the tongue diagnosis enhanced image according to the ambient light intensity of the reference image to be detected includes the following specific steps: According to the ambient light intensity of the reference image to be detected, the illumination compensation algorithm is used to operate the tongue diagnosis image to be detected to obtain the tongue diagnosis enhanced image.

Citation Information

Patent Citations

  • Method and device for detecting quality of identification photo

    CN106558046A

  • Robust low-illumination enhanced image quality evaluation method

    CN112381761A

  • Intelligent detection method for carton surface coloring quality

    CN116843681A

  • Method, system and recording medium for analysing tongue diagnosis using a quantifying evalution indicator of tongue diagnosis image

    KR1020140140934A