Endoscopic Image Correction Method and Electronic Device
By performing edge attribute marking and color contrast correction on the endoscopic image, the problem of insufficient tissue color difference in narrowband light imaging mode is solved, and the image discrimination and diagnostic accuracy are improved.
Patent Information
- Application Number
- CN202411799626.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2044-12-09
AI Technical Summary
In narrowband light imaging mode, the color differences between different tissues of organisms are not obvious enough, which makes it more difficult for users to observe and diagnose.
By acquiring the original images acquired by the imaging unit, edge attribute marking is performed on the pixels, color contrast correction is performed according to the edge attribute marking, and correction images are generated.
It improves the color distinction between different tissues, provides more intuitive and rich reference information, and enhances the accuracy of clinical diagnosis.
Smart Images

Figure CN119273599B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical endoscope imaging, and particularly to an endoscope image correction method and a computer electronic device. Background Art
[0002] With the booming development of endoscope applications, doctors' demand for high-quality endoscope imaging has also been continuously increasing. In endoscope application scenarios, especially during the examination, diagnosis, and treatment of digestive endoscopes (gastroscopes and colonoscopes), doctors usually use the white light imaging mode that conforms to the human eye vision for routine operations. When further exploring lesions is required, the narrowband light imaging mode will be switched to.
[0003] The narrowband light imaging mode will make different tissues of organisms present different colors. However, in actual use, this color difference is often not obvious enough, increasing the difficulty for users to observe and diagnose.
[0004] Therefore, how to improve the distinguishability of effective information and provide more intuitive and rich reference information for clinical diagnosis is an urgent problem to be solved. Summary of the Invention
[0005] In view of this, the present invention provides an endoscope image correction method and an electronic device to solve the problem that the tissue color difference in the narrowband light imaging mode is not obvious and the effective distinguishability is low.
[0006] In a first aspect, the present invention provides an endoscope image correction method, including: obtaining an original image collected by an imaging unit, where the original image includes a first color channel representing the characteristics of a first human tissue and a second color channel for representing the characteristics of a second human tissue; respectively performing edge attribute marking on the pixels in the original image according to the first color channel and the second color channel to obtain a plurality of pixels to be processed with edge attribute marking; and performing color contrast correction on the pixels to be processed according to the edge attribute marking corresponding to each pixel to be processed and the relationship between the edge attribute markings to obtain a corrected image.
[0007] As an exemplary embodiment, the step of respectively performing edge attribute marking on the pixels in the original image according to the first color channel and the second color channel to obtain a plurality of pixels to be processed with edge attribute marking includes: using an edge classification algorithm to respectively classify the pixels in the original image according to the first color channel and the second color channel to obtain edge pixels and non-edge pixels; where the edge pixels include pixels with a first type of edge attribute marking corresponding to the first color channel and / or a second type of edge attribute marking corresponding to the second color channel.
[0008] As an exemplary embodiment, performing color contrast correction on the pixel to be processed according to the edge attribute label corresponding to each pixel to be processed and the relationship between the edge attribute labels to obtain a corrected image includes: obtaining the edge pixels in the pixel to be processed; determining whether the edge attribute label of the edge pixel is one of the first edge attribute or the second type of edge attribute; if the edge pixel only has the first type of edge attribute, adjusting the parameters in the mapping matrix corresponding to the edge pixel with a first preset adjustment coefficient to obtain an adjusted mapping matrix, where the first preset adjustment coefficient is used to enhance the color contrast corresponding to the first color channel in the edge pixel; if the edge pixel only has the second type of edge attribute, adjusting the parameters in the mapping matrix corresponding to the edge pixel with a second preset adjustment coefficient to obtain an adjusted mapping matrix, where the second preset adjustment coefficient is used to enhance the color contrast corresponding to the second color channel in the edge pixel; mapping the adjusted mapping matrix to the original image to obtain the corrected image.
[0009] As an exemplary embodiment, performing color contrast correction on the pixel to be processed according to the edge attribute label corresponding to each pixel to be processed and the relationship between the edge attribute labels to obtain a corrected image further includes: obtaining non-edge pixels in the pixel to be processed; averaging and adjusting the parameters in the color mapping matrix corresponding to the non-edge pixels to obtain the adjusted mapping matrix; mapping the adjusted mapping matrix to the original image to obtain the corrected image.
[0010] As an exemplary embodiment, respectively performing edge attribute labeling on the pixels in the original image according to the first color channel and the second color channel to obtain a plurality of pixels to be processed with edge attribute labels includes: respectively calculating the edge intensity of the pixels with the first color channel in the original image and the edge intensity of the pixels with the second color channel; based on the edge intensity, respectively performing edge level classification on the pixels with the first color channel and the pixels with the second color channel to obtain pixels to be processed with a first edge level label corresponding to the first color channel and / or a second edge level label corresponding to the second color channel.
[0011] As an exemplary embodiment, performing color contrast correction on the pixel to be processed according to the edge attribute mark corresponding to each pixel to be processed and the relationship between the edge attribute marks to obtain a corrected image includes: calculating a first difference between a first edge level and a second edge level of the pixel to be processed, where the first difference is a positive number; determining a grading adjustment coefficient of the pixel to be processed based on the first difference, where the value of the grading adjustment coefficient is positively correlated with the first difference; adjusting parameters in the color mapping matrix corresponding to the pixel to be processed based on the grading adjustment coefficient to obtain an adjusted mapping matrix, and the grading adjustment coefficient is used to enhance the color contrast of the color channel with a larger edge level in the pixel to be processed; mapping the adjusted mapping matrix to the original image to obtain the corrected image.
[0012] As an exemplary embodiment, after adjusting the parameters in the color mapping matrix corresponding to the pixel to be processed based on the grading adjustment coefficient, it includes: obtaining a sub-pixel to be processed in which both the first edge level and the second edge level are less than a preset level; calculating a second difference between the first edge level and the second edge level in the sub-pixel to be processed, where the second difference is a positive number; determining an averaging adjustment parameter of the sub-pixel to be processed based on the second difference; where the averaging adjustment parameter is positively correlated with the second difference; performing an averaging adjustment on the parameters in the color mapping matrix corresponding to the sub-pixel to be processed based on the averaging adjustment parameter to obtain an adjusted mapping matrix; mapping the adjusted mapping matrix to the original image to obtain the corrected image.
[0013] As an exemplary embodiment, after performing color contrast correction on the pixel to be processed according to the edge attribute mark corresponding to each pixel to be processed and the relationship between the edge attribute marks, the method further includes: obtaining a neighborhood mapping matrix of the neighborhood pixel points within a preset smoothing radius corresponding to the pixel to be processed; determining a neighborhood smoothing weight based on the relative degree of the neighborhood pixel points and the pixel to be processed with respect to the preset smoothing radius; performing neighborhood smoothing correction on the adjusted mapping matrix based on the neighborhood mapping matrix and the correction weight.
[0014] As an exemplary embodiment, the first color channel in the original image is formed based on a narrowband blue-violet light source and a narrowband blue light source of an illumination unit of an endoscope; the second color channel is formed based on a narrowband green light source of the illumination unit; the central wavelength of the narrowband blue-violet light source is 415 ± 10 nm; the central wavelength of the narrowband blue light source is 457 ± 10 nm; the central wavelength of the narrowband green light source is 540 ± 15 nm.
[0015] In a second aspect, the present invention provides an electronic device, comprising: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the endoscopic image correction method according to the first aspect or any corresponding embodiment thereof.
[0016] The present invention provides an endoscopic image correction method, comprising: acquiring an original image collected by an imaging unit, where the original image includes a first color channel representing the characteristics of a first human tissue and a second color channel for representing the characteristics of a second human tissue; respectively performing edge attribute marking on the pixels in the original image according to the first color channel and the second color channel to obtain a plurality of pixels to be processed with edge attribute marking; performing color contrast correction on the pixels to be processed according to the edge attribute marking corresponding to each pixel to be processed and the relationship between the edge attribute markings to obtain a corrected image; the edge attribute marking method considering the first color channel and the second color channel for edge attribute marking can avoid the problem of inaccurate division that may be caused by the division method using common pixels and unique pixels. The plurality of pixels to be processed with edge attribute marking can more accurately represent the edge characteristics of the first human tissue and the second human tissue; and, performing color contrast correction on the pixels to be processed according to the edge attribute marking corresponding to each pixel to be processed and the relationship between the edge attribute markings can highlight the color differentiation between different tissues under a specific illumination mode. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for use in the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0018] Figure 1 is a schematic flowchart of the endoscopic image correction method according to an embodiment of the present invention;
[0019] Figure 2 is a schematic hardware structure diagram of the electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0020] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0021] Narrow-band light imaging mode makes different tissues of an organism appear in different colors. However, in actual use, this color difference is often not obvious enough.
[0022] In response to the above-mentioned problem of unclear color differences, a related technology is to pre-process the difference information between the narrow-band images corresponding to each narrow-band light source through the corresponding relationship between different tissues and narrow-band light sources when narrow-band light imaging is performed, so as to obtain an enhanced composite image; it is specifically achieved by judging the common pixels and unique pixels between the narrow-band images, and then enhancing the unique pixels with differences.
[0023] However, when judging the common pixels and unique pixels between narrow-band images, it is usually judged by whether the pixel values between the two pixels are the same; this judgment method cannot indicate that the two images represent effective tissue characteristic information even if the pixel values between the two images are different; even if the pixel values between the two images are the same, it cannot indicate that the two images do not represent effective tissue characteristic information. Therefore, the image enhanced by the above-mentioned image enhancement method has a poor image enhancement effect due to inaccurate judgment of its tissue characteristic information.
[0024] According to an embodiment of the present invention, an embodiment of an endoscopic image correction method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0025] In one embodiment, the endoscope includes a lighting unit, an imaging unit and an image processing unit, and the imaging processing unit is used to execute the image correction method; wherein the lighting unit includes at least one first narrow-band light source of at least one first band corresponding to the blue channel in the RGB image captured by the imaging unit, at least one second narrow-band light source of at least one second band corresponding to the green channel, and a plurality of third light sources of third bands; the first narrow-band light source, the second narrow-band light source and the third light source can synthesize preset standard light under corresponding standard light power, and under the irradiation of the preset standard light, the imaging unit can capture the target image.
[0026] In one embodiment, the light source illumination combination used in the endoscope includes at least one or both of a narrow-band blue-violet light source and a narrow-band blue light source, a narrow-band green light source, and any other one or more narrow-band light sources. The center wavelength of the narrow-band green light source can be 540±15nm, the center wavelength of the narrow-band blue-violet light source can be 415±10nm, and the center wavelength of the narrow-band blue light source can be 457±10nm.
[0027] In this embodiment, an endoscope image correction method is provided, which can be used for the above-mentioned endoscope or an external data processing device of the endoscope. Figure 1 It is a flowchart of the endoscope image correction method according to an embodiment of the present invention, as Figure 1 shown. The process includes the following steps:
[0028] Step S101, obtain the original image collected by the imaging unit. The original image includes a first color channel representing the characteristics of the first human tissue and a second color channel for representing the characteristics of the second human tissue.
[0029] When performing narrow-band imaging, for different human tissue characteristics, narrow-band light sources capable of synthesizing different color channels are used for imaging. Therefore, in this embodiment, the original image includes a first color channel and a second color channel. The first color channel is used to represent the characteristics of the first human tissue, and the second color channel is used to represent the characteristics of the second human tissue. Among them, human tissues can include relevant tissues such as mucous membranes, blood vessels, and organs. The first human tissue characteristics and the second human tissue characteristics are used to represent any one of mucous membranes, blood vessels, and organs.
[0030] In one embodiment, the original image contains human tissue blood vessels. The first human tissue characteristics can be the characteristics of superficial tissue blood vessels, and the second human tissue characteristics can be the characteristics of deep tissue blood vessels. Since narrow-band blue-violet light and narrow-band blue light have strong absorption characteristics for superficial tissue blood vessels, and narrow-band green light has strong absorption characteristics for middle and deep mucous membrane blood vessels, in this embodiment, the first color channel can be a blue channel representing the characteristics of superficial tissue blood vessels, denoted as B; the second color channel can be a green channel representing the characteristics of middle and deep mucous membrane blood vessels, denoted as G, as an example to illustrate the technical solution of this embodiment.
[0031] Step S102, respectively perform edge attribute marking on the pixels in the original image according to the first color channel and the second color channel, to obtain a plurality of to-be-processed pixels with edge attribute marking.
[0032] As described above, in the related art, for the enhancement method of narrow-band images, due to inaccurate judgment of tissue characteristic information, the image enhancement effect is not good. To avoid this problem, in this embodiment, pixels in the original image are respectively marked with edge attributes according to the first color channel and the second color channel, so as to obtain a plurality of pixels to be processed with edge attribute marks, so as to fully extract the tissue characteristic information of each color channel.
[0033] Specifically, an image processing method including at least one of an edge detection method, a high-pass filter, an inverse low-pass filter, a detail extraction model based on a shallow neural network, etc. can be used to implement edge pixel detection for the blue channel B and the green channel G. Among them, the edge detection method can include canny operator, sobel operator, etc., the high-pass filter can include Butterworth filter, exponential high-pass filter, etc., and the inverse low-pass filter can adopt the implementation method of subtracting the low-pass filter from the original image.
[0034] In one embodiment, when respectively marking the pixels in the original image with edge attributes according to the first color channel and the second color channel to obtain a plurality of pixels to be processed with edge attribute marks, the pixels in the original image can be classified according to the first color channel and the second color channel respectively, and all the edge pixels with the first type of edge attribute marks representing the first human tissue characteristics (superficial tissue blood vessel characteristics) detected in the blue channel B and all the edge pixels with the second type of edge attribute marks representing the second human tissue characteristics (middle and deep mucosal blood vessel characteristics) detected in the green channel G are used as the pixels to be processed. Among them, the edge pixels detected in the blue channel B are denoted as , and the edge pixels detected in the green channel G are denoted as .
[0035] In one embodiment, after obtaining the edge pixels with the first type of edge attribute marks and the edge pixels with the second type of edge attribute marks, the edge intensity of the pixels with the first color channel in the original image and the edge intensity of the pixels with the second color channel can be respectively calculated, and further, based on the edge intensity, the pixels with the first color channel and the pixels with the second color channel are respectively graded for edge levels, and pixels to be processed with the first edge level marks corresponding to the first color channel and / or the second edge level marks corresponding to the second color channel are respectively obtained.
[0036] In one embodiment, when edge property marking is performed on the pixels in the original image according to the first color channel and the second color channel respectively to obtain a plurality of pixels to be processed with edge property markings, the edge intensity of the pixels with the first color channel in the original image and the edge intensity of the pixels with the second color channel can be calculated respectively; edge grading is performed on the non-edge pixels in the corresponding blue channel B and green channel G respectively based on the detected edge pixels to obtain an edge grading result, and further, pixels to be processed are obtained based on the edge grading result.
[0037] In the above embodiment of performing edge property marking on the pixels in the original image according to the first color channel and the second color channel respectively to obtain a plurality of pixels to be processed with edge property markings, the division method of performing edge property marking on the pixels in the target image considering the edge properties of the first color channel and the second color channel can avoid the problem of inaccurate division that may be caused by the division method using common pixels and unique pixels. The plurality of pixels to be processed with edge property markings can more accurately represent the edge characteristics of the first human tissue and the second human tissue.
[0038] Step S103, perform color contrast correction on the pixels to be processed according to the edge property markings corresponding to each pixel to be processed and the relationship between the edge property markings to obtain a corrected image.
[0039] In this embodiment, each pixel to be processed individually corresponds to an edge property marking of the first human tissue characteristic (superficial tissue blood vessel characteristic), an edge property marking of the second human tissue characteristic (mid-deep mucosal blood vessel characteristic), an edge property marking corresponding to both the first human tissue characteristic (superficial tissue blood vessel characteristic) and the second human tissue characteristic, or an edge property marking that does not correspond to the first human tissue characteristic (superficial tissue blood vessel characteristic) and the second human tissue characteristic; performing color contrast correction on the pixels to be processed according to the edge property markings corresponding to each pixel to be processed and the relationship between the edge property markings can adaptively perform color contrast enhancement correction based on the color corresponding to the edge property marking according to the edge property represented by the pixel to be processed and the relationship between the edge property markings.
[0040] Exemplarily, if a pixel to be processed individually corresponds to the edge property of the first human tissue characteristic (superficial tissue blood vessel characteristic), color contrast enhancement correction adapted to the edge of the superficial tissue blood vessel is performed on it according to its edge property marking, so that the pixel to be processed after correction can highlight the edge of the superficial tissue blood vessel compared with other pixels to distinguish the edge of the superficial tissue blood vessel from other tissues.
[0041] Exemplarily, if the pixel to be processed individually corresponds to the edge attribute of the second human tissue characteristic (mid-deep mucosal vascular characteristic), color contrast enhancement correction adapted to the mid-deep mucosal vascular characteristic is performed on it according to its edge attribute label, so that the pixel to be processed after correction can highlight the mid-deep mucosal vascular edge compared with other pixels, in order to distinguish the mid-deep mucosal vascular characteristic from other tissues.
[0042] Exemplarily, if the pixel to be processed corresponds to the edge attributes of the first human tissue characteristic (superficial tissue vascular characteristic) and the second human tissue characteristic (mid-deep mucosal vascular characteristic), and it is at the edge of the superficial tissue blood vessel and the mid-deep mucosal blood vessel, it may not be processed at this time. Adaptive correction can be performed according to its degree of deviation representing the first human tissue characteristic or the second human tissue characteristic, or according to its degree of deviation representing the non-first human tissue characteristic or the non-second human tissue characteristic, so that the pixel to be processed can highlight the edges of the superficial tissue blood vessel and the mid-deep mucosal blood vessel compared with other pixels.
[0043] Exemplarily, if the pixel to be processed does not represent the edge attributes of the first human tissue characteristic (superficial tissue vascular characteristic) and the second human tissue characteristic, color contrast enhancement correction adapted to the color corresponding to the non-edge area corresponding to the non-superficial tissue vascular edge or the non-mid-deep mucosal vascular edge is performed on it according to its edge attribute label, in order to highlight other pixels to be processed that individually represent the superficial tissue vascular edge, individually represent the mid-deep mucosal vascular edge, or jointly represent the superficial tissue vascular edge and the mid-deep mucosal vascular edge.
[0044] In the above embodiments, color contrast enhancement correction based on the color corresponding to the edge attribute label is performed on each pixel to be processed according to the edge attribute label corresponding to the pixel to be processed. By enhancing the color corresponding to the pixel to be processed representing the first human tissue characteristic and the second human tissue characteristic, the color differentiation between different tissues under a specific illumination mode can be highlighted.
[0045] Among them, as a possible implementation manner, when performing color contrast enhancement correction based on the color corresponding to the edge attribute label on each pixel to be processed according to the edge attribute label corresponding to the pixel to be processed, the pixel value of the pixel to be processed can be directly adjusted based on the color corresponding to the edge attribute label to obtain the image correction result.
[0046] As another possible implementation manner, when performing color contrast enhancement correction based on the color corresponding to the edge attribute label on each pixel to be processed according to the edge attribute label corresponding to the pixel to be processed, the pixel to be processed can be adjusted by processing the mapping matrix of each pixel to be processed to obtain the image correction result.
[0047] In the above method of this embodiment, a target image collected by an imaging unit is obtained. The target image includes a first color channel representing the characteristics of a first human tissue and a second color channel for representing the characteristics of a second human tissue. The pixels in the target image are divided respectively according to the edge attributes of the first color channel and the edge attributes of the second color channel to obtain a plurality of pixels to be processed with edge attribute marks. The pixels to be processed are subjected to color contrast enhancement correction based on the color corresponding to the edge attribute mark according to the edge attribute mark corresponding to each pixel to be processed, and an image correction result is obtained. Considering the edge attribute marking methods for the first color channel and the second color channel, the problem of inaccurate division that may be caused by using the division methods of common pixels and unique pixels can be avoided. The plurality of pixels to be processed with edge attribute marks can more accurately represent the edge characteristics of the first human tissue and the second human tissue. Moreover, by performing color contrast correction on the pixels to be processed according to the edge attribute mark corresponding to each pixel to be processed and the relationship between the edge attribute marks, the color differentiation between different tissues under a specific illumination mode can be highlighted.
[0048] As an exemplary embodiment, dividing the pixels in the original image respectively according to the first color channel and the second color channel to obtain a plurality of pixels to be processed with edge attribute marks includes: using an edge classification algorithm to classify the pixels in the original image respectively according to the first color channel and the second color channel to obtain edge pixels and non-edge pixels. Among them, the edge pixels include pixels with a first type of edge attribute mark corresponding to the first color channel and / or a second type of edge attribute mark corresponding to the second color channel.
[0049] In this embodiment, an edge classification algorithm is used to classify the pixels in the original image respectively according to the first color channel and the second color channel. All the edge pixels with the first type of edge attribute mark detected in the blue channel B, which represent the characteristics of the first human tissue (superficial tissue blood vessel characteristics), and all the edge pixels with the second type of edge attribute mark detected in the green channel G, which represent the characteristics of the second human tissue (mid-deep mucosal blood vessel characteristics), are used as the pixels to be processed. Among them, the edge pixels detected in the blue channel B are denoted as , and the edge pixels detected in the green channel G are denoted as .
[0050] As an exemplary embodiment, performing color contrast correction on the pixel to be processed according to the edge attribute marks corresponding to each pixel to be processed and the relationship between the edge attribute marks to obtain a corrected image includes: obtaining the edge pixels in the pixel to be processed; determining whether the edge attribute mark of the edge pixel is one of a first edge attribute or a second type of edge attribute; if the edge pixel only has the first type of edge attribute, adjusting the parameters in the mapping matrix corresponding to the edge pixel with a first preset adjustment coefficient to obtain an adjusted mapping matrix, where the first preset adjustment coefficient is used to enhance the color contrast corresponding to the first color channel in the edge pixel; if the edge pixel only has the second type of edge attribute, adjusting the parameters in the mapping matrix corresponding to the edge pixel with a second preset adjustment coefficient to obtain an adjusted mapping matrix, where the second preset adjustment coefficient is used to enhance the color contrast corresponding to the second color channel in the edge pixel; mapping the adjusted mapping matrix to the original image to obtain the corrected image.
[0051] In this embodiment, if the edge pixel only has the first type of edge attribute, which represents the edge attribute of the pixel to be processed that individually represents the characteristics of the first human tissue (superficial tissue blood vessel characteristics), adjusting the parameters in the mapping matrix corresponding to the edge pixel with a first preset adjustment coefficient to obtain an adjusted mapping matrix, so as to perform color contrast enhancement correction adapted to the superficial tissue blood vessel edge, so that the pixel to be processed after correction can highlight the superficial tissue blood vessel edge compared with other pixels, and distinguish the superficial tissue blood vessel edge from other tissues.
[0052] In one embodiment, when adjusting the parameters in the mapping matrix corresponding to the edge pixel with a first preset adjustment coefficient, the first preset adjustment coefficient can be used to separately adjust the parameters in the mapping matrix corresponding to the color representing the superficial tissue blood vessel edge.
[0053] In one embodiment, when adjusting the parameters in the mapping matrix corresponding to the edge pixel with a first preset adjustment coefficient, the first preset adjustment coefficient can be used to adjust each parameter in the mapping matrix; specifically, the first preset adjustment coefficient can be a first adjustment matrix, and the first adjustment matrix includes first preset adjustment coefficients corresponding one by one to the parameters in the mapping matrix.
[0054] If the edge pixel only has the second type of edge attribute, which characterizes the edge attribute of the pixel to be processed representing the characteristics of the second human tissue (mid-deep mucosal vascular characteristics) alone, the parameters in the mapping matrix corresponding to the edge pixel are adjusted with a second preset adjustment coefficient to obtain an adjusted mapping matrix, so as to perform color contrast enhancement correction adapted to the mid-deep mucosal vascular characteristics, so that the pixel to be processed after correction can highlight the superficial tissue vascular edge compared with other pixels, so as to distinguish the superficial tissue vascular edge from other tissues.
[0055] In one embodiment, when adjusting the parameters in the mapping matrix corresponding to the edge pixel with a second preset adjustment coefficient, the second preset adjustment coefficient can be used to separately adjust the parameters in the mapping matrix corresponding to the color of the mid-deep mucosal vascular edge.
[0056] In one embodiment, when adjusting the parameters in the mapping matrix corresponding to the edge pixel with a second preset adjustment coefficient, the second preset adjustment coefficient can be used to adjust each parameter in the mapping matrix; specifically, the second preset adjustment coefficient can be a second adjustment matrix, and the second adjustment matrix includes second preset adjustment coefficients corresponding one by one to the parameters in the mapping matrix.
[0057] In one embodiment, the mapping matrix is denoted as P. When using the mapping matrix to process the pixel to be processed, its processing process can be represented by formula (1):
[0058] (1)
[0059] In formula (1), represents the color of the red channel of the pixel to be processed adjusted by the mapping matrix, represents the color of the green channel of the pixel to be processed adjusted by the mapping matrix, represents the color of the blue channel of the pixel to be processed adjusted by the mapping matrix, P represents the mapping matrix, 、 、 、 、 、 are the parameters included in the mapping matrix.
[0060] In one embodiment, if the edge attribute tags corresponding to the pixel to be processed only contain the first type of edge attribute tags, it is considered that the current pixel to be processed represents the edge of superficial capillaries; usually, the edge of superficial capillaries is reddish-brown, so the color of the edge attribute corresponding to the first color channel is reddish-brown. At this time, the parameters in the mapping matrix are adjusted to enhance the contrast towards reddish-brown to obtain the adjusted mapping matrix. Specifically, for the mapping matrix corresponding to this pixel to be processed, perform operations such that then Increase , Increase , Increase , Increase , Decrease , Decrease of the adjustment to obtain the adjusted mapping matrix, where, are all preset parameters not less than 0.
[0061] In one embodiment, if the edge attribute tags corresponding to the pixel to be processed only contain the second type of edge attribute tags, it is considered that the current pixel to be processed represents the edge of middle and deep mucosal blood vessels; usually, the edge of middle and deep mucosal blood vessels is cyan-green, so the color of the edge attribute corresponding to the second color channel is cyan-green. At this time, the parameters in the mapping matrix are adjusted to enhance the contrast towards cyan-green to obtain the adjusted mapping matrix. Specifically, for the mapping matrix corresponding to this pixel to be processed, perform operations such that then Decrease , Decrease , Increase , Increase , Decrease , Decrease of the adjustment to obtain the adjusted mapping matrix; where, are all preset parameters not less than 0.
[0062] In one embodiment, the first preset adjustment coefficient in the form of the first preset adjustment matrix and / or the second preset adjustment coefficient in the form of the second preset adjustment matrix can be used to adjust the parameters in the mapping matrix corresponding to the edge pixels.
[0063] Furthermore, map the adjusted mapping matrix to the original image to obtain the corrected image.
[0064] As an exemplary embodiment, the step of performing color contrast correction on the pixel to be processed according to the edge attribute markers corresponding to each pixel to be processed and the relationships between the edge attribute markers to obtain a corrected image further includes: obtaining non-edge pixels among the pixels to be processed; averaging and adjusting the parameters in the color mapping matrix corresponding to the non-edge pixels to obtain the adjusted mapping matrix; mapping the adjusted mapping matrix to the original image to obtain the corrected image.
[0065] As described above, non-edge pixels that do not have the first type of edge attribute marker corresponding to the first color channel and / or have the second type of edge attribute marker corresponding to the second color channel also need to be corrected to highlight other pixels to be processed that individually represent the edges of superficial tissue blood vessels, individually represent the edges of medium and deep mucosal blood vessels, or jointly represent the edges of superficial tissue blood vessels and medium and deep mucosal blood vessels.
[0066] Exemplarily, for non-edge pixels that do not have the first type of edge attribute marker corresponding to the first color channel and the second type of edge attribute marker corresponding to the second color channel, it is considered that the non-edge pixels represent non-medium and deep mucosal blood vessel edges or non-superficial capillary edges. To further enhance the contrast between the pixels to be processed that represent non-medium and deep mucosal blood vessel edges or non-superficial capillary edges and the pixels to be processed at the medium and deep mucosal blood vessel edges or superficial capillary edges, the color of the non-edge region should be made lighter to highlight the edge region. At this time, the parameters in the color mapping matrix corresponding to the non-edge pixels are averaged and adjusted to obtain the adjusted mapping matrix; the adjusted mapping matrix is mapped to the original image to obtain the corrected image.
[0067] In one embodiment, for the mapping matrix corresponding to the non-edge pixels among the pixels to be processed, perform operations to make the maximum value decrease and the minimum value increase , and make the maximum value decrease and the minimum value increase , where are all preset parameters not less than 0, and after processing, , , still need to maintain the original corresponding size relationship for averaging adjustment.
[0068] As an exemplary embodiment, edge attribute marking is respectively performed on the pixels in the original image according to the first color channel and the second color channel, and obtaining a plurality of pixels to be processed with edge attribute marking includes: respectively calculating the edge intensity of the pixels with the first color channel in the original image and the edge intensity of the pixels with the second color channel; based on the edge intensity, respectively performing edge level classification on the pixels with the first color channel and the pixels with the second color channel, and respectively obtaining the pixels to be processed with the first edge level marking corresponding to the first color channel and / or the second edge level marking corresponding to the second color channel.
[0069] In this embodiment, when performing edge attribute marking on the pixels in the original image according to the first color channel and the second color channel to obtain a plurality of pixels to be processed with edge attribute marking, the edge intensity of the pixels with the first color channel in the original image and the edge intensity of the pixels with the second color channel are respectively calculated to obtain edge pixels with edge level markings determined by different edge degrees of classification.
[0070] In one embodiment, the edge intensity of the pixels with the first color channel in the original image and the edge intensity of the pixels with the second color channel can be directly calculated, and further, edge attribute marking is performed on the pixels in the original image according to the first color channel and the second color channel, respectively obtaining the pixels to be processed with the first edge level marking corresponding to the first color channel and / or the second edge level marking corresponding to the second color channel.
[0071] In one embodiment, the edge classification algorithm can be first used to perform edge classification on the pixels in the original image according to the first color channel and the second color channel respectively to obtain edge pixels and non-edge pixels, and then further calculate the edge intensity of the pixels with the first color channel and the edge intensity of the pixels with the second color channel for the edge pixels.
[0072] As a possible implementation manner, the first edge level corresponding to the first color channel and the second edge level corresponding to the second color channel have N + 1 levels, the second edge level marking can be denoted as , the first edge level marking can be denoted as , where i and j are values from 0 to N, the larger i is, the more it emphasizes the edge corresponding to the second color channel, and the larger j is, the more it emphasizes the edge corresponding to the first color channel.
[0073] In this embodiment, when i is greater than or equal to j, it indicates that the current pixel tends to represent the edge of the second color channel. When i is not greater than j, it indicates that the current pixel is more inclined to represent the edge of the first color channel. After determining the edge degree of the pixel relative to the edge of the first color channel or the second color channel, it is possible to further correct it to the color channel that it represents more heavily.
[0074] Based on this, as an exemplary embodiment, the color contrast correction of the to-be-processed pixel according to the edge attribute label corresponding to each to-be-processed pixel and the relationship between the edge attribute labels to obtain a corrected image includes: calculating a first difference between a first edge level and a second edge level of the to-be-processed pixel, where the first difference is a positive number; determining a hierarchical adjustment coefficient of the to-be-processed pixel based on the first difference, where the value of the hierarchical adjustment coefficient is positively correlated with the first difference; adjusting the parameters in the color mapping matrix corresponding to the to-be-processed pixel based on the hierarchical adjustment coefficient to obtain an adjusted mapping matrix, and the hierarchical adjustment coefficient is used to enhance the color contrast of the color channel with a larger edge level in the to-be-processed pixel; mapping the adjusted mapping matrix to the original image to obtain the corrected image.
[0075] In this embodiment, the degree of bias of the to-be-processed pixel towards the first color channel or the second color channel is characterized by the first difference between the first edge level and the second edge level of the to-be-processed pixel. Further, a hierarchical adjustment coefficient of the to-be-processed pixel is determined based on the first difference, where the value of the hierarchical adjustment coefficient is positively correlated with the first difference; the parameters in the color mapping matrix corresponding to the to-be-processed pixel are adjusted based on the hierarchical adjustment coefficient to obtain an adjusted mapping matrix, and the hierarchical adjustment coefficient is used to enhance the color contrast of the color channel with a larger edge level in the to-be-processed pixel; mapping the adjusted mapping matrix to the original image to obtain the corrected image, and the to-be-processed pixel can be corrected to adapt to the degree of bias towards the first color channel or the second color channel.
[0076] Exemplarily, if the first edge level is greater than or equal to the second edge level (i≥j), it indicates that the to-be-processed pixel represents more heavily the edge of the middle-layer thick blood vessels. At this time, the mapping matrix is adjusted based on the first edge level and the second edge level to enhance the color contrast corresponding to the first color channel; for this to-be-processed pixel, the first difference is calculated by subtracting j from i; for its corresponding mapping matrix, perform operations to make decrease , decrease , increase , increase , Reduce , Reduce , wherein are all preset parameters not less than 0.
[0077] If the first edge level is less than the second edge level (i < j), it indicates that the pixel to be processed is more inclined to represent the edge of superficial capillaries. At this time, based on the first edge level and the second edge level, the mapping matrix is adjusted to enhance the color contrast corresponding to the second color channel; for this pixel to be processed, the first difference is calculated by subtracting i from j; for its corresponding mapping matrix, make Increase , Increase , Increase , Increase , Reduce , Reduce , wherein are all preset parameters not less than 0.
[0078] Furthermore, when dividing the first edge level and the second edge level, the highest level and the lowest level in the first edge level and the second edge level respectively represent more inclined to represent the edge area or the non-edge area; for example, if the 0th edge level is defined as more inclined to represent the non-edge area during grading, and the ith or jth edge level is defined as more inclined to represent the edge area, such as when i = 1 and j = 0, even if i ≥ j, it indicates that this pixel point is more inclined to represent the edge of middle-layer thick blood vessels, but since the edge levels of i and j are very low, actually it is closer to representing the non-edge area; therefore, it is necessary to further add a non-edge area adjustment weight to such pixels.
[0079] Based on this, as an exemplary embodiment, after adjusting the parameters in the color mapping matrix corresponding to the pixel to be processed based on the grading adjustment coefficient, it includes: obtaining the sub-pixels to be processed in which both the first edge level and the second edge level are less than the preset level; calculating the second difference between the first edge level and the second edge level in the sub-pixels to be processed, and the second difference is a positive number; determining the averaging adjustment parameter of the sub-pixels to be processed based on the second difference; wherein, the averaging adjustment parameter is positively correlated with the second difference; performing an averaging adjustment on the parameters in the color mapping matrix corresponding to the sub-pixels to be processed based on the averaging adjustment parameter to obtain the adjusted mapping matrix; mapping the adjusted mapping matrix to the original image to obtain the corrected image.
[0080] In this embodiment, the sub-pixels to be processed in which both the first edge level and the second edge level are less than a preset level can represent the pixels close to representing the non-edge region; the preset level can be determined based on the number of levels of the edge level; in one embodiment, the preset edge level can be less than 10.
[0081] For the pixels to be processed that are close to representing the non-edge region, in order to further enhance their contrast with the pixels to be processed at the edge of the middle and deep mucosal blood vessels or the edge of the superficial blood vessels, the color of the pixels to be processed that are close to representing the non-edge region should be made lighter to highlight the edge region. Based on this, the averaging adjustment parameter of the sub-pixels to be processed is determined from the second difference; wherein, the averaging adjustment parameter is positively correlated with the second difference; the parameters in the color mapping matrix corresponding to the sub-pixels to be processed are averaged and adjusted based on the averaging adjustment parameter to obtain an adjusted mapping matrix; and the adjusted mapping matrix is mapped to the original image to obtain the corrected image.
[0082] In one embodiment, the averaging adjustment of the parameters in the color mapping matrix corresponding to the sub-pixels to be processed based on the averaging adjustment parameter can be achieved by reducing the maximum value and increasing the minimum value. Specifically, as a possible implementation, if the first edge level is greater than the second edge level, the second difference is calculated by i minus j; when determining the averaging adjustment parameter of the sub-pixels to be processed based on the second difference, if is the maximum value in
[0083] ;
[0084] If is the minimum value in
[0085] ;
[0086] If is the intermediate value in ;
[0087] If is the maximum value in
[0088] ;
[0089] If is the minimum value in
[0090] ;
[0091] If is the median value in ;
[0092] If is the maximum value in
[0093] ;
[0094] If is the minimum value in
[0095] ;
[0096] If is the median value of ;
[0097] If is the maximum value in
[0098] ;
[0099] If is the minimum value in
[0100] ;
[0101] If is the median value in ;
[0102] If is the maximum value in
[0103] ;
[0104] If is the minimum value in
[0105] ;
[0106] If is the median value in ;
[0107] If is the maximum value in
[0108] ;
[0109] If is the minimum value in, then
[0110] ;
[0111] If is the middle value in, then ;
[0112] wherein, i represents the first edge level, j represents the second edge level, and N represents the total number of levels of the first edge level or the second edge level, are all preset parameters not less than 0, are all preset parameters not less than 0.
[0113] If the second edge level is greater than the first edge level (j > i), calculate the second difference by subtracting i from j; when determining the averaging adjustment parameter of the sub-pixel to be processed based on the second difference
[0114] If is the maximum value in, then
[0115] ;
[0116] If is the minimum value in, then
[0117] ;
[0118] If is the middle value in, then ;
[0119] If is the maximum value in, then
[0120] ;
[0121] If is the minimum value in, then
[0122] ;
[0123] If is the middle value in, then ;
[0124] If is the maximum value in, then
[0125] ;
[0126] If is the minimum value in, then ;
[0127] If is the middle value in, then ;
[0128] If is the maximum value in, then
[0129] ;
[0130] If is the minimum value in, then
[0131] ;
[0132] If is the middle value in, then ;
[0133] If is the maximum value in, then
[0134] ;
[0135] If is the minimum value in, then
[0136] ;
[0137] If is the middle value in, then ;
[0138] If is the maximum value in, then
[0139] ;
[0140] If is the minimum value in, then
[0141] ;
[0142] If is the intermediate value among them, then ;
[0143] wherein, i represents the first edge level, j represents the second edge level, and N represents the total number of levels of the first edge level or the second edge level, are all preset parameters not less than 0, are all preset parameters not less than 0.
[0144] In order to make the images at the mapped edges and non-edges more smooth and fluent, it is necessary to perform neighborhood smoothing on the mapping matrix; based on this, as an exemplary embodiment, after mapping the adjusted mapping matrix to the original image, the method further includes: obtaining the mapping matrix corresponding to the neighborhood pixel points of the pixel to be processed within a preset smoothing radius as the neighborhood mapping matrix; determining the neighborhood smoothing weight based on the relative degree of the neighborhood pixel points and the pixel to be processed with respect to the preset smoothing radius; performing neighborhood smoothing on the adjusted mapping matrix based on the neighborhood mapping matrix and the correction weight.
[0145] Specifically, let the current pixel point The mapping matrix corresponding to it after being processed by the mapping matrix adjustment sub-unit is:
[0146]
[0147] Let its neighborhood smoothing radius be R, then the neighborhood pixel points of the pixel to be processed within the preset smoothing radius R The corresponding adjusted mapping matrix is:
[0148]
[0149] Perform neighborhood smoothing on each parameter of the mapping matrix respectively, taking as an example:
[0150]
[0151] The same applies to other parameters in the adjusted mapping matrix; apply the finally obtained corresponding mapping matrix to each pixel for mapping, then the output RGB value can be expressed as:
[0152]
[0153] An embodiment of the present invention further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus. The memory is used to store a computer program. The processor is used to execute the method in any of the above embodiments by running the computer program stored on the memory. In this embodiment, the electronic device may be a control module or a processor integrated in an endoscope, or may also be an external computer, a data processing device, or other electronic devices external to the endoscope.
[0154] Figure 2 is a structural block diagram of an optional electronic device according to an embodiment of the present application, as Figure 2 shown, including a processor 10, a communication interface 20, a memory 30, and a communication bus 40. Among them, the processor 10, the communication interface 20, and the memory 30 complete communication with each other through the communication bus 40, where
[0155] the memory 30 is used to store a computer program;
[0156] When the processor 10 is used to execute the computer program stored on the memory 30, it implements the endoscope image correction method in any of the above embodiments.
[0157] Optionally, in this embodiment, the above communication bus may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 2 only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.
[0158] The communication interface is used for communication between the above electronic device and other devices.
[0159] The memory may include a RAM, or may also include a non-volatile memory, for example, at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.
[0160] The above-mentioned processor may be a general-purpose processor, including but not limited to: CPU (Central Processing Unit, central processing unit), NP (Network Processor, network processor), etc.; it may also be a DSP (Digital Signal Processing, digital signal processor), ASIC (Application Specific Integrated Circuit, application-specific integrated circuit), FPGA (Field-Programmable Gate Array, field-programmable gate array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0161] Optionally, specific examples in this embodiment may refer to the examples described in the above embodiments, and will not be elaborated herein.
[0162] Those of ordinary skill in the art can understand that Figure 2 The structure shown is only schematic. The device for implementing the method of any one of the above embodiments may be a terminal device, which may be a smart phone (such as an Android phone, an IOS phone, etc.), a tablet computer, a palm computer, and a mobile Internet device (Mobile Internet Devices, MID), a PAD and other terminal devices. Figure 2 It does not limit the structure of the above-mentioned electronic device. For example, the terminal device may further include more or fewer components (such as a network interface, a display device, etc.) than those shown in Figure 2 or have a different configuration from that shown in Figure 2 Those shown.
[0163] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the relevant hardware of the terminal device through a program, and the program can be stored in a computer-readable storage medium. The storage medium may include: a flash drive, a ROM, a RAM, a magnetic disk or an optical disc, etc.
[0164] The serial numbers of the embodiments of the present application above are only for description and do not represent the advantages and disadvantages of the embodiments.
[0165] If the integrated unit in the above embodiments is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in the above computer-readable storage medium. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing one or more computer devices (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in the above embodiments.
[0166] In several embodiments provided by this application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of units or modules can be in an electrical or other form.
[0167] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution provided in this embodiment.
[0168] In addition, in each embodiment of this application, the functional units can be integrated in a processing unit, or each unit exists physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0169] In the above embodiments of this application, the descriptions of each embodiment have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0170] The above are only the preferred embodiments of this application. It should be noted that for those of ordinary skill in the art, without departing from the principle of this application, several improvements and refinements can still be made, and these improvements and refinements should also be regarded as the protection scope of this application.
Claims
1. An endoscopic image correction method, characterized in that: include: Acquire an original image captured by an imaging unit, wherein the original image includes a first color channel for representing a characteristic of a first human tissue and a second color channel for representing a characteristic of a second human tissue; Marking the pixels in the original image with edge attributes according to the first color channel and the second color channel respectively to obtain a plurality of pixels to be processed with edge attribute marks, including: performing edge classification and edge intensity classification on the pixels in the original image according to the edge attribute of the first color channel and the edge attribute of the second color channel respectively to obtain edge pixels and non-edge pixels and pixels to be processed with a first edge grade mark corresponding to the first color channel and a second edge grade mark corresponding to the second color channel, wherein the edge pixels include pixels with a first type of edge attribute mark corresponding to the first color channel and a second type of edge attribute mark corresponding to the second color channel; Performing color contrast correction on the pixels to be processed according to the edge attribute mark corresponding to each pixel to be processed and the relationship between the edge attribute marks to obtain a corrected image, wherein the pixels to be processed are adjusted by processing the mapping matrix of each pixel to be processed during the color contrast correction to achieve correction of the degree of deviation of the pixels to be processed that is adapted to the first color channel or the second color channel; The step of performing color contrast correction on the pixel to be processed according to the edge attribute mark corresponding to each pixel to be processed and the relationship between the edge attribute marks to obtain a corrected image comprises: Calculate a first difference between a first edge level and a second edge level of the pixel to be processed, wherein the first difference is a positive number; Determining a grading adjustment coefficient of the pixel to be processed based on the first difference, wherein a value of the grading adjustment coefficient is positively correlated with the first difference; Adjusting the parameters in the color mapping matrix corresponding to the pixel to be processed based on the grading adjustment coefficient to obtain an adjusted mapping matrix, wherein the grading adjustment coefficient is used to enhance the color contrast of the color channel with a larger edge level in the pixel to be processed; The adjusted mapping matrix is mapped to the original image to obtain the corrected image.
2. The endoscopic image correction method according to claim 1, characterized in that: The step of marking the pixels in the original image with edge attributes according to the first color channel and the second color channel to obtain a plurality of pixels to be processed with edge attribute marks comprises: Perform edge classification on pixels in the original image according to the first color channel and the second color channel using an edge classification algorithm to obtain edge pixels and non-edge pixels; The edge pixels include pixels having a first type of edge attribute mark corresponding to a first color channel and pixels having a second type of edge attribute mark corresponding to a second color channel.
3. The endoscopic image correction method according to claim 2, characterized in that: The step of performing color contrast correction on the pixel to be processed according to the edge attribute mark corresponding to each pixel to be processed and the relationship between the edge attribute marks to obtain a corrected image comprises: Acquire the edge pixel from the pixels to be processed; Determine whether the edge attribute mark of the edge pixel is one of the first edge attribute and the second edge attribute; If the edge pixel has only the first type of edge attribute, adjusting the parameters in the mapping matrix corresponding to the edge pixel by a first preset adjustment coefficient to obtain an adjusted mapping matrix, wherein the first preset adjustment coefficient is used to enhance the color contrast corresponding to the first color channel in the edge pixel; If the edge pixel has only the second type of edge attribute, adjusting the parameters in the mapping matrix corresponding to the edge pixel by a second preset adjustment coefficient to obtain an adjusted mapping matrix, wherein the second preset adjustment coefficient is used to enhance the color contrast corresponding to the second color channel in the edge pixel; The adjusted mapping matrix is mapped to the original image to obtain the corrected image.
4. The endoscopic image correction method according to claim 3, characterized in that: The step of performing color contrast correction on the pixel to be processed according to the edge attribute mark corresponding to each pixel to be processed and the relationship between the edge attribute marks to obtain a corrected image further comprises: Acquire non-edge pixels from the pixels to be processed; Average adjustment is performed on the parameters in the color mapping matrix corresponding to the non-edge pixels to obtain the adjusted mapping matrix; The adjusted mapping matrix is mapped to the original image to obtain the corrected image.
5. The endoscopic image correction method according to any one of claims 1 or 2, characterized in that: The step of marking the pixels in the original image with edge attributes according to the first color channel and the second color channel to obtain a plurality of pixels to be processed with edge attribute marks comprises: Respectively calculating the edge intensity of pixels having the first color channel and the edge intensity of pixels having the second color channel in the original image; Based on the edge intensity, edge grade classification is performed on the pixels of the first color channel and the pixels of the second color channel respectively, so as to obtain pixels to be processed having a first edge grade mark corresponding to the first color channel and a second edge grade mark corresponding to the second color channel respectively.
6. The endoscopic image correction method according to claim 1, characterized in that: The step of adjusting the parameters in the color mapping matrix corresponding to the pixel to be processed based on the hierarchical adjustment coefficient comprises: Acquire a sub-pixel to be processed whose first edge level and second edge level are both smaller than a preset level in the pixel to be processed; Calculating a second difference between the first edge level and the second edge level in the sub-pixel to be processed, where the second difference is a positive number; Determining an averaging adjustment parameter of the sub-pixel to be processed based on the second difference; wherein the averaging adjustment parameter is positively correlated with the second difference; Based on the averaging adjustment parameter, the parameters in the color mapping matrix corresponding to the sub-pixel to be processed are averaged to obtain an adjusted mapping matrix; The adjusted mapping matrix is mapped to the original image to obtain the corrected image.
7. The endoscopic image correction method according to claim 1, characterized in that: After performing color contrast correction on the pixels to be processed according to the edge attribute mark corresponding to each pixel to be processed and the relationship between the edge attribute marks, the method further includes: Obtaining a mapping matrix corresponding to neighboring pixel points of the pixel to be processed within a preset smoothing radius as a neighborhood mapping matrix; Determining a neighborhood smoothing weight based on the relative degree of the neighborhood pixel point and the pixel to be processed relative to the preset smoothing radius; The adjusted mapping matrix is subjected to neighborhood smoothing correction based on the neighborhood mapping matrix and the correction weight.
8. The endoscopic image correction method according to claim 1, characterized in that: The first color channel in the original image is formed based on a narrow-band blue-violet light source and a narrow-band blue light source of an illumination unit of the endoscope, and the second color channel is formed based on a narrow-band green light source of the illumination unit; The central wavelength of the narrow-band blue-violet light source is 415±10nm; The central wavelength of the narrow-band blue light source is 457±10nm; The central wavelength of the narrow-band green light source is 540±15 nm.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the endoscopic image correction method according to any one of claims 1 to 8 by executing the computer instructions.
Citation Information
Patent Citations
Image processing apparatus and method for endoscope, electronic device, and storage medium
CN115731205A
Endoscopic image edge sharpness enhancement method and device, electronic equipment and storage medium
CN116245770A
Image-based scleral jaundice analysis method and system
CN118411364A