A tongue image de-reflection processing method, device, equipment and storage medium

By extracting the tongue image area image, reflective detection and pixel value repair, combined with denoising processing, the problems of many noise points and abnormal exposure in the dereflective processing of the tongue image image are solved, and the processing efficiency and accuracy are improved.

CN116862901BActive Publication Date: 2025-04-04GUANGZHOU JIANCHI BIOTECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310949470.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-28
Publication Date
2025-04-04
Estimated Expiration
2043-07-28

AI Technical Summary

Technical Problem

The existing methods for removing the reflection of tongue image images have problems such as many noise, abnormal exposure, poor repair effect, low efficiency and low accuracy, resulting in low processing efficiency and accuracy of tongue image images.

Method used

By acquiring the tongue image detection image, extracting the tongue image area image, performing reflection detection to generate a reflective area mask map, traversing the points to be repaired in the mask map, pixel value repairs are performed in turn, and the repaired image is denoised to obtain the dereflective tongue image picture.

Benefits of technology

It improves the accuracy and efficiency of de-reflection of tongue images, reduces the computational amount and time complexity, avoids the complexity and cumbersomeness of existing algorithms, and ensures the effect of de-reflection processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116862901B_ABST
    Figure CN116862901B_ABST
Patent Text Reader

Abstract

The present invention discloses a tongue image de-reflection processing method, device, equipment and storage medium, comprising: obtaining a tongue image detection image, and extracting a tongue image region image from the tongue image detection image according to a preset tongue image extraction model; performing reflection detection on the tongue image region image to obtain a reflective region, and generating a reflective region mask map; traversing all points to be repaired in a single channel image of the reflective region mask map according to the RGB three-channel image of the tongue image region image, and repairing pixel values ​​of all points to be repaired in sequence; performing denoising on the tongue image detection image after pixel value repair, thereby obtaining a tongue image processed with de-reflection. The present invention solves the technical problems in the prior art that tongue images have many noise points, abnormal exposure, poor repair effect of tongue images, low efficiency and low accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of medical image processing, and in particular to a tongue image de-reflection processing method, device, equipment and storage medium. Background Art

[0002] Tongue diagnosis is an important part of TCM visual diagnosis. In clinical diagnosis, doctors often record the patient's tongue image, and can infer the nature, severity, trend and urgency of the disease based on the tongue image.

[0003] In the tongue image dataset compiled by the hospital, a large part of the tongue image images have reflections due to the influence of saliva, which interferes with the subsequent development of tongue image intelligent analysis algorithms. However, there are few existing de-reflection processing methods for tongue images, which have problems such as many image noise points and abnormal exposure, resulting in poor restoration effects of tongue images. At the same time, the de-reflection image processing algorithm has complex principles and cumbersome processes, which is not conducive to batch processing of large-scale tongue images, resulting in low processing efficiency and low processing accuracy of tongue images.

[0004] Therefore, there is an urgent need for a method that can improve the accuracy and efficiency of tongue image de-reflection. Summary of the invention

[0005] The present invention provides a tongue image de-reflection processing method, device, equipment and storage medium to solve the technical problems in the prior art of tongue image images having many noise points, abnormal exposure, poor restoration effect of tongue image images, low efficiency and low accuracy.

[0006] In order to solve the above technical problems, an embodiment of the present invention provides a method for de-reflection processing of a tongue image, comprising:

[0007] Acquire a tongue image detection image, and extract a tongue image region image from the tongue image detection image according to a preset tongue image extraction model;

[0008] Performing reflection detection on the tongue image to obtain a reflection area and generating a reflection area mask image;

[0009] According to the RGB three-channel image of the tongue image area, all the points to be repaired in the single-channel image of the reflective area mask image are traversed, and pixel values ​​of all the points to be repaired are repaired in sequence;

[0010] The tongue image detected after pixel value restoration is subjected to denoising, thereby obtaining a tongue image with de-reflection treatment.

[0011] As a preferred solution, the step of acquiring a tongue image detection image and extracting a tongue image region image from the tongue image detection image according to a preset tongue image extraction model is specifically as follows:

[0012] Acquire a tongue image detection image, and perform image segmentation on the tongue image detection image using a pre-trained tongue image extraction model to generate a tongue image region mask image;

[0013] According to the tongue image region mask image, irrelevant pixels of the tongue image detection image are eliminated to generate a tongue image region image.

[0014] As a preferred solution, the reflection detection is performed on the tongue image to obtain the reflection area, and a reflection area mask is generated, specifically:

[0015] Reading the grayscale image of the tongue image area;

[0016] Performing reflection detection on the grayscale image, so that the pixel points in the grayscale image that are higher than a preset threshold are used as the pixel points of the reflection area, thereby obtaining the reflection area;

[0017] According to the reflective area of ​​the tongue image area image, a mask image corresponding to the pixel points in the reflective area is generated as the reflective area mask image.

[0018] As a preferred solution, according to the RGB three-channel image of the tongue image area, all the points to be repaired in the single-channel image of the reflective area mask image are traversed, and the pixel values ​​of all the points to be repaired are repaired in turn, specifically:

[0019] Reading the RGB three-channel image of the tongue image area and the single-channel image of the reflective area mask image;

[0020] Determining a point to be repaired according to the single-channel image of the reflective area mask map;

[0021] Traversing all the points to be repaired in the reflective area mask image, and obtaining the average pixel value of all non-repaired points in a preset neighborhood matrix centered on the point to be repaired in the tongue image area image according to the coordinates corresponding to the points to be repaired; the average pixel value includes the average pixel value of the R channel, the average pixel value of the G channel, and the average pixel value of the B channel;

[0022] According to the average pixel value corresponding to each point to be repaired, the pixel value of the position corresponding to the coordinate of the point to be repaired in the tongue image detection image is repaired.

[0023] As a preferred solution, according to the coordinates corresponding to the points to be repaired, the average pixel values ​​of all non-repaired points in the preset neighborhood matrix centered on the point to be repaired in the tongue image region are obtained, specifically:

[0024] According to the coordinates corresponding to the points to be repaired, the positioning coordinates of the repair points in the tongue image region are obtained;

[0025] Taking the positioning coordinates as the center of a preset neighborhood matrix, respectively obtaining the R channel pixel values, G channel pixel values, and B channel pixel values ​​of all non-to-be-repaired points within the range of each preset neighborhood matrix; the preset neighborhood matrix includes a number of neighborhood matrices of preset lengths;

[0026] According to the R channel pixel value, the G channel pixel value and the B channel pixel value within each preset neighborhood matrix range, the R channel pixel average value, the G channel pixel average value and the B channel pixel average value are calculated respectively.

[0027] As a preferred solution, the tongue image detected after pixel value restoration is subjected to denoising, thereby obtaining a tongue image subjected to de-reflection processing, specifically:

[0028] According to the preset Gaussian kernel size parameter and standard deviation parameter, the tongue image detected after pixel value restoration is denoised by a preset denoising function, thereby obtaining a tongue image with de-reflection processing.

[0029] Accordingly, the present invention also provides a tongue image de-reflection processing device, comprising: an image acquisition module, a reflection detection module, a pixel repair module and a denoising processing module;

[0030] The image acquisition module is used to acquire a tongue image detection image and extract a tongue image region image from the tongue image detection image according to a preset tongue image extraction model;

[0031] The reflection detection module is used to perform reflection detection on the tongue image area image, obtain the reflection area, and generate a reflection area mask image;

[0032] The pixel repair module is used to traverse all the points to be repaired in the single-channel image of the reflective area mask image according to the RGB three-channel image of the tongue image area image, and repair the pixel values ​​of all the points to be repaired in turn;

[0033] The denoising module is used to perform denoising on the tongue image after pixel value restoration, so as to obtain a tongue image with de-reflection treatment.

[0034] As a preferred solution, according to the RGB three-channel image of the tongue image area, all the points to be repaired in the single-channel image of the reflective area mask image are traversed, and the pixel values ​​of all the points to be repaired are repaired in turn, specifically:

[0035] Reading the RGB three-channel image of the tongue image area and the single-channel image of the reflective area mask image;

[0036] Determining a point to be repaired according to the single-channel image of the reflective area mask map;

[0037] Traversing all the points to be repaired in the reflective area mask image, and obtaining the average pixel value of all non-repaired points in a preset neighborhood matrix centered on the point to be repaired in the tongue image area image according to the coordinates corresponding to the points to be repaired; the average pixel value includes the average pixel value of the R channel, the average pixel value of the G channel, and the average pixel value of the B channel;

[0038] According to the average pixel value corresponding to each point to be repaired, the pixel value of the position corresponding to the coordinate of the point to be repaired in the tongue image detection image is repaired.

[0039] Correspondingly, the present invention also provides a terminal device, characterized in that it includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, it implements the de-reflection processing method of the tongue image as described in any one of the above.

[0040] Correspondingly, the present invention also provides a computer-readable storage medium, characterized in that the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the de-reflection processing method for the tongue image as described in any one of the above.

[0041] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0042] The technical solution of the present invention obtains a tongue detection image and extracts the tongue image area image therein, removes redundant areas in the image to reduce the interference of the de-reflection algorithm, and more accurately identifies the reflective area in the tongue image, and generates a corresponding reflective area mask map in the reflective area, and then traverses all the points to be repaired in the single-channel image of the reflective area mask map according to the RGB three-channel image of the tongue image area image, and repairs the pixel values ​​of all the points to be repaired in turn, so that the repaired area is more closely aligned with the surrounding area of ​​the image, thereby improving the accuracy of the tongue image, avoiding the problems of complex principles and cumbersome processes of the existing algorithm, reducing the amount of calculation, and at the same time, the repair of the pixel value ensures the effect of the de-reflection processing, reduces the time complexity, and improves the processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 : A flow chart of the steps of a tongue image de-reflection processing method provided by an embodiment of the present invention;

[0044] Figure 2 : A schematic diagram of a neighborhood matrix provided in an embodiment of the present invention;

[0045] Figure 3 : A schematic structural diagram of a de-reflection processing device for tongue image provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] Embodiment 1

[0048] Please refer to Figure 1 , a tongue image de-reflection processing method provided by an embodiment of the present invention, comprising the following steps S101-S104:

[0049] Step S101: acquiring a tongue image detection image, and extracting a tongue image region image from the tongue image detection image according to a preset tongue image extraction model.

[0050] As a preferred solution, the step of acquiring a tongue image detection image and extracting a tongue image region image from the tongue image detection image according to a preset tongue image extraction model is specifically as follows:

[0051] A tongue image detection image is acquired, and the tongue image detection image is segmented through a pre-trained tongue image extraction model to generate a tongue image region mask map; based on the tongue image region mask map, an initial image of the tongue image region is extracted, and irrelevant pixels of the initial image are eliminated to generate a tongue image region image.

[0052] In this embodiment, the tongue image detection image can be collected by a camera terminal device such as a mobile phone or a camera. After the tongue image detection image is obtained, the tongue image detection image can be directly segmented by a pre-trained tongue image extraction model to obtain a tongue image region mask map, and then the tongue image detection image is subjected to irrelevant pixel removal according to the tongue image region mask map, thereby generating a tongue image region image.

[0053] Furthermore, the tongue image extraction model is a pre-trained U-Net neural network model, which is trained by using a tongue image dataset, which includes a tongue image training set and a tongue image test set. The loss function used in the training process is Dice Loss, and the optimizer is Adam Optimizer.

[0054] In this embodiment, a trained U-Net neural network model is loaded to perform image segmentation on the tongue image detection image to generate a tongue image region mask map, and then the tongue image region image is extracted based on the tongue image region mask map to generate a tongue image region image that eliminates irrelevant pixels.

[0055] Step S102: performing reflection detection on the tongue image to obtain the reflection area and generate a reflection area mask image.

[0056] As a preferred solution of this embodiment, the reflection detection is performed on the tongue image to obtain the reflection area, and a reflection area mask is generated, specifically:

[0057] Read the grayscale image of the tongue image area; perform reflection detection on the grayscale image so that the pixels in the grayscale image that are higher than a preset threshold are used as pixels in the reflection area, thereby obtaining the reflection area; and generate a mask image corresponding to the pixels in the reflection area according to the reflection area of ​​the tongue image area as a mask image of the reflection area.

[0058] In this embodiment, the grayscale image of the tongue image region is read using the cv2.imread() function, wherein the channel parameter of the cv2.imread() function is set to cv2.IMREAD_GRAYSCALE for reading the grayscale image of the image. The reflective region of the tongue image region is detected using the cv2.threshold() function, and a mask image of the reflective region is generated.

