A method and apparatus for correcting false color in images

By calculating the color difference in the image and correcting it using the linear minimum mean square error method, the problem of limited elimination effect of false color is solved, and the maximum restoration of the true color of the image is achieved.

CN117808715BActive Publication Date: 2026-11-17SHANGHAI FULLHAN MICROELECTRONICS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311845555.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-28
Publication Date
2026-11-17
Estimated Expiration
2043-12-28

AI Technical Summary

Technical Problem

Existing technologies have limited effectiveness in correcting false colors, especially in RGB interpolation, where they cannot effectively eliminate false colors and may cause normal colors to be incorrectly corrected.

Method used

By selecting a reference pixel in the image to be processed, the color difference between the remaining pixels and the reference pixel is calculated, and the color difference is corrected using the linear minimum mean square error method. The correction results of each pixel are then fused to eliminate false colors and avoid incorrect correction of normal colors.

Benefits of technology

It effectively removes false colors, restores the true colors of the image to the maximum extent, and avoids normal color errors caused by misjudgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117808715B_ABST
    Figure CN117808715B_ABST
Patent Text Reader

Abstract

This invention discloses an image pseudo-color correction method and apparatus, belonging to the field of image processing technology. The image pseudo-color correction method includes the following steps: selecting a reference pixel in the image to be processed, calculating the color difference between the remaining pixels and the reference pixel, and correcting the color difference; using the corrected color difference to correct the reference pixel, fusing the obtained correction results to obtain the corrected result of the reference pixel, then calculating the correction results of the remaining pixels, and fusing the correction results of each pixel with the original pixels of the image to be processed for output. This method of identifying and correcting pseudo-color based on the color correlation between pixels effectively removes pseudo-color and restores the true colors of the image to the greatest extent possible.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method and apparatus for correcting false color in images. Background Technology

[0002] Due to the dispersion and diffraction characteristics of the lens, as well as the influence of the image sensor and image interpolation method, color imaging devices may produce some non-true colors in the images captured in environments with strong contrast between light and dark. These false colors affect the realism of the image.

[0003] False color mainly occurs when the device's acquisition module interpolates raw single-channel Bayer data into three-channel RGB data, resulting in interpolation errors. Currently, there are two main methods for correcting false color: one method corrects during RGB interpolation, primarily to make the interpolated G pixels more accurate, thus leading to more accurate R / B pixel interpolation. The problem with this method is that it focuses too much on the G pixel interpolation result, while the R / B interpolation processing is relatively simple, resulting in limited false color elimination. The other method corrects after RGB interpolation is complete, mainly by identifying moiré patterns for color correction. The problem with this method is that false color cannot be eliminated in areas that do not conform to the moiré pattern identification characteristics.

[0004] It should be noted that the information disclosed in the background section of this invention is intended only to enhance the understanding of the general background of this invention, and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention

[0005] The purpose of this invention is to provide an image pseudocolor correction method and apparatus to solve the problem that conventional methods have limited correction effects on pseudocolor.

[0006] To address the aforementioned technical problems, this invention provides an image pseudo-color correction method, comprising the following steps:

[0007] A reference pixel is selected in the image to be processed, the color difference between the remaining pixels and the reference pixel is calculated, and the color difference is corrected.

[0008] The reference pixel is corrected using the color difference correction result. The obtained dependent correction results are fused to obtain the correction result of the reference pixel. Then the correction results of the remaining pixels are calculated. The correction results of each pixel are fused with the original pixels of the image to be processed and output.

[0009] Preferably, the reference pixel is a G pixel, and the color difference includes a first color difference between R pixels and G pixels and a second color difference between B pixels and G pixels.

[0010] Preferably, correcting the color difference includes: calculating the characteristic values ​​of the color difference, wherein the characteristic values ​​of the color difference include the expected value, variance, covariance, residual, and residual variance of the color difference.

[0011] Preferably, the variance of the color difference is calculated assuming the expected value of the color difference is 0.

[0012] Preferably, the residual variance of the color difference is calculated assuming that the expected value of the residual of the color difference is 0. After obtaining the color difference and before calculating the characteristic value of the color difference, the color difference is filtered, and the residual and residual variance of the color difference are calculated using the values ​​before and after the color difference is filtered.

[0013] Preferably, correcting the color difference further includes: correcting the color difference using the linear least mean square error method.

[0014]

[0015]

[0016] in, , These are the first color difference between G pixels and R pixels, and the second color difference between G pixels and B pixels, respectively. , These represent the residuals of the first color difference and the residuals of the second color difference, respectively. , Let represent the expected values ​​of the first color difference and the second color difference, respectively. , Let represent the covariance of the first color difference and the covariance of the second color difference, respectively. , These are the first color difference correction result and the second color difference correction result, respectively.

[0017] Preferably, the dependent correction result is obtained by correcting the G pixel based on the color difference correction result:

[0018]

[0019] in, , These are correction results that depend on the color difference between the G pixel and the R and B pixels, respectively. , These are the first color difference correction result and the second color difference correction result, respectively. The dependent correction result is then... , To merge:

[0020]

[0021] in, , Let represent the covariance of the first color difference and the covariance of the second color difference, respectively. This is the correction result for G pixels.

[0022] Preferably, calculating the remaining pixels includes:

[0023]

[0024] , These are the correction results for R pixels and B pixels, respectively. The correction result is for G pixels. , These are the first color difference correction result and the second color difference correction result, respectively.

[0025] Preferably, the correction results of each pixel are fused with the original pixels of the image to be processed and output: the saturation of the original pixels of the image to be processed is used as a fusion factor, a correction curve related to saturation is generated using the fusion factor, and the correction results of each R, G, and B pixel are fused with the original R, G, and B pixels of the image to be processed.

[0026] This invention provides an image pseudo-color correction device, comprising:

[0027] An image input unit is used to input the image to be processed.

[0028] The color difference calculation unit uses the G pixel as the reference pixel to calculate the first color difference between the R pixel and the G pixel in the image to be processed and the second color difference between the B pixel and the G pixel.

[0029] The color difference correction unit calculates the characteristic values ​​of the first color difference and the second color difference, and corrects the first color difference and the second color difference based on the linear minimum mean square error method.

[0030] The G-pixel correction unit corrects the G-pixel according to the correction results of the first color difference and the second color difference respectively, and then fuses the dependent correction results obtained by relying on the first color difference and the second color difference to obtain the correction result of the G-pixel.

[0031] The R-pixel and B-pixel correction units calculate the correction results of the R-pixel and B-pixel based on the correction result of the G-pixel.

[0032] The data fusion output unit fuses the correction results of each pixel with the original pixels of the image to be processed and outputs the result.

[0033] The image pseudo-color correction method provided by this invention selects a reference pixel in the image to be processed, calculates the color difference between the remaining pixels and the reference pixel, and corrects the color difference; uses the corrected color difference to correct the reference pixel, fuses the obtained dependent correction results to obtain the corrected result of the reference pixel, then calculates the correction results of the remaining pixels, and fuses the correction results of each pixel with the original pixels of the image to be processed for output. This method provides a correction method using pixel color differences. After interpolation, the color difference is calculated and a series of corrections are performed on the color difference to correct the pixel. Furthermore, the R, G, and B pixel correction results are fused with the original pixels, which can eliminate pseudo-color without causing normal colors to be incorrectly corrected due to misjudgment. The method of judging and correcting pseudo-color through the color correlation between pixels effectively removes pseudo-color and restores the true colors of the image to the greatest extent.

[0034] The image pseudo-color correction device and the image pseudo-color correction method provided by this invention belong to the same inventive concept. Therefore, the image pseudo-color correction device provided by this invention has at least all the advantages of the image pseudo-color correction method provided by this invention, which will not be elaborated here. The image pseudo-color correction device includes: an image input unit for inputting an image to be processed; a color difference calculation unit for calculating a first color difference between R pixels and G pixels and a second color difference between B pixels and G pixels in the image to be processed, using G pixels as reference pixels; a color difference correction unit for calculating the feature values ​​of the first color difference and the second color difference, and correcting the first color difference and the second color difference based on the linear minimum mean square error method; and a G pixel correction unit for correcting the G pixels according to the correction results of the first color difference and the second color difference, and then combining the results obtained from the first color difference and the second color difference. The correction result of the G pixel is obtained by fusing the correction results; the R and B pixel correction units calculate the correction results of the R and B pixels based on the correction result of the G pixel; the data fusion output unit fuses the correction results of each pixel with the original pixels of the image to be processed and outputs the result. This provides a method of correction using pixel color difference. After interpolation, the color difference is calculated and a series of corrections are performed on the color difference to correct the pixel. Furthermore, the correction results of the R, G, and B pixels are fused with the original pixels, which can eliminate false color and prevent normal colors from being incorrectly corrected due to misjudgment. The method of judging and correcting false color based on the color correlation between pixels effectively removes false color and restores the true color of the image to the greatest extent. Attached Figure Description

