Adaptive Bayer image interpolation method based on channel correlation
Through the adaptive Bayer image interpolation method based on channel correlation, the weighted least squares method is used to fit the correlation between channels, which solves the problems of insufficient robustness and poor imaging effect of the interpolation algorithm in the existing technology, and achieves more efficient Image interpolation eliminates mosaic and false color phenomena.
Patent Information
- Application Number
- CN202310226045.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-06
- Publication Date
- 2024-09-10
AI Technical Summary
The existing Bayer image interpolation algorithm is not robust enough and relies on parameter control, resulting in poor results in certain scenarios. It also fails to fully utilize the correlation between channels, resulting in mosaic and pseudo-color phenomena, and poor imaging results.
The adaptive Bayer image interpolation method based on channel correlation is adopted. By calculating the linear interpolation, gradient and gradient correlation of the image, the weighted least squares method is used to fit the correlation between channels, calculate the interpolation weight, and perform local adaptive interpolation to avoid Parameter adjustment.
It improves the robustness of the interpolation algorithm, eliminates mosaic and false color phenomena, improves imaging effects, and adapts to various complex scenes.
Smart Images

Figure CN118628339A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of image processing, and in particular relates to an adaptive Bayer image interpolation method based on channel correlation. Background Art
[0002] The purpose of Bayer image interpolation is to interpolate the Bayer image into a complete color image. The original bilinear interpolation algorithm has problems such as zipper effect, low clarity, and serious pseudo-color. Therefore, scholars have invented more advanced interpolation algorithms. Currently, the most mainstream Bayer image interpolation algorithms are mainly divided into two categories: color difference method and residual method.
[0003] Color difference method. A basic assumption is that the hue and brightness of an RGB image change slowly within a local range, which is manifested as the constancy of local color difference. The constancy of color difference can be used to interpolate the complete G channel information, and then the complete R channel and B channel information can be interpolated based on the complete G channel information and color difference information to obtain a complete RGB image. The color difference method usually needs to be completed in 6 steps:
[0004] Step 1: Use linear interpolation to obtain the horizontal interpolation results and vertical interpolation results of the R, G, and B channels respectively;
[0005] Step 2: Use the interpolation result of the previous step to calculate the horizontal interpolation color difference RG and BG, and at the same time calculate the vertical interpolation color difference RG and BG;
[0006] Step 3: Calculate the color difference weights in the horizontal and vertical directions;
[0007] Step 4: Calculate the final color difference estimation values RG and BG using the color difference weights and color difference values in the two directions;
[0008] Step 5: Superimpose the final color difference estimation value on the R channel and B channel of the original Bayer image to restore the complete G channel information;
[0009] Step 6: Use the principle of constant color difference to restore the R and B channel information.
[0010] Residual method. The comprehensive effect of the residual method is better than that of the color difference method. It assumes that the three channels of the image satisfy linear correlation in the local range, and uses the guided upsampling method to complete the image interpolation. The basic steps of the residual method are the same as those of the color difference method, except that: in the first step, guided upsampling is used to complete the horizontal and vertical interpolation; in the sixth step, guided upsampling is used to complete the interpolation of the R and B channels.
[0011] The main defects of the prior art are:
[0012] 1. The interpolation algorithm is not robust enough. The algorithm depends on parameter control. The same algorithm works very well in some scenarios, but fails in some scenarios.
[0013] 2. The imaging effect is insufficient. The existing algorithms do not fully utilize the correlation between channels, resulting in mosaic or false color phenomena in some local areas, making it difficult to ensure the optimal imaging effect.
[0014] In addition, common terms in the prior art include:
[0015] 1. Bayer image: Most color cameras use 3D photoelectric sensors to obtain image information. A color filter array (CFA) is covered on the surface of the sensor. The most common CFA format is the Bayer format. The raw data collected by the Bayer format sensor is called a Bayer image. Figure 1 Shown is a common Bayer image schematic.
[0016] 2. Bayer image interpolation: The process of restoring a bayer image to a complete RGB image.
[0017] 3. Resolution: The ability to distinguish details of the photographed object. The higher the resolution, the richer the image details and the higher the clarity.
[0018] 4. Pseudo color: When interpolating a Bayer image, if the color information is interpolated incorrectly, abnormal colors (False Color) will easily appear, which is called pseudo color.
[0019] 5. Mosaic phenomenon: When interpolating Bayer images, if the brightness information is interpolated incorrectly, abnormal textures are likely to appear. The intuitive manifestation in the image is the checkerboard phenomenon or zipper effect, which can be collectively referred to as the mosaic phenomenon. Summary of the invention
[0020] In order to solve the above problems, the purpose of this application is: after studying the existing technology, an adaptive Bayer image interpolation method based on channel correlation is proposed. The method does not rely on parameter adjustment and can adapt to various complex practical application scenarios; the correlation between channels is fitted using an accurate local regression model to complete the local adaptive interpolation of Bayer data.
[0021] Specifically, the present invention provides an adaptive Bayer image interpolation method based on channel correlation, the method comprising:
[0022] S1, calculates linear interpolation in the image;
[0023] S2, calculate the gradient of each channel;
[0024] S3, estimate the gradient correlation between different channels:
[0025] S3.1, estimate the gradient correlation between G and R at the position of R
[0026] In the local range of the Bayer image, assuming that the gradients of R and G in the horizontal direction have a linear relationship, then:
[0027]
[0028] Among them, (i, j) represents the pixel coordinates, △G H (i,j) and △R H (i, j) represent the G channel gradient value and R channel gradient value of the point in the horizontal direction respectively. and They represent the coefficient of the first-order term and the coefficient of the constant term respectively. For areas with strong edges, a larger window is needed to fit the correlation between different channels to avoid mosaics at the edges of objects. For areas with weak textures, only a small fitting window is needed to avoid false colors caused by large correlation calculation errors. Therefore, the weighted least squares method is used to control the effective fitting window and calculate the unknown coefficients. and
[0029]
[0030] Where r represents the local maximum fitting window, (i+k,j+l) represents the coordinates of the sample point, and ω(i,j,k,l) represents the weight of the sample point corresponding to the coordinate. The calculation formula is:
[0031]
[0032]
[0033] Where t represents the global control parameter, which is used to adjust the overall size of the fitting window; Used to mark the position of valid samples. When the horizontal interpolation result of R exists or the current point is R, Take 1 otherwise take 0; represents the sum of the variances of the three channels within the maximum fitting window, Respectively represent the mean of the three channels of RGB after horizontal interpolation; R H (·), G H (·), B H (·) respectively represent the horizontal interpolation results obtained in step S1;
[0034] The weighted least squares method is used to obtain the gradient relationship between the R and G channels in the vertical direction:
[0035]
[0036] Among them, (i, j) represents the pixel coordinates, △G V (i,j) and △R V (i, j) represent the G channel gradient value and R channel gradient value of the point in the vertical direction respectively. and Represents the gradient fitting coefficient in the vertical direction; S3.2, estimates the gradient correlation between G and B at the B position
[0037] According to the rotation symmetry, replace R in S3.1 with B, and you get the gradient relationship between G and B:
[0038]
[0039]
[0040] S3.3, estimate the gradient correlation between G and R and G and B at the Gr position
[0041]
[0042]
[0043] S3.4, estimate the gradient correlation between G and R and G and B at the position of Gb
[0044]
[0045]
[0046] S4, calculate the comprehensive gradient:
[0047] Using the gradient value calculated in step S2 and the gradient relationship coefficient calculated in step S3, the comprehensive gradient D of each position is estimated. H and D V , each pixel position is calculated as follows:
[0048] S4.1, Integrated gradient at position R
[0049]
[0050]
[0051] S4.2, integrated gradient at position B
[0052]
[0053]
[0054] S4.3, integrated gradient at Gr position
[0055]
[0056]
[0057] S4.4, integrated gradient at position Gb
[0058]
[0059]
[0060] S5, calculating interpolation weights;
[0061] S6, calculate the G channel interpolation, the method is as follows:
[0062] S6.1, for the R position in the Bayer image, interpolate the G channel using the following formula:
[0063]
[0064] Among them, W H and W V are the weight values calculated in step S5, and
[0065]
[0066]
[0067]
[0068]
[0069] in, They are the estimated values of the G channel of the current point (i, j) in the four directions of east, west, south and north;
[0070] S6.2, for the B position in the Bayer image, using the rotation symmetry, replace R in the R position interpolation formula with B to complete the interpolation of the G channel;
[0071] S7, calculate the interpolation of the R channel and the B channel, that is, the interpolation method at the positions of Gr and Gb is as follows:
[0072] S7.1, estimate the B channel interpolation result of the R pixel position
[0073] For the R position in the Bayer image, bilinear interpolation is used:
[0074]
[0075] S7.2, estimate the R channel interpolation result of the B pixel position
[0076]
[0077] S7.3, interpolation result of estimating Gr pixel position
[0078] The interpolation of the R channel is done using the following formula:
[0079]
[0080]
[0081]
[0082] in, is the interpolation result of the R channel at the coordinate position (i, j), represents the horizontal linear interpolation result calculated in step S1, W H (·) is the weight value calculated in step S5, and represents the fitting coefficient obtained in step S3, R(·) and G(·) represent the R channel pixel value and the G channel pixel value of the corresponding position in the original Bayer image;
[0083] The interpolation method of the B channel is similar, as follows:
[0084]
[0085]
[0086]
[0087] S7.4, estimate the interpolation result of Gb pixel position
[0088] By using the rotation symmetry, replace R with B and replace B with R in step S7.3, so as to obtain the interpolation results of the R and B channels at the position Gb;
[0089] B channel:
[0090]
[0091]
[0092]
[0093] R channel:
[0094]
[0095]
[0096]
[0097] The step S1 of linear interpolation further comprises:
[0098] For the R or B pixel in the Bayer image, the linear interpolation results in the horizontal and vertical directions are calculated using the following formulas:
[0099]
[0100]
[0101] in, and Respectively represent the linear interpolation results of the G channel in the horizontal and vertical directions; G(i,j-1), G(i,j+1), G(i-1,j), and G(i+1,j) represent the actual G channel pixel values at the corresponding positions; at the G pixel of the Bayer image, the calculation formula is similar to the above formula, but each pixel position can only calculate the interpolation result in one direction of the horizontal or vertical direction. If the left and right adjacent positions of the G pixel are R pixels, then:
[0102]
[0103] Among them, R(i,j-1), R(i,j+1), R(i-1,j), and R(i+1,j) represent the actual R channel pixel values of the corresponding positions on the Bayer image; conversely, if the left and right adjacent positions of the G pixel are B pixels, then:
[0104]
[0105] Among them, B(i,j-1), B(i,j+1), B(i-1,j), and B(i+1,j) respectively represent the actual B channel pixel values of the corresponding positions on the Bayer image.
[0106] The step S2 of calculating the gradient further comprises:
[0107] According to the result of step S1, the horizontal gradient and vertical gradient of each channel are calculated:
[0108] △X H (i,j)=X H (i,j)-X H (i,j-1)
[0109] △X V (i,j)=X V (i,j)-X V (i-1,j)
[0110] Among them, X represents one channel of R / G / B, △X H and △X V Respectively represent the gradient values of the channel in the horizontal and vertical directions.
[0111] In the calculation of gradient,
[0112] The calculation result of the G channel gradient is:
[0113] △G H (i,j)=G H (i,j)-G H (i,j-1)
[0114] △G V (i,j)=G V (i,j)-G V (i-1,j)
[0115] △G H (i,j) and ∆G V (i, j) represents the horizontal and vertical gradient values of the G channel at the coordinate (i, j), respectively. H (·) and G V (·) respectively represent the interpolation results of the G channel calculated in step S1 in the horizontal direction and the vertical direction;
[0116] The R channel gradient calculation result is:
[0117] △R H (i,j)=R H (i,j)-R H (i,j-1)
[0118] △R V (i,j)=R V (i,j)-R V (i-1,j)
[0119] △R H (i,j) and △R V (i, j) represents the horizontal and vertical gradient values of the R channel at the coordinate (i, j), R H (·) and R V (·) respectively represent the interpolation results of the R channel calculated in step S1 in the horizontal direction and the vertical direction;
[0120] The gradient calculation result of channel B is:
[0121] △B H (i,j)=B H (i,j)-B H (i,j-1)
[0122] △B V (i,j)=B V (i,j)-B V (i-1,j)
[0123] △B H (i,j) and ∆B V (i, j) represents the horizontal and vertical gradient values of the B channel at the coordinate (i, j), respectively. H (·) and B V (·) represent the interpolation results of the B channel calculated in step S1 in the horizontal direction and the vertical direction respectively.
[0124] The step S5 of calculating the interpolation weight further comprises:
[0125] The horizontal weight value and vertical weight value at each pixel position are obtained by the following calculation formula:
[0126]
[0127]
[0128] Therefore, the advantages of this application are:
[0129] 1. The method does not rely on parameter adjustment and can adapt to various complex practical application scenarios, effectively improving the robustness of the interpolation algorithm;
[0130] 2. Use accurate local regression models to fit the correlation between channels and complete local adaptive interpolation of Bayer data, effectively eliminating the mosaic and pseudo-color phenomena of the image and improving the imaging effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0131] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention.
[0132] Figure 1 It is a flow chart of the present application method. DETAILED DESCRIPTION
[0133] In order to more clearly understand the technical content and advantages of the present invention, the present invention is now further described in detail in conjunction with the accompanying drawings.
[0134] like Figure 1 As shown, the present application provides an adaptive Bayer image interpolation method based on channel correlation, and the specific method is divided into the following steps:
[0135] Step S1. Linear interpolation
[0136] For the R or B pixel in the Bayer image, the linear interpolation results in the horizontal and vertical directions are calculated using the following formulas:
[0137]
[0138]
[0139] in, and Respectively represent the linear interpolation results of the G channel in the horizontal and vertical directions. G(i,j-1), G(i,j+1), G(i-1,j), and G(i+1,j) represent the actual G channel pixel values at the corresponding positions. At the G pixel of the Bayer image, the calculation formula is similar to the above formula, but each pixel position can only calculate the interpolation result in one direction of the horizontal or vertical direction. If the left and right adjacent positions of the G pixel are R pixels, then:
[0140]
[0141] Among them, R(i,j-1), R(i,j+1), R(i-1,j), and R(i+1,j) represent the actual R channel pixel values of the corresponding positions on the Bayer image;
[0142] On the contrary, if the left and right adjacent positions of the G pixel are B pixels, then:
[0143]
[0144] Among them, B(i,j-1), B(i,j+1), B(i-1,j), and B(i+1,j) respectively represent the actual B channel pixel values of the corresponding positions on the Bayer image.
[0145] Step S2. Calculate the gradient
[0146] According to the results of the previous step S1, the horizontal and vertical gradients of each channel are calculated:
[0147] △X H (i,j)=X H (i,j)-X H (i,j-1)
[0148] △X V (i,j)=X V (i,j)-X V (i,j-1)
[0149] Among them, X represents one channel of R / G / B, △X H and △X V Respectively represent the gradient values of the channel in the horizontal and vertical directions.
[0150] In the calculation of gradient,
[0151] The calculation result of the G channel gradient is:
[0152] △G H (i,j)=G H (i,j)-G H (i,j-1)
[0153] △G V (i,j)=G V (i,j)-G V (i-1,j)
[0154] △G H (i,j) and ∆G V (i, j) represents the horizontal and vertical gradient values of the G channel at the coordinate (i, j), respectively. H (·) and G V (·) respectively represent the interpolation results of the G channel calculated in step S1 in the horizontal direction and the vertical direction;
[0155] The R channel gradient calculation result is:
[0156] △R H (i,j)=R H (i,j)-R H (i,j-1)
[0157] △R V (i,j)=R V (i,j)-R V (i-1,j)
[0158] △R H (i,j) and △R V (i, j) represents the horizontal and vertical gradient values of the R channel at the coordinate (i, j), R H (·) and R V (·) respectively represent the interpolation results of the R channel calculated in step S1 in the horizontal direction and the vertical direction;
[0159] The gradient calculation result of channel B is:
[0160] △B H (i,j)=B H (i,j)-B H (i,j-1)
[0161] △B V (i,j)=B V (i,j)-B V (i-1,j)
[0162] △B H (i,j) and ∆B V (i, j) represents the horizontal and vertical gradient values of the B channel at the coordinate (i, j), respectively. H (·) and B V (·) represent the interpolation results of the B channel calculated in step S1 in the horizontal direction and the vertical direction respectively.
[0163] Step S3. Estimating channel correlation
[0164] S3.1, estimate the gradient correlation between G and R at the position of R
[0165] In the local range of the Bayer image, assuming that the gradients of R and G in the horizontal direction have a linear relationship, then:
[0166]
[0167] Among them, (i, j) represents the pixel coordinates, △G H (i,j) and △R H (i, j) represent the G channel gradient value and R channel gradient value of the point in the horizontal direction respectively. and They represent the coefficient of the first-order term and the coefficient of the constant term respectively. For areas with strong edges, a larger window is needed to fit the correlation between different channels to avoid mosaics at the edges of objects. For areas with weak textures, only a small fitting window is needed to avoid false colors caused by large correlation calculation errors. Therefore, the weighted least squares method is used to control the effective fitting window and calculate the unknown coefficients. and
[0168]
[0169] Where r represents the local maximum fitting window, (i+k,j+l) represents the coordinates of the sample point, and ω(i,j,k,l) represents the weight of the sample point corresponding to the coordinate. The calculation formula is:
[0170]
[0171]
[0172] Where t represents the global control parameter, which is used to adjust the overall size of the fitting window; Used to mark the position of valid samples. When the horizontal interpolation result of R exists or the current point is R, Take 1 otherwise take 0; represents the sum of the variances of the three channels within the maximum fitting window, Respectively represent the mean of the three channels of RGB after horizontal interpolation; R H (·), G H (·), B H (·) respectively represent the horizontal interpolation results obtained in step S1;
[0173] The weighted least squares method is used to obtain the gradient relationship between the R and G channels in the vertical direction:
[0174]
[0175] Among them, (i, j) represents the pixel coordinates, △G V (i,j) and △R V (i, j) represent the G channel gradient value and R channel gradient value of the point in the vertical direction respectively. and Represents the gradient fitting coefficient in the vertical direction; S3.2, estimates the gradient correlation between G and B at the B position
[0176] According to the rotation symmetry, replace R in S3.1 with B, and you get the gradient relationship between G and B:
[0177]
[0178]
[0179] S3.3, estimate the gradient correlation between G and R and G and B at the Gr position
[0180]
[0181]
[0182] S3.4, estimate the gradient correlation between G and R and G and B at the position of Gb
[0183]
[0184]
[0185] Step S4. Calculate the comprehensive gradient
[0186] Using the gradient value calculated in step S2 and the gradient relationship coefficient calculated in step S3, the comprehensive gradient D of each position is estimated. H and D V , the calculation method for each pixel position is as follows (the meaning of each symbol in the formula is exactly the same as in S3):
[0187] S4.1, Integrated gradient at position R
[0188]
[0189]
[0190] S4.2, integrated gradient at position B
[0191]
[0192]
[0193] S4.3, integrated gradient at Gr position
[0194]
[0195]
[0196] S4.4, integrated gradient at position Gb
[0197]
[0198]
[0199] Step S5. Calculate interpolation weights
[0200] The horizontal weight value and vertical weight value at each pixel position are obtained by the following calculation formula:
[0201]
[0202]
[0203] Step S6: Calculate the G channel interpolation as follows:
[0204] S6.1, for the R position in the Bayer image, use the following formula to complete the interpolation of the G channel:
[0205]
[0206] Among them, W H and W V are the weight values calculated in step S4, and
[0207]
[0208]
[0209]
[0210]
[0211] Among them, W H and W Vare the weight values calculated in step S5, and
[0212]
[0213]
[0214]
[0215]
[0216] in, They are the estimated values of the G channel of the current point (i, j) in the four directions of east, west, south and north;
[0217] S6.2, for the B position in the Bayer image, using the rotation symmetry, replace R in the R position interpolation formula with B to complete the interpolation of the G channel;
[0218] Step S7. Interpolation of the R channel and the B channel, that is, the interpolation method at the positions of Gr and Gb is as follows:
[0219] S7.1, estimate the B channel interpolation result of the R pixel position
[0220] For the R position in the Bayer image, bilinear interpolation is used:
[0221]
[0222] S7.2, estimate the R channel interpolation result of the B pixel position
[0223]
[0224] S7.3, interpolation result of estimating Gr pixel position
[0225] The interpolation of the R channel is done using the following formula:
[0226]
[0227]
[0228]
[0229] in, is the interpolation result of the R channel at the coordinate position (i, j), represents the horizontal linear interpolation result calculated in step S1, W H (·) is the weight value calculated in step S5, and represents the fitting coefficient obtained in step S3, R(·) and G(·) represent the R channel pixel value and the G channel pixel value of the corresponding position in the original Bayer image;
[0230] The interpolation method of the B channel is similar:
[0231]
[0232]
[0233]
[0234] S7.4, estimate the interpolation result of Gb pixel position
[0235] By using the rotation symmetry, replace R with B and replace B with R in step S7.3, so as to obtain the interpolation results of the R and B channels at the position Gb;
[0236] B channel:
[0237]
[0238]
[0239]
[0240] R channel:
[0241]
[0242]
[0243]
[0244] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An adaptive Bayer image interpolation method based on channel correlation, characterized in that: The method comprises: S1, calculates linear interpolation in the image; S2, calculate the gradient of each channel; S3, estimate the gradient correlation between different channels: S3.1, estimate the gradient correlation between G and R at the position of R In the local range of the Bayer image, assuming that the gradients of R and G in the horizontal direction have a linear relationship, then: Among them, (i, j) represents the pixel coordinates, △G H (i,j) and △R H (i, j) represent the G channel gradient value and R channel gradient value of the point in the horizontal direction respectively. and They represent the coefficient of the first-order term and the coefficient of the constant term respectively. For areas with strong edges, a larger window is needed to fit the correlation between different channels to avoid mosaics at the edges of objects. For areas with weak textures, only a small fitting window is needed to avoid false colors caused by large correlation calculation errors. Therefore, the weighted least squares method is used to control the effective fitting window and calculate the unknown coefficients. and Where r represents the local maximum fitting window, (i+k,j+l) represents the coordinates of the sample point, and ω(i,j,k,l) represents the weight of the sample point corresponding to the coordinate. The calculation formula is: Where t represents the global control parameter, which is used to adjust the overall size of the fitting window; Used to mark the position of valid samples. When the horizontal interpolation result of R exists or the current point is R, Take 1 otherwise take 0; represents the sum of the variances of the three channels within the maximum fitting window, Respectively represent the mean of the three channels of RGB after horizontal interpolation; R H (·), G H (·), B H (·) respectively represent the horizontal interpolation results obtained in step S1; The weighted least squares method is used to obtain the gradient relationship between the R and G channels in the vertical direction: Among them, (i, j) represents the pixel coordinates, △G V (i,j) and △R V (i, j) represent the G channel gradient value and R channel gradient value of the point in the vertical direction respectively. and Represents the gradient fitting coefficient in the vertical direction; S3.2, estimate the gradient correlation between G and B at the position of B According to the rotation symmetry, replace R in S3.1 with B, and you get the gradient relationship between G and B: S3.3, estimate the gradient correlation between G and R and G and B at the Gr position S3.4, estimate the gradient correlation between G and R and G and B at the position of Gb S4, calculate the comprehensive gradient: Using the gradient value calculated in step S2 and the gradient relationship coefficient calculated in step S3, the comprehensive gradient D of each position is estimated. H and D V , each pixel position is calculated as follows: S4.1, Integrated gradient at position R S4.2, integrated gradient at position B S4.3, integrated gradient at Gr position S4.4, integrated gradient at position Gb S5, calculating interpolation weights; S6, calculate the G channel interpolation, the method is as follows: S6.1, for the R position in the Bayer image, interpolate the G channel using the following formula: Among them, W H and W V are the weight values calculated in step S5, and in They are the estimated values of the G channel of the current point (i, j) in the four directions of east, west, south and north; S6.2, for the B position in the Bayer image, using the rotation symmetry, replace R in the R position interpolation formula with B to complete the interpolation of the G channel; S7, calculate the interpolation of the R channel and the B channel, that is, the interpolation method at the positions of Gr and Gb is as follows: S7.1, estimate the B channel interpolation result of the R pixel position For the R position in the Bayer image, bilinear interpolation is used: S7.2, estimate the R channel interpolation result of the B pixel position S7.3, interpolation result of estimating Gr pixel position The interpolation of the R channel is done using the following formula: Among them, is the interpolation result of the R channel at the coordinate position (i, j), represents the horizontal linear interpolation result calculated in step S1, W H (·) is the weight value calculated in step S5, and represents the fitting coefficient obtained in step S3, R(·) and G(·) represent the R channel pixel value and the G channel pixel value of the corresponding position in the original Bayer image; The interpolation method of the B channel is similar: S7.4, estimate the interpolation result of Gb pixel position By using the rotation symmetry, replace R with B and replace B with R in step S7.3, so as to obtain the interpolation results of the R and B channels at the position Gb; B channel: R channel:
2. The adaptive Bayer image interpolation method based on channel correlation according to claim 1, characterized in that: The step S1 of linear interpolation further comprises: For the R or B pixel in the Bayer image, the linear interpolation results in the horizontal and vertical directions are calculated using the following formulas: in, and Respectively represent the linear interpolation results of the G channel in the horizontal and vertical directions; G(i,j-1), G(i,j+1), G(i-1,j), and G(i+1,j) represent the actual G channel pixel values at the corresponding positions; at the G pixel of the Bayer image, the calculation formula is similar to the above formula, but each pixel position can only calculate the interpolation result in one direction of the horizontal or vertical direction. If the left and right adjacent positions of the G pixel are R pixels, then it is as follows: Among them, R(i,j-1), R(i,j+1), R(i-1,j), and R(i+1,j) represent the actual R channel pixel values of the corresponding positions on the Bayer image; conversely, if the left and right adjacent positions of the G pixel are B pixels, then: Among them, B(i,j-1), B(i,j+1), B(i-1,j), and B(i+1,j) respectively represent the actual B channel pixel values of the corresponding positions on the Bayer image.
3. The adaptive Bayer image interpolation method based on channel correlation according to claim 1, characterized in that: The step S2 of calculating the gradient further comprises: According to the result of step S1, the horizontal gradient and vertical gradient of each channel are calculated: △X H (i,j)=X H (i,j)-X H (i,j-1) △X V (i,j)=X V (i,j)-X V (i-1,j) Among them, X represents one channel of R / G / B, △X H and △X V Respectively represent the gradient values of the channel in the horizontal and vertical directions.
4. The adaptive Bayer image interpolation method based on channel correlation according to claim 3, characterized in that: In the calculation of gradient, The calculation result of the G channel gradient is: △G H (i,j)=G H (i,j)-G H (i,j-1) △G V (i,j)=G V (i,j)-G V (i-1,j) △G H (i,j) and ∆G V (i, j) represents the horizontal and vertical gradient values of the G channel at the coordinate (i, j), respectively. H (·) and G V (·) respectively represent the interpolation results of the G channel calculated in step S1 in the horizontal direction and the vertical direction; The R channel gradient calculation result is: △R H (i,j)=R H (i,j)-R H (i,j-1) △R V (i,j)=R V (i,j)-R V (i-1,j) △R H (i,j) and △R V (i, j) represents the horizontal and vertical gradient values of the R channel at the coordinate (i, j), R H (·) and R V (·) respectively represent the interpolation results of the R channel calculated in step S1 in the horizontal direction and the vertical direction; The gradient calculation result of channel B is: △B H (i,j)=B H (i,j)-B H (i,j-1) △B V (i,j)=B V (i,j)-B V (i-1,j) △B H (i,j) and ∆B V (i, j) represents the horizontal and vertical gradient values of the B channel at the coordinate (i, j), respectively. H (·) and B V (·) represent the interpolation results of the B channel calculated in step S1 in the horizontal direction and the vertical direction respectively.
5. The adaptive Bayer image interpolation method based on channel correlation according to claim 1, characterized in that: The step S5 of calculating the interpolation weight further comprises: The horizontal weight value and vertical weight value at each pixel position are obtained by the following calculation formula:
