A Bayer image quality enhancement method

By improving the contrast of Bayer images through matrix template scanning and filtering algorithms, and combining it with temporal noise reduction processing, the problems of image detail loss caused by noise suppression and insufficient temporal noise processing in traditional methods are solved, thus achieving a comprehensive improvement in image quality.

CN115689936BActive Publication Date: 2025-10-31QINGDAO NOVELBEAM TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211404734.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-10
Publication Date
2025-10-31
Estimated Expiration
2042-11-10

AI Technical Summary

Technical Problem

Traditional methods, when processing Bayer images, suffer from noise suppression that leads to loss of image details and cannot effectively handle temporal noise, resulting in only moderate improvement in image quality.

Method used

A matrix template is used to scan Bayer images. Median filtering, mean filtering, OTSU algorithm and contrast enhancement algorithm are combined. By judging the difference and calculating the filtering parameters, and combining the registration frame, temporal noise reduction is performed to improve image contrast and remove spatial and temporal noise.

Benefits of technology

It effectively enhances Bayer image contrast, maintains image detail, removes noise, and is suitable for higher-level image processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115689936B_ABST
    Figure CN115689936B_ABST
Patent Text Reader

Abstract

This invention relates to a Bayer image quality enhancement method, belonging to the field of image processing. It includes the following steps: (1) Scanning the Bayer image using matrix template A to obtain the center pixel P. A (2) For P A Perform median filtering to obtain P m (3)P A The result P is obtained by mean filtering. V (4)P A With P V Take the difference and take the absolute value △ V (5) Calculate the filter parameter T using the OTSU algorithm. V (6)△ V With T V Make a judgment and select the filtering result P based on the judgment result. F Output P m or P A (7) For P F Image P is obtained after contrast enhancement processing. E (8) Further processing of P E That is, using the registration frame F1 and the reference frame F2 to perform temporal noise reduction processing on the image output P T The reference frame F2 processed in steps (1) to (7) is used as the registration frame F1 for the next frame of image temporal denoising. This process is repeated recursively to achieve temporal denoising of multiple consecutive video frames, and the image processing ends. This invention provides a Bayer image quality enhancement method that can improve image contrast, enhance Bayer image quality, and effectively suppress image noise.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing, and in particular to a Bayer image quality enhancement method. Background Technology

[0002] Bayer Imaging is one of the main technologies for capturing color images using CCD or CMOS sensors.

[0003] For color images, it's necessary to capture multiple basic colors, such as RGB. The simplest method is to use filters: a red filter transmits red wavelengths, a green filter transmits green wavelengths, and a blue filter transmits blue wavelengths. However, capturing all three RGB colors requires three filters, which is expensive and difficult to manufacture. This is because each of the three filters must ensure that every pixel is aligned. The Bayer format solves this problem effectively. Bayer format images use different colors set on a single filter. Analysis of human color perception reveals that the human eye is more sensitive to green; therefore, the Bayer data format contains 50% green information and 25% each of red and blue information. The general format of Bayer image data is as follows:

[0004] Odd scan lines output RGRG……,

[0005] Even-numbered scan lines output GBGB…….

[0006] During the image acquisition process of two commonly used types of image sensors, CCD and CMOS, various noises are introduced due to the influence of sensor material properties, working environment, electronic components and circuit structure, such as thermal noise caused by resistance, channel thermal noise of field-effect transistors, photon noise, dark current noise and non-uniformity of photoresponse, which affect Bayer image quality.

[0007] Traditional methods typically separate Bayer images into grayscale and chroma images, using median or mean filtering to suppress noise in the grayscale image. While noise is suppressed, significant image details are lost, and color casts may occur, resulting in only moderate image quality improvement. Therefore, this invention proposes a Bayer image quality enhancement method that can improve image contrast while removing noise in both the temporal and spatial domains of the Bayer image, facilitating higher-level processing. Summary of the Invention

[0008] Traditional methods mostly process spatial noise in images, which not only loses a lot of image details but also cannot process temporal noise, resulting in only a mediocre improvement in image quality. This invention provides a Bayer image quality enhancement method that can not only improve the contrast of the original Bayer image and enhance the quality of the Bayer image, but also effectively suppress noise in both the spatial and temporal domains of the image.

