A single-channel filtering demosaicing method and system for endoscope images

By using a single-channel filtering method, local gradient adaptive interpolation and bilateral filtering are employed to reconstruct endoscopic images, solving the problems of noise and artifacts, and achieving efficient image clarity and color restoration, which is suitable for real-time imaging of electronic endoscopes.

CN121616451BActive Publication Date: 2026-04-17XIAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XIAN UNIV OF TECH
Filing Date
2026-02-03
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing endoscopic images suffer from severe noise problems under high-contrast conditions. Traditional demosaic methods are prone to producing false colors and jagged artifacts at edges and in high-frequency regions, and have high computational complexity, making them difficult to meet the needs of real-time applications.

Method used

A single-channel filtering de-mosaic method is adopted. By calculating the local gradient strength of green pixels and adaptive interpolation, combined with bilateral filtering and residual interpolation, the red and blue channels are reconstructed, reducing computational complexity and suppressing noise.

Benefits of technology

It effectively suppresses false colors and noise amplification, improves the edge sharpness and color reproduction accuracy of the image, and reduces computational complexity, making it suitable for the real-time imaging needs of electronic endoscopes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121616451B_ABST
    Figure CN121616451B_ABST
Patent Text Reader

Abstract

The present application relates to the field of endoscope imaging, in particular to a single-channel filtering demosaicing method and system for endoscope images; the horizontal direction local gradient intensity and the vertical direction local gradient intensity of green pixels in a color filter array image are calculated, the green pixels are adaptively interpolated according to the difference between the horizontal direction local gradient intensity and the vertical direction local gradient intensity, and an initial green channel is obtained; the pixels in the initial green channel are subjected to bilateral filtering, and a filtered green channel is obtained; based on the filtered green channel, residual interpolation is used to respectively reconstruct a red channel and a blue channel, and a demosaiced image is obtained; the present application reduces the risk of false color and noise amplification, has the characteristics of strong edge preservation ability, high overall color restoration precision, simple algorithm and easy hardware implementation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of endoscopic imaging, and more specifically to a method and system for de-mosaicing endoscopic images using single-channel filtering. Background Technology

[0002] Today, most electronic endoscopes employ a small-aperture, wide-angle objective lens group at the tip, balancing a large field of view with close-range imaging. By fixing the focal length or using simple mechanical focusing, the examined tissue is imaged onto a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor located immediately behind it. CMOS pixels are typically covered by a color filter array (CFA) in the optical path, often arranged in a Bayer format, with a 2×2 pixel periodic unit. The green filter is located diagonally across the matrix, with the other two being red and blue filters, respectively. Because the human eye is more sensitive to green information, the sampling rate of the green channel is usually twice that of the red and blue channels. Therefore, each pixel contains only one type of R (Red) / G (Green) / B (Blue) component information.

[0003] In high-contrast medical imaging scenarios, the dynamic range of small sensors is limited, making it difficult to simultaneously preserve details in both highlight and shadow areas. The system often requires additional local digital gain for compensation. Furthermore, analog signals introduce various noise sources during transmission, such as fixed-pattern noise and readout noise. The combination of these factors results in generally severe noise problems in processed endoscopic images.

[0004] De-mosaicing is the process of interpolating and reconstructing CFA images. One commonly used method is bilinear interpolation, which is a color difference interpolation algorithm that selects pixels of the same color from a 5×5 neighborhood around a single pixel for weighted interpolation. This method is simple to implement and has low computational cost, but because it does not fully consider the correlation between RGB channels, it is prone to producing obvious false colors and jagged artifacts at image edges and in high-frequency texture areas.

[0005] Another type of method is the residual interpolation algorithm. For example, when reconstructing the R component, the green component in the 5×5 neighborhood is first interpolated to obtain a preliminary estimate. Then, the difference between the estimated value and the observed R component is calculated, and the residual is interpolated. Finally, the preliminary estimate and the interpolated residual are added together to obtain the reconstructed R component. The other color channels are treated similarly. This type of method can improve the smoothness and visual quality of the reconstructed image to a certain extent, but the algorithm structure is relatively complex and the computation is large, making it difficult to meet the real-time application requirements of resource-constrained platforms. Summary of the Invention

[0006] To address the problems mentioned in the prior art, this invention proposes a single-channel filtering demosaic method and system for endoscopic images. While ensuring image smoothness and suppressing noise, it significantly reduces the overall computational complexity, making it more suitable for practical application in electronic endoscopic imaging systems.

[0007] To achieve the above objectives, the present invention adopts the following technical solution:

[0008] This invention proposes a single-channel filtering de-mosaic method for endoscopic images, comprising the following steps:

[0009] S1. Obtain the color filter array image of the endoscope, calculate the horizontal and vertical local gradient intensities of the green pixels in the color filter array image, and perform adaptive interpolation on the green pixels based on the difference between the horizontal and vertical local gradient intensities to obtain the initial green channel.

[0010] S2. Perform bilateral filtering on the pixels in the initial green channel to obtain the pixels in the filtered green channel;

[0011] S3. Based on the pixels of the filtered green channel, the red channel and blue channel are reconstructed respectively using the residual interpolation method. The residual interpolation method includes establishing a linear model of the pixels of the target color channel and the filtered green channel in the local neighborhood, and using the linear model to calculate the estimated value of the target color channel.

[0012] The residual between the actual observed pixel value of the target color channel and the estimated value of the target color channel in the color filter array image is calculated to obtain the residual of the target color channel; the residual of the target color channel is corrected by weighted interpolation to complete the reconstruction of the target color channel.

[0013] S4. Combine the filtered green channel, the reconstructed red channel, and the reconstructed blue channel to obtain the de-mosaic image.

[0014] As a further improvement of the present invention, the calculation of the horizontal and vertical local gradient intensities of green pixels in the color filter array image in step S1 includes:

[0015] Calculated based on a 5×5 local neighborhood, the pixels within the 5×5 local neighborhood are denoted as... ,in ,in Represents the 5×5 local neighborhood of the th OK, Represents the 5×5 local neighborhood of the th The column is obtained by calculation using the following formula:

[0016]

[0017]

[0018] In the formula: Indicates the local gradient intensity in the horizontal direction; This represents the local gradient intensity in the vertical direction.

[0019] As a further improvement of the present invention, step S1 involves adaptively interpolating the green pixels based on the difference between the local gradient intensity in the horizontal direction and the local gradient intensity in the vertical direction to obtain an initial green channel, including:

[0020] when At that time, interpolation is performed along the horizontal direction to obtain the first interpolation result;

[0021] when At that time, interpolation is performed along the vertical direction to obtain the second interpolation result;

[0022] when At that time, interpolation is performed along the horizontal and vertical directions to obtain a third interpolation result;

[0023] when Gradient interpolation is not performed at this time;

[0024] The first, second, or third interpolation results are normalized to obtain the initial green channel.

[0025] As a further improvement of the present invention, step S2 involves performing bilateral filtering on the pixels in the initial green channel to obtain the filtered pixels in the green channel, including:

[0026] The filtered green channel pixels are obtained by normalizing the product of spatial weights and color weights; wherein, the spatial weights are calculated using a Gaussian function based on the Euclidean distance between pixels, and the color weights are calculated using a Gaussian function based on the intensity differences between pixels.

[0027] As a further improvement of the present invention, the formula for calculating the pixels of the filtered green channel is as follows:

[0028]

[0029] In the formula: Represents the pixels in the green channel after filtering; Represents the normalization coefficient; Indicates rows within the neighborhood; Indicates columns within a neighborhood; This represents the pixels within a 5×5 neighborhood surrounding the initial green channel pixel; Indicates the standard deviation of spatial weights; Indicates the standard deviation of color weights; This represents the center pixel within the initial 5×5 local neighborhood of the green channel.

[0030] As a further improvement of the present invention, the residual interpolation method in S3 includes establishing a linear model of the pixels of the target color channel and the filtered green channel in the local neighborhood, and using the linear model to calculate the estimated value of the target color channel:

[0031] The local neighborhood is 5×5. It is assumed that the estimated value of the target color channel and the pixels of the filtered green channel in the 5×5 local neighborhood satisfy the following linear relationship:

[0032]

[0033] In the formula: This is an estimate of the target color channel. , Indicates the red channel. Indicates the blue channel; These are the pixel values ​​of the green channel after filtering; For local neighborhood; and The parameter is linear; Represents the 5×5 local neighborhood of the th Okay, and ; Represents the 5×5 local neighborhood of the th column, and .

[0034] As a further improvement of the present invention, in step S3, the residual between the actual observed pixel value of the target color channel in the color filter array image and the estimated value of the target color channel is calculated to obtain the residual of the target color channel; the residual of the target color channel is then corrected by weighted interpolation to complete the reconstruction of the target color channel, including:

[0035] The residual of the target color channel is defined as:

[0036]

[0037] In the formula: This represents the position of the target color channel actually observed in the local neighborhood. This represents the pixel value of the target's color channel as actually observed in the local neighborhood; Represents the 5×5 local neighborhood of the th Okay, number The residuals of the target color channels;

[0038] The residuals of the target color channel are corrected by weighted interpolation, as shown in the following expression:

[0039]

[0040] In the formula: For the 5×5 local neighborhood, the first Okay, number Interpolation weights of columns; The target color channel residual after weighted interpolation correction;

[0041] The expression for reconstructing the target color channel is as follows:

[0042]

[0043] In the formula: The number of pixels in the target color channel.

[0044] This invention proposes a single-channel filtering demosaic system for endoscopic images to implement the aforementioned method, comprising:

[0045] The interpolation module is used to acquire the color filter array image of the endoscope, calculate the horizontal and vertical local gradient intensities of the green pixels in the color filter array image, and perform adaptive interpolation on the green pixels based on the difference between the horizontal and vertical local gradient intensities to obtain the initial green channel.

[0046] The filtering module is used to perform bilateral filtering on the pixels in the initial green channel to obtain the filtered pixels in the green channel.

[0047] The reconstruction module is used to reconstruct the red and blue channels based on the pixels of the filtered green channel using residual interpolation. The residual interpolation method includes establishing a linear model of the pixels of the target color channel and the filtered green channel in the local neighborhood, and using the linear model to calculate the estimated value of the target color channel.

[0048] The residual between the actual observed pixel value of the target color channel and the estimated value of the target color channel in the color filter array image is calculated to obtain the residual of the target color channel; the residual of the target color channel is corrected by weighted interpolation to complete the reconstruction of the target color channel.

[0049] The output module combines the filtered green channel, the reconstructed red channel, and the reconstructed blue channel to obtain a de-mosaic image.

[0050] This invention proposes a single-channel filtering de-mosaic device for endoscopic images, comprising a processor and a memory, wherein the processor executes a computer program stored in the memory to implement the single-channel filtering de-mosaic method for endoscopic images as described above.

[0051] This invention proposes a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the single-channel filtering de-mosaic method for endoscopic images as described above.

[0052] Compared with the prior art, the present invention achieves the following technical effects:

[0053] This invention reduces the risk of false colors and noise amplification, and features strong edge preservation capabilities, high overall color restoration accuracy, and a simple algorithm that is easy to implement in hardware. By utilizing gradient interpolation, bilateral filtering, and residual optimization, this invention leverages the noise characteristics of endoscopic CMOS sensors under low illumination and high contrast conditions to suppress noise during the interpolation stage. This effectively avoids the problems of false color amplification and detail loss caused by de-mosaicing followed by noise reduction, thus improving the overall signal-to-noise ratio of endoscopic images. Furthermore, by calculating the local gradient intensity in the horizontal and vertical directions within a 5×5 neighborhood, this invention adaptively selects the interpolation direction, prioritizing interpolation along the direction with the smaller gradient in texture edge regions. This significantly reduces false colors, jagged edges, and other artifacts generated by traditional bilinear methods in edge and high-frequency regions, resulting in clearer and more continuous tissue structure edges.

[0054] This invention introduces bilateral filtering into the pixels in the initial green channel. By using the joint weights of the spatial and intensity domains, it effectively suppresses random noise in smooth and uniform regions, while reducing the filtering weights in edge and detail regions. This achieves a trade-off between noise suppression and detail preservation, thereby improving the subjective visual quality and objective evaluation indicators of endoscopic images.

[0055] This invention reconstructs the red and blue channels using the relationship of a linear model and residual interpolation. First, it uses the pixels of the filtered green channel to make a coarse estimate of the red and blue channels. Then, it performs weighted interpolation correction on the residual of the target color channel. The residual signal energy of the target color channel is small and changes slowly. By using a low-complexity weighted average, color consistency and detail performance can be improved, thus improving the overall color reproduction accuracy.

[0056] The algorithm of this invention is simple, has low computational complexity, and is easy to implement in hardware. It uses gradient calculation and interpolation kernel consisting of addition, subtraction and shift operations. Bilateral filtering uses pre-stored spatial kernel and lookup table to realize intensity weights. Residual interpolation only involves local linear fitting and weighted averaging. The whole does not involve large-scale matrix solving or complex iterative optimization. It has low computational complexity and small resource consumption, and is suitable for implementation in dedicated image processing chips. It can meet the real-time imaging requirements of electronic endoscopes of 25 to 60 frames per second. Attached Figure Description

[0057] Figure 1 This is a schematic diagram of the method flow of the present invention. Detailed Implementation

[0058] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.

[0059] See Figure 1 This embodiment provides a single-channel filtering de-mosaic method for endoscopic images, including the following steps:

[0060] S1. Obtain the color filter array image of the endoscope, calculate the horizontal and vertical local gradient intensities of the green pixels in the color filter array image, and perform adaptive interpolation on the green pixels based on the difference between the horizontal and vertical local gradient intensities to obtain the initial green channel.

[0061] S2. Perform bilateral filtering on the pixels in the initial green channel to obtain the pixels in the filtered green channel;

[0062] S3. Based on the pixels of the filtered green channel, the red channel and blue channel are reconstructed respectively using the residual interpolation method. The residual interpolation method includes establishing a linear model of the pixels of the target color channel and the filtered green channel in the local neighborhood, and using the linear model to calculate the estimated value of the target color channel.

[0063] The residual between the actual observed pixel value of the target color channel and the estimated value of the target color channel in the color filter array image is calculated to obtain the residual of the target color channel; the residual of the target color channel is corrected by weighted interpolation to complete the reconstruction of the target color channel.

[0064] S4. Combine the filtered green channel, the reconstructed red channel, and the reconstructed blue channel to obtain the de-mosaic image.

[0065] The present invention will be further explained below with reference to the accompanying drawings and specific embodiments:

[0066] Step 1: Example The color filter array image acquired by the endoscope. For green pixels in the color filter array image, the horizontal and vertical local gradient intensities are estimated based on a 5×5 local neighborhood. The pixels within the 5×5 neighborhood are denoted as... , ,in Represents the 5×5 local neighborhood of the th OK, Represents the 5×5 local neighborhood of the th The column is obtained through the following formula:

[0067]

[0068]

[0069] In the formula: Indicates the local gradient intensity in the horizontal direction; Represents the local gradient intensity in the vertical direction

[0070] according to and The initial value of the green channel is estimated using interpolation filters in different directions based on the magnitude relationship. :

