A method for color correction in medical endoscopy

By dividing and weighting multiple CCM matrices, the accuracy problem of color correction in medical endoscope images was solved, achieving the standardization and real-time requirements of images and simplifying resource consumption.

CN118397110BActive Publication Date: 2026-11-10NANJING TUGE HEALTHCARE CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410158957.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-04
Publication Date
2026-11-10
Estimated Expiration
2044-02-04

AI Technical Summary

Technical Problem

Current technology lacks efficient and accurate methods for color correction of medical endoscopic images, which leads to differences between the images and human visual perception, affecting the success of the surgery.

Method used

Multiple CCM matrices are used to divide image data according to brightness, blue chromaticity, and red chromaticity, generating different CCM matrices. Weight values ​​are calculated using Euclidean distance and then weighted to achieve image color correction.

Benefits of technology

It achieves standardized correction of image colors, solves the color cast problem, simplifies the implementation process, reduces resource consumption, and meets the real-time requirements of endoscopic equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118397110B_ABST
    Figure CN118397110B_ABST
Patent Text Reader

Abstract

This invention discloses a color correction method for medical endoscopes, comprising the following steps: S1. Acquiring images with different brightness, red chromaticity, and blue chromaticity, then mapping the image data to target data and dividing the data into different subsets; S2. Generating different CCM matrices based on the data of each subset; S3. Converting each pixel of the acquired RGB format image from RGB to YCbCr; S4. Finding the corresponding matrix and its adjacent matrices based on the converted YCbCr, and multiplying the corresponding pixel by these matrices to obtain the converted value; S5. Weighting the values ​​obtained in S4 to obtain the final value. This solution is a color correction scheme that is both simple and effective, capable of targeted color correction and compensating for the inaccuracy of color correction with a single CCM matrix.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of medical devices, specifically relating to a method for color correction of medical endoscopes. Background Technology

[0002] In the medical field, the application scenarios and surgical procedures using endoscopes are becoming increasingly common. However, due to factors such as light source, operating environment, and the accompanying devices used, the images generated by endoscopes often differ significantly from the images seen by the doctor's naked eye, which can affect the smoothness of the operation. Therefore, various color corrections to match reality are generally required for endoscopic images.

[0003] Currently, existing color correction schemes mainly include the 3DLUT color correction scheme and single CCM matrix correction. The 3DLUT color correction scheme has good results but is complex to implement, while the single CCM matrix is ​​simple to implement but cannot achieve the correction effect for all colors. Chinese patent CN202110775757 discloses an endoscopic image enhancement algorithm that converts the image to the HSV domain and then processes the image on each of the three components to enhance the image, without addressing color correction. Chinese patent CN201380037982 discloses an image processing device and an endoscope device that converts the image to the HSI domain, then uses hue and saturation to determine whether each pixel is in a lesion area, and performs superposition processing to locate the lesion, without addressing color correction. Existing technologies lack efficient and accurate solutions for color correction of all images from medical endoscopes, making them more standardized and solving the problem of color cast. Summary of the Invention

[0004] The purpose of this invention is to provide a color correction method for medical endoscopes based on existing technologies. This solution uses multiple sets of CCM matrices, divided according to brightness, blue chromaticity, and red chromaticity, to perform color correction on medical surgical images. It is simple to implement, consumes few resources, and can meet the real-time requirements of endoscopic equipment.

[0005] The objective of this invention can be achieved through the following measures:

[0006] A method for color correction in medical endoscopy, comprising the following steps:

[0007] S1. Collect images with different brightness, red chromaticity, and blue chromaticity obtained through medical endoscopy, then match the image data with the target data and divide the data into different subsets;

[0008] S2. Generate different CCM matrices based on the data of each subset;

[0009] S3. Convert each pixel of the acquired RGB format image from RGB to YCbCr;

[0010] S4. Based on the converted YCbCr, find the corresponding matrix and its adjacent matrices, and multiply the corresponding pixel by these matrices to obtain the converted value;

[0011] S5. Then, weight the values ​​obtained in S4 to obtain the final value; the weight values ​​are calculated as follows:

[0012] w i =d i / ∑d i

[0013]

[0014] Where Y, Cb, and Cr are the values ​​obtained by the current pixel point after conversion, Y i Cb i Cr i These represent the brightness, blue chromaticity, and red chromaticity of the corresponding matrix, respectively, d i The calculation is based on the Euclidean distance between the current point and the transformation matrix used, and then the corresponding weight value is obtained based on the Euclidean distance.

[0015] In step S1, preferably, the data is divided into subsets of 16 red chromaticities, 4 blue chromaticities, and 4 brightness levels.

[0016] In step S3, preferably, the conversion formula is:

[0017]

[0018]

[0019] In step S2, the calculated matrix values ​​are pre-stored in the FPGA as a table.

[0020] In step S4, the preferred corresponding conversion formula is as follows:

[0021]

[0022]

[0023] Where i is the i-th transformation matrix found, and R, G, and B are the values ​​of the current pixel. i G i B i This represents the value of the converted pixel.

[0024] In step S4, preferably, there are 7 adjacent matrices, and multiplying the corresponding pixel by these 7 matrices will yield 7 transformed values; i = 1 to 7.

[0025] In step S5, after obtaining the weight values, a weighted sum is performed to obtain the final transformed pixel values. Preferably, the weighting formula is as follows:

[0026] R = ∑w i ×R i

[0027] G=∑w i ×G i

[0028] B = ∑w i ×B i .

[0029] The beneficial effects of this invention are:

[0030] Compared with existing technologies, the method of this invention can correct colors, making them more standardized and solving the problem of color cast. This solution is a color correction scheme that is both simple and effective. Because it uses a CCM matrix, implementation is simple, but the division into multiple CCM matrices allows for targeted color correction, compensating for the inaccuracy of color correction with a single CCM matrix. Furthermore, due to its simplicity, this solution is suitable for FPGA implementation, consumes fewer resources, and meets the real-time requirements of endoscopic equipment. Attached Figure Description

[0031] Figure 1 This is a medical endoscopic image before color correction;

[0032] Figure 2 These are medical endoscope images after color correction according to the method of this invention. Detailed Implementation

[0033] The present invention will be further described below with reference to the accompanying drawings and embodiments. However, the scope of protection of this application is not limited to the following embodiments.

[0034] A method for color correction in medical endoscopy, comprising the following steps

[0035] Step S1: Since red is the dominant color in surgical scenarios, such as blood and internal organs, the accuracy of red significantly impacts the image quality of the endoscope. Inaccurate red can lead to difficulty in distinguishing blood vessels and internal organs, affecting the surgeon's ability to perform the operation. Therefore, it is crucial to focus on correcting the red spectrum. Considering that the YCbCr domain has a component that distinguishes red separately, the endoscope's main unit first acquires images with different brightness levels, red chromaticity, and blue chromaticity, then maps the image data to the target data. Because red needs to be corrected specifically, the data is divided into 16 red chromaticities, 4 blue chromaticities, and 4 brightness levels, resulting in 256 subsets. Since the range of red chromaticity is 0-255, and 128 is pure red, the hue is divided into 0-15, 16-31, ..., 128-143, ..., 240-255, with each subset containing 16 red chromaticities. Since the range of blue chroma and brightness is 0-255, both are divided into 0-63, 64-127, ..., 192-255.

[0036] Step S2: Generate different CCM matrices based on the data of each subset. Although each CCM matrix has only 9 parameters, it is designed for a specific range of brightness, red chromaticity and blue chromaticity, and the converted data will be closer to the target value.

[0037] Step S3: The image input to the endoscope host is in RGB format. First, each pixel needs to be converted from RGB to YCbCr. The conversion formula is as follows:

[0038]

[0039]

[0040] Step S4: Based on the converted YCbCr, find the corresponding matrix and its adjacent matrices. Since there are three variables: red chroma, lightness, and blue chroma, there are a total of 6 adjacent matrices, making a total of 7 matrices. Multiplying the corresponding pixel by these 7 matrices yields 7 converted values. The conversion formula is as follows:

[0041]

[0042]

[0043] Where i = 1 to 7, CCM i Let R, G, and B be the values ​​of the current pixel, where R is the i-th transformation matrix found. i G i B i This represents the value of the converted pixel.

[0044] Step S5: Then, weight these 7 values ​​to obtain the final value. The weights are calculated as follows.

[0045] w i =d i / ∑d i

[0046]

[0047] Where Y, Cb, and Cr are the values ​​obtained by the current pixel point after conversion, Y i Cb i Cr i These represent the brightness, blue chromaticity, and red chromaticity of the corresponding matrix, respectively, d i The calculation involves the Euclidean distance between the current point and the transformation matrix used, and then the corresponding weight values ​​are derived from this Euclidean distance. These weight values ​​are then weighted to obtain the final transformed pixel value, as shown in the following formula:

[0048] R = ∑w i ×R i

[0049] G=∑w i ×G i

[0050] B = ∑w i ×B i

[0051] The specific implementation examples are as follows:

[0052] The original images received by the endoscope host have low color discrimination and color cast, so the ISP processing module usually includes an image correction module. This solution is based on the algorithm of the image correction module. To facilitate host implementation, the required CCM matrix values ​​need to be calculated in advance, as shown in steps S1 and S2.

[0053] The calculated matrix values ​​are pre-stored in the FPGA as a table, and then the process can begin. First, the input image is converted from the RGB domain to the YCbCr domain, and the specific conversion formula is shown in step S3.

[0054] Next, based on the converted YCbCr value of each pixel in the image, a table is looked up and the corresponding converted pixel value is calculated. The specific calculation formula is shown in step 4.

[0055] Then, weighted interpolation is performed on the calculated multiple sets of pixels to obtain the final calculation result. The specific calculation formula is shown in step 5.

[0056] Before and after color correction comparison images are shown below. Figure 1 and 2As shown, before color correction, the fat was reddish with no color distinction; after correction, the fat turned yellow, and the red and yellow colors became clearly distinguishable.

Claims

1. A method for color correction in medical endoscopes, characterized in that... Includes the following steps: S1. Collect images with different brightness, red chromaticity and blue chromaticity obtained through medical endoscopy, and divide the image data into 256 subsets of 16 red chromaticity, 4 blue chromaticity and 4 brightness; S2. Generate different CCM matrices based on the data in each subset; S3. Convert each pixel of the acquired RGB format image from RGB to YCbCr; S4. Based on the converted YCbCr, find the corresponding matrix and its adjacent matrices. Specifically, find the 6 adjacent matrices based on the three variables of red chromaticity, brightness, and blue chromaticity, resulting in a total of 7 matrices. Multiply the corresponding pixel by these matrices to obtain the converted value. S5. Then, the values ​​obtained in S4 are weighted to obtain the final value. The weighting formula is as follows: ; The weight values ​​are calculated as follows: ; Where Y, Cb, and Cr are the values ​​obtained by the current pixel point after conversion, Y i Cb i Cr i These represent the brightness, blue chromaticity, and red chromaticity of the corresponding matrix, respectively, d i The calculation is based on the Euclidean distance between the current point and the transformation matrix used, and then the corresponding weight value is obtained based on the Euclidean distance.

2. The medical endoscope color correction method according to claim 1, characterized in that... In step S3, the conversion formula is: ; 。 3. The medical endoscope color correction method according to claim 1, characterized in that... In step S4, the corresponding conversion formula is as follows: ; ; Where i is the i-th transformation matrix found, and R, G, and B are the values ​​of the current pixel. i G i B i This represents the value of the converted pixel.

4. The medical endoscope color correction method according to claim 1, characterized in that... In step S2, the calculated matrix values ​​are pre-stored in the FPGA as a table.

Citation Information

Patent Citations

  • Image processing device and endoscopic instrument

    CN104470416A

  • Endoscope image enhancement algorithm

    CN113298737A

  • Color correction matrix determination method and device, color correction method and device and storage medium

    CN114827565A

  • Color correction matrix adjustment method and device, electronic equipment and readable storage medium

    CN115426487A