[0009] This invention provides a Bayer image quality enhancement method, characterized by comprising the following steps:

[0010] Step S1: Scan each pixel in the Bayer image using matrix template A to obtain the center pixel P. A ,

[0011] Step S2: For P A Pixel P was obtained after applying median filtering. m ,

[0012] Step S3: For P A The mean-filtered result P of neighboring pixels of the same color V ,

[0013] Step S4: Place P A With P V Δ is obtained by subtracting the two and taking their absolute values. v ,Right now:

[0014] Δ v =|P A -P v |

[0015] Step S5: Calculate the filter parameters T using the OTSU algorithm. v ,

[0016] Step S6: Let the filtering result of the center pixel be P. F Δ v With T v Make a judgment and select P based on the judgment result. F Value, if Δ v Greater than T v Then the center pixel P F The value is taken as P m If Δ v Less than T v Then P F The value is P A ,Right now:

[0017]

[0018] Output P F value,

[0019] Step S7: For P F After processing using a contrast enhancement algorithm, the noise-reduced and enhanced pixel P is obtained. E ,

[0020] Specifically, the contrast enhancement algorithm uses a grayscale mapping formula to stretch a low-grayscale image to a high-grayscale range to achieve contrast improvement. The grayscale mapping formula is as follows:

[0021] P E =P T -I min *I max -I min *(MAX-MIN)+MIN;

[0022] Where I min I max It is P F The minimum and maximum gray values ​​are MIN and MAX, which are the minimum and maximum gray values ​​of the gray range to which the image is to be stretched.

[0023] Step S8: Perform temporal noise reduction on the image using registration frame F1 and reference frame F2, and output P. T The registration frame F1 is the P frame processed by steps S1 to S7 of the previous frame. E The pixel set, wherein the reference frame F2 is the current frame that has not been processed by S1 to S7. A The pixel set is used as the registration frame F1 for the next frame of image temporal denoising processing, with the reference frame F2 processed by steps S1 to S7 as the registration frame F1. This process is repeated recursively to achieve temporal denoising processing of multiple consecutive video frames, and the image processing ends.

[0024] Specifically, the image temporal denoising is described through the following steps:

[0025] Step S81: Let P be the pixel at the same position as F1 and F2. F1 P F2 , for P F1 and P F2 The result Δ is obtained by performing a difference operation. t ,Right now:

[0026] Δ t =|P F1 -P F2 |

[0027] Step S82: Define the time-domain filtering parameter Δ tf , for Δ t Perform a threshold check; if the difference is lower than Δ tf If no temporal noise reduction is performed, the output pixel P will be... T Take P F2 If the difference is higher than the parameter Δ tf Then the output pixel P T Take ω*F1+(1-ω)*F2, that is:

[0028]

[0029] Where ω is the output pixel fusion parameter.

[0030] Furthermore, the size of the matrix template mentioned in step S1 is usually (2N+1)*(2N+1), where N is a positive integer, and preferably N is 1, 2, or 3.

[0031] Furthermore, the median filtering algorithm described in step S2 is as follows: scan each pixel in the image using a matrix template, and replace the value of the center pixel of the template with the median value of the entire neighborhood pixels determined by the template. The size of the matrix template is usually (2N+1)*(2N+1), where N is a positive integer, and preferably N is 1, 2, or 3.

[0032] Furthermore, the adjacent pixels of the same color mentioned in step S3 include pixels in the vertical direction, the horizontal direction, the 45-degree direction, and the 135-degree direction.

[0033] Furthermore, the T mentioned in step S5 v The value range is [0~(2 N -1)], N is the image bit depth, preferably 8, 10, or 12.

[0034] Furthermore, the specific steps of the OTSU algorithm described in step S5 are as follows:

[0035] Step 51: The image grayscale value range is [0, M], where M is the maximum value in the grayscale value range. For each grayscale value T in [0, M], use it as a threshold to divide the image into two parts with grayscale values ​​of [0, T] and [T+1, M].

[0036] Step 52: Calculate the proportions ω0 and ω1 of each part, the average gray values ​​μ0 and μ1 of each part, and the total average gray value μ.

[0037] Step 53: Calculate the inter-class variance δ 2 :