[0035] Figure 1 This is a flowchart of the main process of an image pseudo-color correction method according to an embodiment of the present invention;

[0036] Figure 2This is a schematic diagram of a saturation weight curve according to an embodiment of the present invention;

[0037] Figure 3 This is a schematic diagram of an image pseudo-color correction device according to an embodiment of the present invention;

[0038] Figure 4 This is a detailed execution flowchart of an image pseudo-color correction device according to an embodiment of the present invention;

[0039] Figure 5 This is a flowchart of color difference correction in an image pseudo-color correction device according to an embodiment of the present invention;

[0040] Figure 6 This is a flowchart of G-pixel correction in an image pseudo-color correction device according to an embodiment of the present invention;

[0041] Figure 7 This is a flowchart of the data fusion output of an image pseudo-color correction device according to an embodiment of the present invention.

[0042] In the picture,

[0043] 1. Image input unit; 2. Color difference calculation unit; 3. Color difference correction unit; 4. G-pixel correction unit; 5. R / B-pixel correction unit; 6. Data fusion output unit. Detailed Implementation

[0044] The image pseudo-color correction method and apparatus proposed in this invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The advantages and features of this invention will become clearer from the following description. It should be noted that the drawings are all in a very simplified form and use non-precise proportions, used only to facilitate and clarify the illustration of the embodiments of this invention. It should be understood that the drawings do not necessarily show the specific structure of the invention to scale, and the illustrative features used to illustrate certain principles of the invention in the drawings are also drawn in a slightly simplified manner. Specific design features of the invention disclosed herein, including, for example, specific dimensions, orientations, positions, and shapes, will be determined in part by the specific application and usage environment. Furthermore, in the embodiments described below, the same reference numerals are sometimes used across different drawings to denote the same parts or parts having the same function, omitting repeated descriptions. In this specification, similar reference numerals and letters are used to denote similar items; therefore, once an item is defined in one drawing, it does not need to be further discussed in subsequent drawings.

[0045] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0046] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0047] The inventors discovered that Bayer images typically have a 1 / 2 ratio of G pixels and a 1 / 4 ratio of R / B pixels. Due to this arrangement, current methods for interpolating RGB images from Bayer images mainly involve first interpolating the missing G pixels, and then using the G pixels to interpolate the R / B pixels based on color correlation to obtain a color image. However, this processing method has limited effect in eliminating false colors.

[0048] Based on this, this application provides a method for correcting image pseudo-color, particularly a method for correcting pseudo-color generated during the process of interpolating a single-channel image into a color image. Please refer to [reference needed]. Figures 1-2 This is a schematic diagram of an embodiment of the present invention, as shown below. Figure 1 As shown, it includes the following steps:

[0049] A reference pixel is selected in the image to be processed, the color difference between the remaining pixels and the reference pixel is calculated, and the color difference is corrected.

[0050] The reference pixel is corrected using the color difference correction result. The obtained dependent correction results are fused to obtain the correction result of the reference pixel. Then the correction results of the remaining pixels are calculated. The correction results of each pixel are fused with the original pixels of the image to be processed and output.

[0051] This paper presents a method for correction using pixel color differences. After interpolation, the color difference is calculated and corrected sequentially to correct the pixel. Furthermore, the corrected pixel results are fused with the original pixel. This method eliminates false colors without misjudging and incorrectly correcting normal colors. After obtaining the Bayer image and performing RGB pixel interpolation, the method identifies and corrects false colors based on the color correlation between pixels, effectively removing false colors and maximizing the restoration of the image's true colors.

[0052] In one example, the reference pixel is the G pixel, and the color difference includes a first color difference between the R pixel and the G pixel and a second color difference between the B pixel and the G pixel. For a color RGB image, using the G pixel as the reference, the color difference values ​​between the remaining R pixels and B pixels and the G pixel are calculated as follows:

[0053]

[0054] After obtaining the desired color difference, a low-pass filter is applied to the color difference to reduce noise interference unrelated to the color difference. This filter includes, but is not limited to, low-pass filters, mean filters, median filters, and Laplacian filters, and can be adaptively set according to the image to be processed, and is not limited to the filters mentioned above.

[0055] Here, we will use a Gaussian filter as an example. The filter response function is as follows:

[0056]

[0057] The filtering process is as follows:

[0058]

[0059]

[0060] , To smooth the filtering result, i represents the i-th pixel, and L is the radius of the filter. The size of L is not limited, but a larger L does not necessarily mean a better filtering effect. Generally, L = 1 to 3 is sufficient and is not mandatory.

[0061] Specifically, correcting the color difference includes: calculating the characteristic values ​​of the color difference, which include the expected value, variance, covariance, residual, and residual variance of the color difference. Assuming the expected value of the color difference is 0, the variance of the color difference is calculated; assuming the expected value of the residual of the color difference is 0, the residual variance of the color difference is calculated. After obtaining the color difference but before calculating the characteristic values, the color difference is filtered, and the residual and residual variance of the color difference are calculated using the values ​​before and after filtering. Based on the filtered color difference, the color difference... and The expected value is calculated as follows:

[0062]

[0063]

[0064] In one implementation, it is assumed that , The expected value is 0. The variance is calculated as follows:

[0065]

[0066]

[0067] Where k and l are the horizontal and vertical radii of the sliding window, their values ​​are unrestricted and generally the same. The window size is not unique, and (i, j) represents the pixel in the i-th row and j-th column. More optimally, k=l=3 or k=l=5. If the sliding window is too large, its effect is not significantly improved compared to a smaller window, and it will increase the computational load, making it unsuitable for hardware implementation and cost-effective. Based on the calculated expected value and variance, color difference... and The covariance is calculated as follows:

[0068]

[0069]

[0070] As is understandable, we introduce the color difference before and after the filtering mentioned above, and calculate it separately. and , and The variance of the residuals. The residuals are calculated as follows:

[0071]

[0072]

[0073] Similarly, assuming residual , The expected value is 0, and the residual variance is calculated as follows:

[0074]

[0075] Specifically, the color difference is corrected based on the linear least mean square error method:

[0076]

[0077]

[0078] in, , These are the first color difference between G pixels and R pixels, and the second color difference between G pixels and B pixels, respectively. , To smooth the filtering results, express variance express variance express The residual variance express The residual variance , Let represent the expected values ​​of the first color difference and the second color difference after filtering, respectively. , Let represent the covariance of the first color difference and the covariance of the second color difference, respectively. , These are the first and second color difference correction results, respectively. After RGB interpolation, the color difference is calculated, and a series of color difference corrections are performed to correct the RGB values.

[0079] Due to the special position of the G pixel in an RGB image, the G pixel is corrected first. When correcting the G pixel based on the color difference correction result:

[0080]

[0081] in, , These are correction results that depend on the color difference between the G pixel and the R and B pixels, respectively. , These are the first color difference correction result and the second color difference correction result, respectively. The dependent correction result is then... , To merge:

[0082]

[0083] in, , Let represent the variances of the first color difference and the second color difference after filtering, respectively. This represents the correction result for G pixels. The above formula can be simplified as follows:

[0084]

[0085] Specifically, most of the pseudo-color in an RGB image is generated by the R / B interpolation process, and the interpolation of R / B pixels is closely related to G pixels. After G pixel correction, R / B pixels are corrected using the G pixel correction result and the color difference correction result. This makes the pseudo-color correction more effective. The calculation of other pixels includes:

[0086]

[0087] , These are the correction results for R pixels and B pixels, respectively. , These are the first color difference correction result and the second color difference correction result, respectively.

[0088] Specifically, the correction results of each pixel are fused with the original pixels of the image to be processed and output: the saturation of the original pixels of the image to be processed is used as a fusion factor, a correction curve related to saturation is generated using the fusion factor, and the correction results of each R, G, and B pixel are fused with the original R, G, and B pixels of the image to be processed.

[0089] Understandably, the correction results for R, G, and B pixels obtained above may contain overcorrections and not meet expectations. Therefore, the correction results are fused with the original pixel results to reduce the correction risk. First, saturation is calculated as the fusion factor Sat. Methods for calculating this fusion factor include converting to HSI, HSV, YCbCr, and YUV spaces, etc. There are multiple methods for obtaining saturation, but these are not limited to those described above. The following is a detailed explanation of the method for calculating saturation using the YCbCr space:

[0090]

[0091] The values ​​of alphaR1, alphaG1, alphaB1 and alphaR2, alphaG2, alphaB2 are the relevant weights, and their values ​​vary depending on the standard. For example, the values ​​differ between BT.601, BT.709 and BT.2020. Here are the parameters from the BT.709 standard for example use: alphaR1=-0.115, alphaG1=-0.385, alphaB1=0.5; alphaR2=0.5, alphaG2=-0.454, alphaB2=-0.046.

[0092] In one implementation, after obtaining Sat, the fusion coefficient alpha is calculated, which is the output correction curve related to saturation. Here, the correction curve is constructed using a two-threshold trisegment method:

[0093]

[0094] Where thL and thH are the lower and upper limits of the gradient threshold, respectively, refer to... Figure 2 In the diagram, the slope of the curve is positive, but it can obviously also be negative:

[0095]

[0096] This application only uses two thresholds and three curves for illustration. The relevant weights can be n (n>=1) thresholds and n+1 segments of a broken line curve, without specific restrictions. The obtained R, G, and B pixel correction results are then fused with the original R, G, and B pixels for output. The correction formula is related to the direction of the correction curve mentioned above. Where saturation is higher, the original R, G, and B pixel components are more abundant; where saturation is lower, the R, G, and B correction values ​​participate more in the calculation. The purpose of fusion is to eliminate false colors without causing incorrect correction of normal colors due to misjudgment. When the curve slope is positive, the calculation formula is as follows:

[0097]

[0098]

[0099]

[0100]

[0101] Secondly, when the slope of the correction curve is negative, the calculation formula is as follows:

[0102]

[0103]

[0104]

[0105]

[0106] Based on the same technical concept, this application also provides an image pseudo-color correction device, such as... Figure 3 As shown, it includes: image input unit 1, color difference calculation unit 2, color difference correction unit 3, G pixel correction unit 4, R / B pixel correction unit 5, and data fusion output unit 6. The functions of each unit are as follows:

[0107] Image input unit 1 is used to input the image to be processed.

[0108] Color difference calculation unit 2 uses G pixel as a reference pixel to calculate the first color difference between R pixel and G pixel in the image to be processed and the second color difference between B pixel and G pixel.

[0109] Color difference correction unit 3 calculates the characteristic values ​​of the first color difference and the second color difference, and corrects the first color difference and the second color difference based on the linear minimum mean square error method.

[0110] The G-pixel correction unit 4 corrects the G-pixel according to the correction results of the first color difference and the second color difference respectively, and then fuses the dependent correction results obtained by relying on the first color difference and the second color difference to obtain the correction result of the G-pixel.

[0111] R-pixel and B-pixel correction units, i.e. Figure 5 The R / B pixel correction unit 5 calculates the correction results of the R and B pixels based on the correction result of the G pixel.

[0112] The data fusion output unit 6 fuses the correction results of each pixel with the original pixels of the image to be processed and outputs the result.

[0113] This paper presents a method for correction using pixel color differences. After interpolation, the color difference is calculated and corrected sequentially to correct the pixel. Furthermore, the corrected pixel results are fused with the original pixel. This method eliminates false colors without misjudging and incorrectly correcting normal colors. After obtaining the Bayer image and performing RGB pixel interpolation, the method identifies and corrects false colors based on the color correlation between pixels, effectively removing false colors and maximizing the restoration of the image's true colors.

[0114] See Figure 4The detailed flowchart shows that in S1, the image to be processed input in image input unit 1 is an RGB color image. In S2, color difference calculation unit 2, each point in the RGB color image has three pixels: R, G, and B. Therefore, the color difference between the G and R pixels, and between the G and B pixels of each point are calculated separately. Then, low-pass filtering is applied to the color difference to reduce the risk of noise interference unrelated to the color difference. The type of filter is not limited, including but not limited to low-pass filters, mean filters, median filters, and Laplace filters, etc., which can achieve low-pass filtering function. In addition, the values ​​before and after color difference filtering are used to calculate the characteristic values ​​of the subsequent color difference.

[0115] refer to Figure 5 In each step of the color difference correction unit 3, this unit requires a sliding window of size k*l. Here, k and l can take the same or different values. Generally, k=l=3 or k=l=5 is used. If the sliding window is too large, its effect is not significantly improved compared to a smaller window, and it will also increase the amount of computation, which is not conducive to hardware implementation and has a low cost-performance ratio. However, this is not a limitation of the present invention, and the range of values ​​is not required.