[0059] It should be noted that the threshold parameter of the cv2.threshold() function is set to 220 to classify pixels above the threshold as reflective area pixels. The maxval parameter is set to 255 and the type parameter is set to cv2.THRESH_BINARY to generate a mask map corresponding to the reflective area pixels. In the mask map, the pixel value of the reflective area is 255, and the value of the non-reflective area pixel is 0.

[0060] Step S103: based on the RGB three-channel image of the tongue image area, traverse all the points to be repaired in the single-channel image of the reflective area mask image, and repair the pixel values ​​of all the points to be repaired in turn.

[0061] As a preferred solution of this embodiment, according to the RGB three-channel image of the tongue image area, all the points to be repaired in the single-channel image of the reflective area mask image are traversed, and the pixel values ​​of all the points to be repaired are repaired in turn, specifically:

[0062] Read the RGB three-channel image of the tongue image area and the single-channel image of the reflective area mask map; determine the point to be repaired according to the single-channel image of the reflective area mask map; traverse all the points to be repaired in the reflective area mask map, and obtain the average pixel value of all non-repaired points in the preset neighborhood matrix centered on the point to be repaired in the tongue image area image according to the coordinates corresponding to the points to be repaired; the average pixel value includes the R channel pixel average, the G channel pixel average and the B channel pixel average; according to the average pixel value corresponding to each point to be repaired, perform pixel value repair on the position corresponding to the coordinate of the point to be repaired in the tongue detection image.

[0063] In this embodiment, the cv2.imread() function is used to read the tongue image area image, and the channel parameter of the cv2.imread() function is set to cv2.IMREAD_COLOR, which is used to read the RGB three-channel image of the image. The cv2.imread() function is used to read the reflective area mask image, and the channel parameter of the cv2.imread() function is set to cv2.IMREAD_GRAYSCALE, which is used to read the single-channel image of the reflective area mask image.

[0064] As a preferred solution of this embodiment, according to the coordinates corresponding to the points to be repaired, the average pixel values ​​of all non-repaired points in the preset neighborhood matrix centered on the point to be repaired in the tongue image area are obtained, specifically:

[0065] According to the coordinates corresponding to the points to be repaired, the positioning coordinates of the repair points in the tongue image area image are obtained; with the positioning coordinates as the center of the preset neighborhood matrix, the R channel pixel values, G channel pixel values, and B channel pixel values ​​of all non-points to be repaired within the range of each preset neighborhood matrix are obtained respectively; the preset neighborhood matrix includes several neighborhood matrices of preset lengths; according to the R channel pixel values, G channel pixel values, and B channel pixel values ​​within the range of each preset neighborhood matrix, the R channel pixel average value, the G channel pixel average value, and the B channel pixel average value are calculated respectively.

[0066] In this embodiment, all the points to be repaired in the reflective area mask image are traversed, and the corresponding pixel values ​​of the tongue area image are obtained according to the coordinates of the repair points, and the average pixel values ​​of all non-repaired points in the preset neighborhood matrix of different scales centered on the repair point in the tongue area image are obtained.

[0067] It should be noted that, preferably, the neighborhood matrices of different scales are specifically defined as: matrices with the repair point as the center and lengths of 3, 5, 7, 9, 11, 13, 15, and 17 respectively. And according to the neighborhood matrices of different scales, the average pixel values ​​of the R channel, the average pixel values ​​of the G channel, and the average pixel values ​​of the B channel of all non-to-be-repaired points are calculated respectively. Among them, the schematic diagram of the neighborhood matrix with scales of 3, 5, and 7 is shown in Figure 2 shown.

[0068] Furthermore, the average value is calculated based on the R channel pixel average value, the G channel pixel average value, and the B channel pixel average value within the above-mentioned different ranges as the pixel value of the repair point, all pixel points of the image are traversed, and all pixel points to be repaired are repaired to generate a repaired tongue image detection image.

[0069] Step S104: performing denoising processing on the tongue image detected after pixel value restoration, so as to obtain a tongue image processed with de-reflection.

[0070] As a preferred solution of this embodiment, the tongue image detected after pixel value restoration is subjected to denoising, thereby obtaining a tongue image subjected to de-reflection processing, specifically:

[0071] According to the preset Gaussian kernel size parameter and standard deviation parameter, the tongue image detected after pixel value restoration is denoised by a preset denoising function, thereby obtaining a tongue image with de-reflection processing.

[0072] In this embodiment, the restored tongue image is denoised according to a preset image denoising algorithm. Preferably, the cv2.GaussianBlur() function is used to denoise the restored tongue image, wherein the Gaussian kernel size parameter is set to (5,5) and the standard deviation parameter is set to 1.5.

[0073] Implementing the above embodiments has the following effects:

[0074] The technical solution of the present invention obtains a tongue detection image and extracts the tongue image area image therein, removes redundant areas in the image to reduce the interference of the de-reflection algorithm, and more accurately identifies the reflective area in the tongue image, and generates a corresponding reflective area mask map in the reflective area, and then traverses all the points to be repaired in the single-channel image of the reflective area mask map according to the RGB three-channel image of the tongue image area image, and repairs the pixel values ​​of all the points to be repaired in turn, so that the repaired area is more closely aligned with the surrounding area of ​​the image, thereby improving the accuracy of the tongue image, avoiding the problems of complex principles and cumbersome processes of the existing algorithm, reducing the amount of calculation, and at the same time, the repair of the pixel value ensures the effect of the de-reflection processing, reduces the time complexity, and improves the processing efficiency.

[0075] Embodiment 2

[0076] See also Figure 3 , which is a tongue image de-reflection processing device provided by the present invention, including: an image acquisition module 201, a reflection detection module 202, a pixel repair module 203 and a denoising processing module 204.

[0077] The image acquisition module 201 is used to acquire a tongue image detection image and extract a tongue image region image from the tongue image detection image according to a preset tongue image extraction model.

[0078] The reflection detection module 202 is used to perform reflection detection on the tongue image area image, obtain the reflection area, and generate a reflection area mask image.

[0079] The pixel repair module 203 is used to traverse all the points to be repaired in the single-channel image of the reflective area mask image according to the RGB three-channel image of the tongue image area image, and repair the pixel values ​​of all the points to be repaired in turn.

[0080] The denoising module 204 is used to perform denoising on the tongue image after pixel value restoration, so as to obtain a tongue image after de-reflection processing.

[0081] As a preferred solution, the step of acquiring a tongue image detection image and extracting a tongue image region image from the tongue image detection image according to a preset tongue image extraction model is specifically as follows:

[0082] A tongue image detection image is acquired, and image segmentation is performed on the tongue image detection image through a pre-trained tongue image extraction model to generate a tongue image region mask map; irrelevant pixels of the tongue image detection image are eliminated according to the tongue image region mask map to generate a tongue image region image.

[0083] As a preferred solution, the reflection detection is performed on the tongue image to obtain the reflection area, and a reflection area mask is generated, specifically:

[0084] Read the grayscale image of the tongue image area; perform reflection detection on the grayscale image so that the pixels in the grayscale image that are higher than a preset threshold are used as pixels in the reflection area, thereby obtaining the reflection area; and generate a mask image corresponding to the pixels in the reflection area according to the reflection area of ​​the tongue image area as a mask image of the reflection area.

[0085] As a preferred solution, according to the RGB three-channel image of the tongue image area, all the points to be repaired in the single-channel image of the reflective area mask image are traversed, and the pixel values ​​of all the points to be repaired are repaired in turn, specifically:

[0086] Read the RGB three-channel image of the tongue image area and the single-channel image of the reflective area mask map; determine the point to be repaired according to the single-channel image of the reflective area mask map; traverse all the points to be repaired in the reflective area mask map, and obtain the average pixel value of all non-repaired points in the preset neighborhood matrix centered on the point to be repaired in the tongue image area image according to the coordinates corresponding to the points to be repaired; the average pixel value includes the R channel pixel average, the G channel pixel average and the B channel pixel average; according to the average pixel value corresponding to each point to be repaired, perform pixel value repair on the position corresponding to the coordinate of the point to be repaired in the tongue detection image.