[0038] δ 2 =ω0(μ0-μ) 2 +ω1(μ1-u) 2 =ω0ω1(μ0-μ1) 2

[0039] Step 54: The threshold corresponding to the maximum inter-class variance can be used as the filtering parameter T. v .

[0040] Furthermore, the value range of M in step S51 is 0 to 2. N N is the image bit depth, preferably 8, 10, or 12.

[0041] Furthermore, in step S7, the MIN value ranges from 0 to 16, and the MAX value ranges from 225 to 255.

[0042] Furthermore, the Δ mentioned in step S82 tf The value range is 0 to 2. N N is the image bit depth, preferably 8, 10, or 12.

[0043] Furthermore, the value range of ω mentioned in step S82 is 0 to 1.

[0044] This invention provides a Bayer image quality enhancement method. Each pixel of the Bayer image is scanned according to a matrix template to obtain the center pixel. The center pixel is then color-determined, and its neighboring pixels are acquired and recombined into a pixel matrix of the same color. The method determines whether to apply median filtering to the center pixel of the pixel matrix or maintain its original pixel value by judging the difference between the mean filtering result of the center pixel and the filtering parameters calculated by the OTSU algorithm. F , for P F After contrast enhancement, the result P was obtained. E Further processing of P E That is, using the registration frame F1 and the reference frame F2 to perform temporal noise reduction processing on the image output P T The process is recursively repeated to achieve temporal noise reduction of multiple consecutive video frames, at which point the image processing ends. This method not only improves the contrast of Bayer images but also removes random noise in the spatial and temporal domains, facilitating higher-level processing. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention, Figure 1 This is a flowchart of a Bayer image quality enhancement method implemented according to the present invention. Detailed Implementation

[0046] To more clearly express the purpose, technical solution, and beneficial effects of the present invention, the present invention will be further described in detail below with reference to specific implementation examples and the accompanying drawings.

[0047] A Bayer image quality enhancement method effectively improves Bayer image contrast while preserving original Bayer image details, thereby enhancing image quality and suppressing image noise. This algorithm is implemented on 1080P format 8-bit resolution Bayer images. This embodiment has the exact same steps as the invention; to avoid repetition, only key data is listed:

[0048] Specifically, the matrix template A mentioned in step 1 uses a matrix size of 5*5.

[0049] Specifically, step S3, which involves taking the geometric mean of neighboring pixels of the same color for filtering, is implemented as follows:

[0050] If the center color of a 5x5 matrix is ​​R, its matrix distribution is as follows:

[0051] R G R G R G B G B G R G R G R G B G B G R G R G R

[0052] For color R, since neighboring pixels are taken from the top, bottom, left, right, 45-degree and 135-degree directions, the size of the same color matrix is ​​3*3. The average value of this matrix R can be taken. If the center pixel color is G or B, it is processed in the same way as R to obtain the average value.

[0053] Specifically, in step S5, the filter parameter T is calculated using the OTSU algorithm. v =100.

[0054] Specifically, in step S7, MIN is 16 and MAX is 225 to 255.

[0055] Specifically, Δ in step S82 tf Let ω be 20 and ω be 0.45.

[0056] This embodiment of a Bayer image quality enhancement method involves scanning each pixel of the Bayer image according to a matrix template to obtain the center pixel, then performing color judgment and neighbor pixel acquisition on the center pixel to reassemble it into a same-color pixel matrix, applying mean filtering to the center pixel, and determining whether to use median filtering or maintain the original pixel value P by judging the difference between the mean filtering result of the center pixel and the filtering parameters calculated by the OTSU method. F , for P F Image P is obtained after contrast enhancement. E Further processing of P E That is, using the registration frame F1 and the reference frame F2 to perform temporal noise reduction processing on the image output P T The process recursively performs temporal noise reduction on multiple consecutive video frames, and the image processing ends. This method not only improves the contrast of Bayer images, but also removes noise in the temporal and spatial domains of Bayer images, facilitating higher-level processing.

Claims