[0116] In S301, the variance of color difference is calculated based on an expected value of 0, which simplifies the calculation. Then, the covariance is calculated based on the calculated expected value and variance.

[0117] In S302, the residuals and residual variances are calculated using the color differences before and after filtering: the variance of the difference between the R pixel color difference and the color difference filtering result, and the variance of the difference between the B pixel color difference and the color difference filtering result. Similarly, assuming the expected value of the difference, i.e., the residual, is 0, the residual variances are calculated. Finally, in S303, the linear minimum mean square error method is used to correct the color difference filtering result using the calculation results of S301 and S302.

[0118] In S4, due to the special status of the G pixel in the RGB image, the G pixel is first corrected using the G pixel correction unit 4, such as... Figure 6 As shown, in S401, the color difference correction results of the preceding R and B pixels are used to correct the G pixel. In S402, the two dependent correction result values ​​are fused, and the filtered color difference variance is used as the fusion weight.

[0119] In S5, for R / B pixel correction unit 5, R / B pixels are corrected using G pixel correction results and color difference correction results to obtain a more realistic color image.

[0120] like Figure 7As shown, the corrected R, G, and B pixel results obtained in S4 and S5 are fused with the original pixels to ensure the accuracy of the correction results. In S601, the saturation Sat is calculated. The saturation calculation uses methods such as conversion to HSI, HSV, or YCbCr (or YUV) space. These conversion spaces are characterized by separating color and brightness information, which do not interfere with each other; no specific restrictions are imposed here. This example uses conversion to YCbCr (or YUV) space to simply calculate the saturation Sat from Cb and Cr. The weights of Cb and Cr differ in BT.601, BT.709, and BT.2020; this invention can use the parameters of the BT.709 standard without specific requirements.

[0121] In the subsequent generation of the correction curve, i.e. Figure 7 In S602, the fusion weight alpha, or correction curve, is calculated based on saturation. The correction curve is a line with n (n>=1) thresholds and n+1 segments; the number of thresholds is not specifically limited. In one example, two thresholds are used to construct the correction curve using three segments, and the slope of the correction curve can be positive or negative. Further, the corrected values ​​of R, G, and B pixels are fused with the original R, G, and B pixels. Where saturation is higher, more components of the original R, G, and B pixels are represented; where saturation is lower, more components of the corrected R, G, and B pixel values ​​are involved in the calculation. This fusion eliminates false colors without causing incorrect correction of normal colors due to misjudgment.

[0122] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0123] In summary, the image pseudo-color correction method and apparatus provided in this invention firstly utilizes the color difference of R, G, and B pixels for correction. After interpolation, the color difference is calculated and a series of corrections are applied to the color difference to correct the R, G, and B pixels. Furthermore, a sliding window is introduced during variance calculation, and the window size is not unique. Secondly, considering the importance of the G pixel, the G pixel is corrected first based on the color difference correction value. Then, the R / B pixels are corrected based on the G pixel correction result. During the G pixel correction process, it is related to the original R / B pixels and the color difference correction result. The correction results are then fused, and the variance related to the color difference is used as a weight. Finally, saturation is used as a fusion weight to fuse the R, G, and B pixel correction results with the original R, G, and B pixels. This fusion eliminates pseudo-color without causing incorrect correction of normal colors due to misjudgment. The above method of judging and correcting pseudo-color based on the color correlation between pixels can effectively remove pseudo-color and restore the true colors of the image to the greatest extent.

[0124] The above description is merely a description of preferred embodiments of the present invention and is not intended to limit the scope of the present invention in any way. Any changes or modifications made by those skilled in the art based on the above disclosure shall fall within the protection scope of the claims.

Claims