[0071] When the horizontal texture is weak ( When interpolating along the horizontal direction, the first interpolation result is obtained. :

[0072]

[0073] When the vertical texture is weak ( When interpolating along the vertical direction, a second interpolation result is obtained. :

[0074]

[0075] When the horizontal and vertical textures are close ( Interpolation is performed along the horizontal and vertical directions to obtain a third interpolation result. :

[0076]

[0077] When the texture differs greatly between the horizontal and vertical directions ( Gradient interpolation is not performed:

[0078]

[0079] The above results were normalized to obtain the initial green channel. :

[0080]

[0081] Step 2: Apply bilateral filtering to the pixels in the initial green channel for noise reduction and smoothing, in order to suppress random noise while preserving edge details.

[0082] Spatial weights are calculated based on the Euclidean distance between the center pixel and its neighboring pixels in the initial green channel:

[0083] The formula for calculating the square of the geometric distance is as follows:

[0084]

[0085] In the formula: This represents the square of the geometric distance between the center pixel and its neighboring pixels; Indicates rows within the neighborhood; Indicates columns within a neighborhood, where , Indicates a local neighborhood; This represents the center pixel within a 5×5 local neighborhood of the initial green channel; This represents the pixels within a 5×5 local neighborhood surrounding the initial green channel pixel.

[0086] Therefore, spatial weight The calculation formula is as follows:

[0087]

[0088] In the formula: This represents the standard deviation of spatial weights.

[0089] Combining the two equations above, we get:

[0090]

[0091] The color weight is calculated based on the intensity difference between the center pixel and its neighboring pixels in the initial green channel:

[0092] The formula for calculating the intensity difference is as follows:

[0093]

[0094] In the formula: This represents the pixels within a 5×5 local neighborhood surrounding the initial green channel pixel; Represents the neighborhood residual matrix; This represents the center pixel within the initial 5×5 local neighborhood of the green channel.

[0095] Therefore, color weight The calculation formula is as follows:

[0096]

[0097] In the formula: This represents the standard deviation of color weights.

[0098] Combining the two equations above, we get:

[0099]

[0100] The product of the spatial weights and color weights is normalized to obtain the filtered green channel, as shown in the following formula:

[0101]

[0102] In the formula: Represents the pixels in the green channel after filtering; Represents the normalization coefficient; Indicates rows within the neighborhood; Indicates columns within a neighborhood; This represents the pixels within a 5×5 local neighborhood surrounding the initial green channel pixel; Indicates the standard deviation of spatial weights; Indicates the standard deviation of color weights; This represents the center pixel within the initial 5×5 local neighborhood of the green channel.

[0103] The normalization coefficient is:

[0104]

[0105] Step 3: In this embodiment, the red and blue channels are reconstructed using residual interpolation. The following is the entire process:

[0106] Assume that within a 5×5 local neighborhood, the estimated value of the target color channel and the pixel value of the filtered green channel satisfy the following linear relationship:

[0107]

[0108] In the formula: This is an estimate of the target color channel. , Indicates the red channel. Indicates the blue channel; These are the pixel values ​​of the green channel after filtering; For local neighborhood; and The parameter is linear; Represents the 5×5 local neighborhood of the th OK; Represents the 5×5 local neighborhood of the th List.

[0109] This embodiment estimates using the least squares method. and Its expression is as follows:

[0110]

[0111] In the formula: This represents the actual location of the target color channel within the local neighborhood. This represents the pixel value of the target's color channel as actually observed in the local neighborhood; arg represents the estimated value of the target color channel; min represents the independent variable; min represents minimization.

[0112] In this embodiment, the residual of the target color channel is defined as:

[0113]

[0114] In the formula: This represents the position of the target color channel actually observed in the local neighborhood. This represents the pixel value of the target's color channel as actually observed in the local neighborhood; Represents the 5×5 local neighborhood of the th Okay, number The residuals of the target color channels.

[0115] The residuals of the target color channel are corrected by weighted interpolation, as shown in the following expression:

[0116]

[0117] In the formula: For the 5×5 local neighborhood, the first Okay, number Interpolation weights of columns; The target color channel residual after weighted interpolation correction;

[0118] The expression for reconstructing the target color channel is as follows:

[0119]

[0120] In the formula: C represents the number of pixels in the target color channel.

[0121] By sliding a window across the color filter array image and repeating the above steps, the red channel can be reconstructed. In this embodiment, the processing of the blue and red channels is the same. The blue channel is reconstructed by calculating according to the same process. The filtered green channel, the reconstructed red channel, and the reconstructed blue channel are then combined to obtain a complete de-mosaic image.

[0122] Based on the same inventive concept, this embodiment of the invention also provides a single-channel filtering de-mosaic system for endoscopic images. Since the principle of this single-channel filtering de-mosaic system for endoscopic images is similar to the aforementioned single-channel filtering de-mosaic method for endoscopic images, the implementation of this single-channel filtering de-mosaic system for endoscopic images can refer to the implementation of the single-channel filtering de-mosaic method for endoscopic images, and the repeated parts will not be described again.

[0123] In specific implementation, the single-channel filtering demosaic system for endoscopic images provided in this embodiment of the invention specifically includes:

[0124] The interpolation module is used to acquire the color filter array image of the endoscope, calculate the horizontal and vertical local gradient intensities of the green pixels in the color filter array image, and perform adaptive interpolation on the green pixels based on the difference between the horizontal and vertical local gradient intensities to obtain the initial green channel.

[0125] The filtering module is used to perform bilateral filtering on the pixels in the initial green channel to obtain the filtered pixels in the green channel.

[0126] The reconstruction module is used to reconstruct the red and blue channels based on the pixels of the filtered green channel using residual interpolation. The residual interpolation method includes establishing a linear model of the target color channel and the pixels of the filtered green channel within a local neighborhood, calculating an estimate of the target color channel using the linear model, calculating the residual between the actual observed pixel value of the target color channel in the color-filtered array image and the estimated value of the target color channel, obtaining the residual of the target color channel, and performing weighted interpolation correction on the residual of the target color channel to complete the reconstruction of the target color channel.

[0127] The output module combines the filtered green channel, the reconstructed red channel, and the reconstructed blue channel to obtain a de-mosaic image.

[0128] Accordingly, embodiments of the present invention also provide a single-channel filtering de-mosaic device for endoscopic images, including a processor and a memory, wherein the processor executes a computer program stored in the memory to implement the single-channel filtering de-mosaic method for endoscopic images as provided in embodiments of the present invention.

[0129] For more detailed information on the above methods, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.

[0130] Accordingly, embodiments of the present invention also provide a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the single-channel filtering de-mosaic method for endoscopic images as described above in embodiments of the present invention.

[0131] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems, devices, and storage media disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple; relevant parts can be referred to the method section.

[0132] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0133] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0134] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0135] The foregoing has provided a detailed description of the method, system, device, and storage medium for single-channel filtering of endoscopic images for demosaic purposes provided by this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this invention. Therefore, the content of this specification should not be construed as a limitation of this invention.

Claims

1. A method for de-mosaicing endoscopic images using single-channel filtering, characterized in that, Includes the following steps: S1. Acquire the color filter array image of the endoscope, calculate the horizontal and vertical local gradient intensities of the green pixels in the color filter array image, and perform adaptive interpolation on the green pixels based on the difference between the horizontal and vertical local gradient intensities to obtain the initial green channel; including: when At that time, interpolation is performed along the horizontal direction to obtain the first interpolation result; when At that time, interpolation is performed along the vertical direction to obtain the second interpolation result; when At that time, interpolation is performed along the horizontal and vertical directions to obtain a third interpolation result; When no gradient interpolation is performed; In the formulae: represents the horizontal direction local gradient intensity; represents the vertical direction local gradient intensity; Normalize the first, second, or third interpolation results; S2. Perform bilateral filtering on the pixels in the initial green channel to obtain the pixels in the filtered green channel; S3. Based on the pixels of the filtered green channel, the red channel and blue channel are reconstructed respectively using the residual interpolation method. The residual interpolation method includes establishing a linear model of the pixels of the target color channel and the filtered green channel in the local neighborhood, and using the linear model to calculate the estimated value of the target color channel. The residual between the actual observed pixel value of the target color channel and the estimated value of the target color channel in the color filter array image is calculated to obtain the residual of the target color channel; the residual of the target color channel is corrected by weighted interpolation to complete the reconstruction of the target color channel. S4. Combine the filtered green channel, the reconstructed red channel, and the reconstructed blue channel to obtain the de-mosaic image.

2. The method of claim 1, wherein, The calculation of the horizontal and vertical local gradient intensities of green pixels in the color filter array image in step S1 includes: Calculated based on a 5×5 local neighborhood, the pixels within the 5×5 local neighborhood are denoted as... ,in ,in Represents the 5×5 local neighborhood. OK, Represents the 5×5 local neighborhood. The column is obtained by calculation using the following formula: 。 3. The method of claim 1, wherein, In step S2, bilateral filtering is performed on the pixels in the initial green channel to obtain the filtered green channel pixels, including: The filtered green channel pixels are obtained by normalizing the product of spatial weights and color weights; wherein, the spatial weights are calculated using a Gaussian function based on the Euclidean distance between pixels, and the color weights are calculated using a Gaussian function based on the intensity differences between pixels.

4. The method for de-mosaicing of endoscopic images using single-channel filtering according to claim 3, characterized in that, The formula for calculating the pixels of the filtered green channel is as follows: In the formula: Represents the pixels in the green channel after filtering; Represents the normalization coefficient; Indicates rows within the neighborhood; Indicates columns within a neighborhood; This represents the pixels within a 5×5 local neighborhood surrounding the initial green channel pixel; Indicates the standard deviation of spatial weights; Indicates the standard deviation of color weights; This represents the center pixel within the initial 5×5 local neighborhood of the green channel.

5. The method of claim 1, wherein, The residual interpolation method in S3 includes establishing a linear model of the pixels of the target color channel and the filtered green channel in the local neighborhood, and using the linear model to calculate the estimated value of the target color channel: The local neighborhood is 5×5. It is assumed that the estimated value of the target color channel and the pixels of the filtered green channel in the 5×5 local neighborhood satisfy the following linear relationship: In the formula: This is an estimate of the target color channel. , Indicates the red channel. Indicates the blue channel; These are the pixel values ​​of the green channel after filtering; For local neighborhood; and The parameter is linear; Represents the 5×5 local neighborhood. Okay, and ; Represents the 5×5 local neighborhood. column, and .

6. The method of claim 5, wherein, In step S3, the residual between the actual observed pixel value of the target color channel in the color filter array image and the estimated value of the target color channel is calculated to obtain the residual of the target color channel; weighted interpolation correction is performed on the residual of the target color channel to complete the reconstruction of the target color channel, including: The residual of the target color channel is defined as: In the formula: This represents the position of the target color channel actually observed in the local neighborhood. This represents the pixel value of the target's color channel as actually observed in the local neighborhood; Represents the 5×5 local neighborhood of the th Okay, number The residuals of the target color channels; The residuals of the target color channel are corrected by weighted interpolation, as shown in the following expression: In the formula: For the 5×5 local neighborhood, the first Okay, number Interpolation weights of columns; The residual of the target color channel after weighted interpolation correction; The expression for reconstructing the target color channel is as follows: In the formulae: is a pixel of the target color channel.

7. A single-pass filtered demosaicing system for endoscope images for implementing the method of any one of the preceding claims 1 to 6, characterized in that, include: The interpolation module is used to acquire the color filter array image of the endoscope, calculate the horizontal and vertical local gradient intensities of the green pixels in the color filter array image, and adaptively interpolate the green pixels based on the difference between the horizontal and vertical local gradient intensities to obtain the initial green channel; including: when At that time, interpolation is performed along the horizontal direction to obtain the first interpolation result; When a second interpolation result is obtained by interpolating in the vertical direction. When a third interpolation result is obtained by interpolating in the horizontal direction and the vertical direction. When no gradient interpolation is performed; In the formulae: denotes the horizontal local gradient strength; denotes the vertical local gradient strength; Normalize the first, second, or third interpolation results; The filtering module is used to perform bilateral filtering on the pixels in the initial green channel to obtain the filtered pixels in the green channel. The reconstruction module is used to reconstruct the red and blue channels based on the pixels of the filtered green channel using residual interpolation. The residual interpolation method includes establishing a linear model of the target color channel and the pixels of the filtered green channel in the local neighborhood, calculating the estimated value of the target color channel using the linear model, calculating the residual between the actual observed pixel value of the target color channel in the color filtered array image and the estimated value of the target color channel, obtaining the residual of the target color channel, and performing weighted interpolation correction on the residual of the target color channel to complete the reconstruction of the target color channel. The output module combines the filtered green channel, the reconstructed red channel, and the reconstructed blue channel to obtain a de-mosaic image.

8. A single-pass filtered demosaicing device for endoscopic images, characterized in that, It includes a processor and a memory, wherein the processor, when executing a computer program stored in the memory, implements the single-channel filtering demosaic method for endoscopic images as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, Used to store a computer program, wherein the computer program, when executed by a processor, implements the single-channel filtering de-mosaic method for endoscopic images as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Directional weighted interpolation-based CFA (color filter array) image demosaicing method

    CN108171668A

  • Image processing method and device and readable storage medium

    CN114331836A