1. A Bayer image quality enhancement method, characterized in that, Includes the following steps, Step S1: Scan each pixel in the Bayer image using matrix template A to obtain the center pixel P. A ; Step S2: For P A Pixel P was obtained after applying median filtering. m ; Step S3: For P A The mean-filtered result P of neighboring pixels of the same color v ; Step S4: Place P A With P v Δ is obtained by subtracting the two and taking their absolute values. v ,Right now: D v =|P A -P v | Step S5: Calculate the filter parameters T using the OTSU algorithm. v ; Step S6: Let the center pixel filtering result P F Δ v With T v Make a judgment and select P based on the judgment result. F Value, if Δ v Greater than T v Then the center pixel P F The value is taken as P m If Δ v Less than T v Then P F The value is P A ,Right now: Output P F value; Step S7: For P F Image P is obtained after processing using a contrast enhancement algorithm. E , Specifically, the contrast enhancement algorithm uses a grayscale mapping formula to stretch a low grayscale image to a high grayscale range to achieve contrast enhancement. The grayscale mapping formula is as follows: P E =P F -I min *I max -I min *(MAX-MIN)+MIN; Where Imin and Imax are P F The minimum and maximum gray values, MIN and MAX are the minimum and maximum gray values ​​of the gray range to which the image is to be stretched; Step S8: Perform temporal noise reduction on the image using registration frame F1 and reference frame F2, and output P. T The registration frame F1 is the P frame processed by steps S1 to S7 of the previous frame. E The pixel set, wherein the reference frame F2 is the current frame that has not been processed by S1 to S7. A The pixel set is used, with the reference frame F2 processed in steps S1 to S7 serving as the registration frame F1 for the next frame's temporal denoising process. This process is repeated recursively to achieve temporal denoising for multiple consecutive video frames. The image processing then ends. Specifically, the image temporal denoising is described through the following steps: Step S81: Let P be the pixel at the same position as F1 and F2. F1 P F2 , for P F1 and P F2 The result Δ is obtained by performing a difference operation. t ,Right now: D t =|P F1 -P F2 | Step S82: Define the time-domain filtering parameter Δ tf , for Δ t Perform a threshold check; if the difference is lower than Δ tf If no temporal noise reduction is performed, the output pixel P will be... T Take P F2 If the difference is higher than the parameter Δ tf Then the output pixel P T Take ω*F1+(1-ω)*F2, that is: Where ω is the output pixel fusion parameter.

2. The Bayer image quality enhancement method according to claim 1, characterized in that, The size of the matrix template in step S1 is (2N+1)*(2N+1), where N is a positive integer.

3. The Bayer image quality enhancement method according to claim 1, characterized in that, The specific algorithm for median filtering in step S2 is as follows: scan each pixel in the image using a matrix template, and replace the value of the center pixel of the template with the median value of the entire neighborhood pixels determined by the template. The size of the matrix template is (2N+1)*(2N+1), where N is a positive integer.

4. The Bayer image quality enhancement method according to claim 1, characterized in that, The adjacent pixels of the same color mentioned in step S3 include pixels in the vertical direction, the horizontal direction, the 45-degree direction, and the 135-degree direction.

5. The Bayer image quality enhancement method according to claim 1, characterized in that, The specific steps of the OTSU algorithm described in step S5 are as follows: Step 51: The image grayscale value range is [0, M], where M is the maximum value in the grayscale value range. For each grayscale value T in [0, M], use it as a threshold to divide the image into two parts with grayscale values ​​of [0, T] and [T+1, M]. Step 52: Calculate the proportions ω0 and ω1 of each part, the average gray values ​​μ0 and μ1 of each part, and the total average gray value μ. Step 53: Calculate the inter-class variance δ 2 : d 2 =w0(μ0-μ) 2 +w1(μ1-u) 2 =w0w1(μ0-μ1) 2 Step 54: The threshold corresponding to the maximum inter-class variance can be used as the filtering parameter T. V .

6. The Bayer image quality enhancement method according to claim 1, characterized in that, The Δ mentioned in step S82 tf The value range is 0 to 2. N N is the number of bits in the image.

7. The Bayer image quality enhancement method according to claim 1, characterized in that, The MIN value range in step S7 is 0 to 16, and the MAX value range is 225 to 255.

Citation Information

Patent Citations

  • Image quality enhancement and filtering method applied to CMOS image sensor

    CN106504281A

  • Medical imgae copression method and apparatus thereof

    KR1020120133317A