1. A method for correcting false color in images, characterized in that, Includes the following steps: A reference pixel is selected in the image to be processed. The color difference between the remaining pixels and the reference pixel is calculated. Each color difference is then corrected. The color difference correction includes: filtering the color difference, calculating the feature value of the color difference, which includes the expected value, variance, covariance of the color difference after filtering, and the residual and residual variance calculated based on the values ​​before and after color difference filtering. The correction result of each color difference is obtained by using the linear minimum mean square error method in combination with the feature value of the color difference. The color difference correction result is added to the corresponding pixel value to obtain the base pixel's dependent correction result based on the corresponding pixel. The obtained dependent correction results are fused to obtain the base pixel's correction result. The base pixel's correction result is subtracted from the color difference correction results of the other pixels to obtain the correction results of the other pixels. The correction results of each pixel are fused with the original pixels of the image to be processed and output. The correction results of each pixel are fused with the original pixels of the image to be processed and output: the saturation of the original pixels of the image to be processed is used as the fusion factor, the fusion factor is used to generate a correction curve related to saturation, the fusion weight is obtained according to the correction curve, and the correction results of each pixel of R, G, and B are fused with the original R, G, and B pixels of the image to be processed using the fusion weight.

2. The image pseudo-color correction method as described in claim 1, characterized in that, The reference pixel is a G pixel, and the color difference includes a first color difference between R pixels and G pixels and a second color difference between B pixels and G pixels.

3. The image pseudo-color correction method as described in claim 2, characterized in that, Calculate the variance of the color difference, assuming the expected value of the color difference is 0.

4. The image pseudo-color correction method as described in claim 2, characterized in that, Assuming the expected value of the residual of the color difference is 0, the residual variance of the color difference is calculated. After obtaining the color difference, but before calculating the characteristic value of the color difference, the color difference is filtered, and the residual and residual variance of the color difference are calculated using the values ​​before and after the color difference is filtered.

5. The image pseudo-color correction method as described in claim 2, characterized in that, Correcting the color difference further includes: correcting the color difference using the linear least mean square error method. in, , These are the first color difference between G pixels and R pixels, and the second color difference between G pixels and B pixels, respectively. , To smooth the filtering results, express variance express variance express The residual variance express The residual variance , Let represent the expected values ​​of the first color difference and the second color difference after filtering, respectively. , Let represent the covariance of the first color difference and the covariance of the second color difference, respectively. , These are the first color difference correction result and the second color difference correction result, respectively.

6. The image pseudo-color correction method as described in claim 5, characterized in that, The dependent correction result is obtained by correcting the G pixel based on the color difference correction result: in, , These are correction results that depend on the color difference between the G pixel and the R and B pixels, respectively. , These are the first color difference correction result and the second color difference correction result, respectively. The dependent correction result is then... , To merge: in, , Let represent the variances of the first color difference and the second color difference after filtering, respectively. This is the correction result for G pixels.

7. The image pseudo-color correction method as described in claim 2, characterized in that, The calculation of the remaining pixels includes: , These are the correction results for R pixels and B pixels, respectively. The correction result is for G pixels. , These are the first color difference correction result and the second color difference correction result, respectively.

8. An image pseudo-color correction device, characterized in that, include: An image input unit is used to input the image to be processed. The color difference calculation unit uses the G pixel as the reference pixel to calculate the first color difference between the R pixel and the G pixel in the image to be processed and the second color difference between the B pixel and the G pixel. The color difference correction unit filters the color difference, calculates the characteristic values ​​of the first color difference and the second color difference, and corrects the first color difference and the second color difference based on the linear minimum mean square error method combined with the characteristic values ​​of the color difference. The characteristic values ​​of the color difference include the expected value, variance, covariance of the color difference after filtering, and the residual and residual variance calculated based on the values ​​before and after color difference filtering. The G-pixel correction unit adds the correction results of the first color difference and the second color difference to the corresponding pixel value to obtain a dependent correction result, and then fuses the obtained dependent correction results to obtain the correction result of the G-pixel. Correcting the G-pixel using the correction results of the first color difference and the second color difference includes: The R-pixel and B-pixel correction units subtract the correction result of the G-pixel from the color difference correction results of the other pixels to obtain the correction results of the R-pixel and B-pixel. The data fusion output unit fuses the correction results of each pixel with the original pixels of the image to be processed and outputs the fusion results of each pixel with the original pixels of the image to be processed: the saturation of the original pixels of the image to be processed is used as a fusion factor, a correction curve related to saturation is generated using the fusion factor, a fusion weight is obtained based on the correction curve, and the correction results of each R, G, B pixel are fused with the original R, G, B pixels of the image to be processed using the fusion weight.

Citation Information

Patent Citations

  • Method for demosaicing color filtering array image based on outline non-local mean value

    CN103595980A

  • Method for solving pseudo-color problem in Bayer image interpolation algorithm

    CN116416126A