[0087] As a preferred solution, according to the coordinates corresponding to the points to be repaired, the average pixel values ​​of all non-repaired points in the preset neighborhood matrix centered on the point to be repaired in the tongue image region are obtained, specifically:

[0088] According to the coordinates corresponding to the points to be repaired, the positioning coordinates of the repair points in the tongue image area image are obtained; with the positioning coordinates as the center of the preset neighborhood matrix, the R channel pixel values, G channel pixel values, and B channel pixel values ​​of all non-points to be repaired within the range of each preset neighborhood matrix are obtained respectively; the preset neighborhood matrix includes several neighborhood matrices of preset lengths; according to the R channel pixel values, G channel pixel values, and B channel pixel values ​​within the range of each preset neighborhood matrix, the R channel pixel average value, the G channel pixel average value, and the B channel pixel average value are calculated respectively.

[0089] As a preferred solution, the tongue image detected after pixel value restoration is subjected to denoising, thereby obtaining a tongue image subjected to de-reflection processing, specifically:

[0090] According to the preset Gaussian kernel size parameter and standard deviation parameter, the tongue image detected after pixel value restoration is denoised by a preset denoising function, thereby obtaining a tongue image with de-reflection processing.

[0091] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0092] Implementing the above embodiments has the following effects:

[0093] The technical solution of the present invention obtains a tongue detection image and extracts the tongue image area image therein, removes redundant areas in the image to reduce the interference of the de-reflection algorithm, and more accurately identifies the reflective area in the tongue image, and generates a corresponding reflective area mask map in the reflective area, and then traverses all the points to be repaired in the single-channel image of the reflective area mask map according to the RGB three-channel image of the tongue image area image, and repairs the pixel values ​​of all the points to be repaired in turn, so that the repaired area is more closely aligned with the surrounding area of ​​the image, thereby improving the accuracy of the tongue image, avoiding the problems of complex principles and cumbersome processes of the existing algorithm, reducing the amount of calculation, and at the same time, the repair of the pixel value ensures the effect of the de-reflection processing, reduces the time complexity, and improves the processing efficiency.

[0094] Embodiment 3

[0095] Correspondingly, the present invention also provides a terminal device, comprising: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the de-reflection processing method for the tongue image as described in any one of the above embodiments is implemented.

[0096] The terminal device of this embodiment includes: a processor, a memory, and a computer program and a computer instruction stored in the memory and executable on the processor. When the processor executes the computer program, each step in the above-mentioned embodiment 1 is implemented, for example: Figure 1 Alternatively, the processor implements the functions of each module / unit in the above device embodiment, such as the pixel repair module 203, when executing the computer program.

[0097] Exemplarily, the computer program can be divided into one or more modules / units, and the one or more modules / units are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units can be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device. For example, the pixel repair module 203 is used to traverse all the points to be repaired in the single-channel image of the reflective area mask image based on the RGB three-channel image of the tongue image area image, and repair the pixel values ​​of all the points to be repaired in turn.

[0098] The terminal device may be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the schematic diagram is merely an example of a terminal device and does not constitute a limitation on the terminal device. The terminal device may include more or fewer components than shown in the diagram, or may combine certain components, or different components. For example, the terminal device may also include an input / output device, a network access device, a bus, etc.

[0099] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the terminal device, and uses various interfaces and lines to connect various parts of the entire terminal device.

[0100] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the terminal device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the mobile terminal, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0101] Wherein, if the module / unit integrated in the terminal device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0102] Embodiment 4

[0103] Correspondingly, the present invention also provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the de-reflection processing method for the tongue image as described in any one of the above embodiments.

[0104] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for de-reflection processing of tongue image, characterized in that: include: Obtain a tongue image detection image, and perform image segmentation on the tongue image detection image through a pre-trained tongue image extraction model to generate a tongue image region mask map; remove irrelevant pixels from the tongue image detection image according to the tongue image region mask map, thereby generating a tongue image region image; wherein the tongue image extraction model is a pre-trained U-Net neural network model, and the U-Net neural network model is trained by using a tongue image data set, and the tongue image data set includes: a tongue image image training set and a tongue image image test set; Reading the grayscale image of the tongue image region; performing reflection detection on the grayscale image so that the pixels in the grayscale image that are higher than a preset threshold are used as pixels in the reflection region, thereby obtaining the reflection region; generating a mask image corresponding to the pixels in the reflection region according to the reflection region of the tongue image region as a mask image of the reflection region; Read the RGB three-channel image of the tongue image area and the single-channel image of the reflective area mask map; determine the point to be repaired according to the single-channel image of the reflective area mask map; traverse all the points to be repaired in the reflective area mask map, and obtain the positioning coordinates of the repair point in the tongue image area image according to the coordinates corresponding to the points to be repaired; take the positioning coordinates as the center of the preset neighborhood matrix, and obtain the R channel pixel values, G channel pixel values, and B channel pixel values ​​of all non-points to be repaired within each preset neighborhood matrix; the preset neighborhood matrix includes a number of neighborhood matrices of preset lengths; calculate the R channel pixel average value, G channel pixel average value, and B channel pixel average value according to the R channel pixel value, G channel pixel value, and B channel pixel value within each preset neighborhood matrix; calculate the average value according to the R channel pixel average value, G channel pixel average value, and B channel pixel average value within different preset neighborhood ranges, as the pixel value of the repair point, traverse all pixel points of the reflective area mask map, and repair all pixel points to be repaired to generate a repaired tongue detection image; The tongue image detected after pixel value restoration is subjected to denoising, thereby obtaining a tongue image with de-reflection treatment.

2. A method for de-reflecting a tongue image as claimed in claim 1, characterized in that: The denoising process is performed on the tongue image after pixel value restoration to obtain a tongue image after de-reflection processing, specifically: According to the preset Gaussian kernel size parameter and standard deviation parameter, the tongue image detected after pixel value restoration is denoised by a preset denoising function, thereby obtaining a tongue image with de-reflection processing.

3. A tongue image de-reflection processing device, characterized in that: include: Image acquisition module, reflection detection module, pixel repair module and denoising processing module; The image acquisition module is used to acquire a tongue image detection image, and perform image segmentation on the tongue image detection image through a pre-trained tongue image extraction model to generate a tongue image region mask map; irrelevant pixels are removed from the tongue image detection image according to the tongue image region mask map, thereby generating a tongue image region image; wherein the tongue image extraction model is a pre-trained U-Net neural network model, and the U-Net neural network model is trained by using a tongue image data set, and the tongue image data set includes: a tongue image training set and a tongue image test set; The reflection detection module is used to read the grayscale image of the tongue image area; perform reflection detection on the grayscale image so that the pixels in the grayscale image that are higher than a preset threshold are used as the reflection area pixels, thereby obtaining the reflection area; and generate a mask image corresponding to the reflection area pixels according to the reflection area of ​​the tongue image area image as the reflection area mask image; The pixel repair module is used to read the RGB three-channel image of the tongue image area and the single-channel image of the reflective area mask map; determine the point to be repaired according to the single-channel image of the reflective area mask map; traverse all the points to be repaired in the reflective area mask map, and obtain the positioning coordinates of the repair point in the tongue image area image according to the coordinates corresponding to the points to be repaired; take the positioning coordinates as the center of the preset neighborhood matrix, and respectively obtain the R channel pixel values, G channel pixel values, and B channel pixel values ​​of all non-points to be repaired within each preset neighborhood matrix; the preset neighborhood matrix includes a number of neighborhood matrices of preset lengths; calculate the R channel pixel average value, G channel pixel average value, and B channel pixel average value respectively according to the R channel pixel value, G channel pixel value, and B channel pixel value within each preset neighborhood matrix; calculate the average value according to the R channel pixel average value, G channel pixel average value, and B channel pixel average value within different preset neighborhood ranges, as the pixel value of the repair point, traverse all pixel points of the reflective area mask map, and repair all pixel points to be repaired to generate a repaired tongue detection image; The denoising module is used to perform denoising on the tongue image after pixel value restoration, so as to obtain a tongue image with de-reflection treatment.

4. A terminal device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the method for de-reflection processing of tongue image as described in any one of claims 1 to 2 is implemented.

5. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the de-reflection processing method for tongue image according to any one of claims 1 to 2.

Citation Information

Patent Citations

  • Gastroscope image analysis system and method based on repair and selective enhancement, and equipment

    CN113256572A

  • Tongue picture skew correction method and device, equipment and storage medium

    CN116362975A