CN117808715A - Image pseudo-color correction method and device - Google Patents
Image pseudo-color correction method and device Download PDFInfo
- Publication number
- CN117808715A CN117808715A CN202311845555.1A CN202311845555A CN117808715A CN 117808715 A CN117808715 A CN 117808715A CN 202311845555 A CN202311845555 A CN 202311845555A CN 117808715 A CN117808715 A CN 117808715A
- Authority
- CN
- China
- Prior art keywords
- pixel
- color difference
- correction
- chromatic aberration
- image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012937 correction Methods 0.000 title claims abstract description 175
- 238000000034 method Methods 0.000 title claims abstract description 57
- 230000004075 alteration Effects 0.000 claims abstract description 111
- 230000001419 dependent effect Effects 0.000 claims abstract description 15
- 230000004927 fusion Effects 0.000 claims description 28
- 238000004364 calculation method Methods 0.000 claims description 15
- 238000001914 filtration Methods 0.000 claims description 12
- 238000012545 processing Methods 0.000 abstract description 2
- 230000000694 effects Effects 0.000 description 7
- 230000008569 process Effects 0.000 description 6
- 239000003086 colorant Substances 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 230000002596 correlated effect Effects 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 239000006185 dispersion Substances 0.000 description 1
- 230000008030 elimination Effects 0.000 description 1
- 238000003379 elimination reaction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000009499 grossing Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000005316 response function Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Landscapes
- Image Processing (AREA)
Abstract
The invention discloses an image pseudo-color correction method and device, which belong to the technical field of image processing, and the image pseudo-color correction method comprises the following steps: selecting a reference pixel in an image to be processed, calculating chromatic aberration between other pixels and the reference pixel, and correcting the chromatic aberration; and correcting the reference pixel by using the correction result of the chromatic aberration, fusing the obtained dependent correction result to obtain the correction result of the reference pixel, calculating the correction results of other pixels, and fusing and outputting the correction result of each pixel with the original pixel of the image to be processed. The method for judging and correcting the pseudo color through the color correlation among the pixels effectively removes the pseudo color and furthest restores the true color of the image.
Description
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method and an apparatus for correcting pseudo color of an image.
Background
The color imaging device may have some unreal colors, i.e. false colors, in the captured image when capturing the image in an environment with strong contrast due to the dispersion and diffraction characteristics of the lens and the influence of the image sensor and the image interpolation mode, which affects the real effect of the image.
The false color is mainly caused by interpolation of some error information when the device acquisition module interpolates the acquired original single-channel Bayer data into three-channel RGB data. At present, two main methods for correcting pseudo color exist: a method is to correct in RGB interpolation, mainly make G pixel of interpolation more accurate, thus R/B pixel interpolation is more accurate too, the problem of this method is too concerned with the interpolation result of G pixel, it is simpler to process R/B interpolation, the elimination effect of pseudo-color is limited; another method is to correct after RGB interpolation is completed, and this method mainly uses the judgment of moire area to correct color. The problem with this type of method is that the false color cannot be eliminated in the region that does not meet the moire region determination characteristics.
It should be noted that the information disclosed in this background section is only for enhancement of understanding of the general background of the invention and should not be taken as an acknowledgement or any form of suggestion that this information forms the prior art already known to a person skilled in the art.
Disclosure of Invention
The invention aims to provide an image pseudo-color correction method and device, which are used for solving the problem that the correction effect of a conventional method on pseudo-color is limited.
In order to solve the technical problems, the invention provides an image pseudo-color correction method, which comprises the following steps:
selecting a reference pixel in an image to be processed, calculating chromatic aberration between other pixels and the reference pixel, and correcting the chromatic aberration;
and correcting the reference pixel by using the correction result of the chromatic aberration, fusing the obtained dependent correction result to obtain the correction result of the reference pixel, calculating the correction results of other pixels, and fusing and outputting the correction result of each pixel with the original pixel of the image to be processed.
Preferably, the reference pixel is a G pixel, and the color difference includes a first color difference between an R pixel and the G pixel and a second color difference between a B pixel and the G pixel.
Preferably, correcting the chromatic aberration includes: and calculating the characteristic value of the chromatic aberration, wherein the characteristic value of the chromatic aberration comprises an expected value, a variance, a covariance, a residual error and a residual error variance of the chromatic aberration.
Preferably, the variance of the color difference is calculated assuming that the expected value of the color difference is 0.
Preferably, the residual variance of the chromatic aberration is calculated assuming that the expected value of the residual of the chromatic aberration is 0, wherein after the chromatic aberration is obtained, the chromatic aberration is also filtered before the chromatic aberration characteristic value is calculated, and the residual and residual variance of the chromatic aberration are calculated using the values before and after the chromatic aberration filtering.
Preferably, correcting the chromatic aberration further comprises: correcting the chromatic aberration using a linear least mean square error method:
wherein Δgr and Δgb are the first color difference between the G pixel and the R pixel, and the second color difference between the G pixel and the B pixel, respectively, diffΔgrf and diffΔ GBf represent the residual error of the first color difference and the residual error of the second color difference, respectively, E GRf 、E GBf Respectively representing the expected value of the first color difference and the expected value of the second color difference, cov GR 、cov GB Covariance of the first color difference, covariance of the second color difference, Δgr, respectively new 、ΔGB new The first color difference correction result and the second color difference correction result are respectively obtained.
Preferably, correcting the G pixel according to the correction result of the chromatic aberration to obtain the dependent correction result:
G R =R+ΔGR new
G B =B+ΔGB new
wherein G is R 、G B For the correction result, delta GR is obtained by the color difference of the R pixel and the B pixel for the G pixel new 、ΔGB new Respectively a first chromatic aberration correction result and a second chromatic aberration correction result, and correcting the dependent correction result G R 、G B Fusion is carried out:
wherein Var is GRf 、Var GBf Covariance of the first color difference, covariance of the second color difference, G new The correction result for the G pixel.
Preferably, calculating the remaining pixels comprises:
R new =G new -ΔGR new
B new =G new -ΔGB new
R new 、B new correction results of R pixel and B pixel respectively, G new As a result of correction of G pixels, deltaGR new 、ΔGB new The first color difference correction result and the second color difference correction result are respectively obtained.
Preferably, the correction result of each pixel is fused with the original pixel of the image to be processed and output: and taking the saturation of the original pixel of the image to be processed as a fusion factor, generating a correction curve related to the saturation by using the fusion factor, and fusing the correction result of each pixel of R, G, B with the original R, G, B pixel of the image to be processed.
The invention provides an image pseudo-color correction device, comprising: ,
an image input unit for inputting an image to be processed;
a color difference calculation unit that calculates a first color difference between an R pixel and the G pixel and a second color difference between a B pixel and the G pixel in the image to be processed, with the G pixel as a reference pixel;
the chromatic aberration correcting unit is used for calculating characteristic values of the first chromatic aberration and the second chromatic aberration and correcting the first chromatic aberration and the second chromatic aberration based on a linear minimum mean square error method;
the G pixel correction unit is used for respectively correcting the G pixels according to the correction results of the first chromatic aberration and the second chromatic aberration, and then fusing the dependent correction results obtained by the first chromatic aberration and the second chromatic aberration to obtain the correction results of the G pixels;
an R pixel and B pixel correction unit for calculating the correction results of the R pixel and the B pixel according to the correction results of the G pixel;
and the data fusion output unit is used for carrying out fusion output on the correction result of each pixel and the original pixel of the image to be processed.
According to the image pseudo-color correction method provided by the invention, a reference pixel is selected in an image to be processed, the chromatic aberration between other pixels and the reference pixel is calculated, and the chromatic aberration is corrected; and correcting the reference pixel by using the correction result of the chromatic aberration, fusing the obtained dependent correction result to obtain the correction result of the reference pixel, calculating the correction results of other pixels, and fusing and outputting the correction result of each pixel with the original pixel of the image to be processed. The method for correcting the chromatic aberration of the pixels is provided, the chromatic aberration is calculated after interpolation, the pixels are corrected after the chromatic aberration is corrected in series, and further, the R, G, B pixel correction result is fused with the original pixels, so that the false color can be eliminated, and the normal color can not be corrected in error due to judgment errors. The method for judging and correcting the pseudo color through the color correlation among the pixels effectively removes the pseudo color and furthest restores the true color of the image.
The image pseudo-color correction device provided by the invention and the image pseudo-color correction method provided by the invention belong to the same invention conception, so that the image pseudo-color correction device provided by the invention at least has all advantages of the image pseudo-color correction method provided by the invention, and is not repeated here. The image pseudo-color correction device comprises an image input unit, a color correction unit and a color correction unit, wherein the image input unit is used for inputting an image to be processed; a color difference calculation unit that calculates a first color difference between an R pixel and a G pixel and a second color difference between a B pixel and the G pixel in an image to be processed, with the G pixel as a reference pixel; the chromatic aberration correcting unit is used for calculating characteristic values of the first chromatic aberration and the second chromatic aberration and correcting the first chromatic aberration and the second chromatic aberration based on a linear minimum mean square error method; the G pixel correction unit is used for respectively correcting the G pixels according to the correction results of the first chromatic aberration and the second chromatic aberration, and then fusing the dependent correction results obtained by the first chromatic aberration and the second chromatic aberration to obtain the correction results of the G pixels; an R pixel and B pixel correction unit for calculating the correction results of the R pixel and the B pixel according to the correction results of the G pixel; the data fusion output unit is used for fusing the correction result of each pixel with the original pixel of the image to be processed to provide a mode of correcting by utilizing the pixel chromatic aberration, calculating the chromatic aberration after interpolation, correcting the pixel after the chromatic aberration is corrected in series, and further, fusing the R, G, B pixel correction result with the original pixel, so that the false color can be eliminated, and the normal color can not be corrected by mistake due to judgment errors. The method for judging and correcting the pseudo color through the color correlation among the pixels effectively removes the pseudo color and furthest restores the true color of the image.
Drawings
FIG. 1 is a main flow chart of an image pseudo-color correction method according to an embodiment of the present invention;
FIG. 2 is a graph illustrating saturation weight according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an image pseudocolor correction device according to an embodiment of the invention;
FIG. 4 is a flowchart illustrating a detailed implementation of an image pseudocolor correction device according to an embodiment of the present invention;
FIG. 5 is a flow chart of color difference correction of an image pseudocolor correction device according to an embodiment of the present invention;
FIG. 6 is a flow chart of G pixel correction of an image pseudocolor correction device according to an embodiment of the invention;
fig. 7 is a flowchart of data fusion output of an image pseudocolor correction device according to an embodiment of the invention.
In the drawing the view of the figure,
1. an image input unit; 2. a color difference calculation unit; 3. a chromatic aberration correction unit; 4. a G pixel correction unit; 5. an R/B pixel correction unit; 6. and a data fusion output unit.
Detailed Description
The method and the device for correcting the pseudo-color of the image provided by the invention are further described in detail below with reference to the accompanying drawings and the specific embodiments. The advantages and features of the present invention will become more apparent from the following description. It should be noted that the drawings are in a very simplified form and are all to a non-precise scale, merely for convenience and clarity in aiding in the description of embodiments of the invention. It should be understood that the drawings are not necessarily to scale, emphasis instead being placed upon illustrating the principles of the invention. Specific design features of the invention disclosed herein, including for example, specific dimensions, orientations, positions, and configurations, will be determined in part by the specific intended application and use environment. In the embodiments described below, the same reference numerals are used in common between the drawings to denote the same parts or parts having the same functions, and the repetitive description thereof may be omitted. In this specification, like reference numerals and letters are used to designate like items, and thus once an item is defined in one drawing, no further discussion thereof is necessary in subsequent drawings.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present invention, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
The inventor researches that the Bayer image generally has a G pixel ratio of 1/2 and R/B of 1/4, and because of the arrangement characteristic, the existing method for interpolating the RGB image by the Bayer image mainly interpolates the missing G pixel first, then interpolates the R/B pixel by using the G pixel according to the color correlation, so as to obtain the color image, and the pseudo-color eliminating effect of the processing method is limited.
Based on this, the present application provides a method for correcting pseudo-color of an image, particularly a method for correcting pseudo-color generated in a process of interpolating a single-channel image into a color image, please refer to fig. 1-2, which are schematic diagrams of an embodiment of the present invention, as shown in fig. 1, comprising the following steps:
selecting a reference pixel in the image to be processed, calculating the chromatic aberration between the rest pixels and the reference pixel, and correcting the chromatic aberration.
And correcting the reference pixel by using the correction result of the chromatic aberration, fusing the obtained dependent correction result to obtain the correction result of the reference pixel, calculating the correction results of other pixels, and fusing and outputting the correction result of each pixel with the original pixel of the image to be processed.
The method for correcting the chromatic aberration of the pixels is provided, the chromatic aberration is calculated after interpolation, the pixels are corrected after the chromatic aberration is corrected in series, and further, the correction results of the pixels are fused with the original pixels, so that the false color can be eliminated, and the normal color can not be corrected in error due to judgment errors. After the Bayer image is obtained and RGB pixel interpolation is completed, the false color is effectively removed and the true color of the image is restored to the maximum extent by a method for judging and correcting the false color through the color correlation among pixels.
In one example, the reference pixel is a G pixel, and the color difference includes a first color difference between an R pixel and a G pixel and a second color difference between a B pixel and a G pixel. For a colored RGB image, with a G pixel as a reference, color difference values between the rest R pixels and B pixels and the G pixel are calculated as follows:
ΔGR=G-R
ΔGB=G-B
after the desired color difference is obtained, the color difference is also low pass filtered to reduce noise interference independent of the color difference. The filters herein include, but are not limited to, low-pass filters, mean filters, median filters, laplace filters, etc., which can be adaptively set according to the image to be processed, and are not limited to the above filters.
A gaussian filter is described here as an example. The filter response function is as follows:
the filtering process is as follows:
Δgrf and Δ GBf are smoothing filter results, L is a radius of the filter, and L is not limited in size, but the larger L is not, the better the filter effect is, but generally l=1 to 3 is taken, and no forced requirement is required.
Specifically, correcting the chromatic aberration includes: and calculating the characteristic value of the chromatic aberration, wherein the characteristic value of the chromatic aberration comprises an expected value, a variance, a covariance, a residual error and a residual error variance of the chromatic aberration. Calculating a variance of the chromatic aberration assuming that an expected value of the chromatic aberration is 0, and calculating a residual variance of the chromatic aberration assuming that an expected value of a residual of the chromatic aberration is 0, wherein after the chromatic aberration is obtained, filtering the chromatic aberration is further performed before calculating the characteristic value of the chromatic aberration, and calculating the residual of the chromatic aberration and the residual variance using values before and after the chromatic aberration filtering. Based on the above-described filtered color differences, the expected values of the color differences Δgrf and Δ GBf are calculated as follows:
in one embodiment, variance calculation is performed assuming that the expected values of Δgrf, Δ GBf are 0, as follows:
the values of k and l are not limited, and the same value is generally adopted, so that the size of the window is not unique. More preferably, k=l=3 or k=l=5 is taken, if the sliding window is too large, the effect is not improved greatly compared with a smaller window, the calculated amount is increased, the hardware implementation is not facilitated, and the cost performance is not high. Based on the calculated expected values and variances, the covariances of the chromatic aberration Δgrf and Δ GBf are calculated as follows:
cov GR =Var GRf -E GRf E GRf
cov GB =Var GBf -E GBf E GBf
it will be appreciated that the chromatic aberration before and after the above filtering is introduced here, and the variances of the residuals for Δgr and Δgrf, Δgb and Δ GBf are calculated, respectively. The residual was calculated as follows:
diffΔGRf=|ΔGR(i,j)-ΔGRf(i,j)|
diffΔGBf=|ΔGB(i,j)-ΔGBf(i,j)|
similarly, assuming that the expected values of residual diffΔgrf, diffΔ GBf are 0, the residual variance is calculated as follows:
specifically, the chromatic aberration is corrected based on a linear minimum mean square error method:
wherein Δgr and Δgb are the first color difference between the G pixel and the R pixel, and the second color difference between the G pixel and the B pixel, respectively, diffΔgrf and diffΔ GBf represent the residual error of the first color difference and the residual error of the second color difference, respectively, E GRf 、E GBf Respectively representing the expected value of the first color difference and the expected value of the second color difference, cov GR 、cov GB Covariance of the first color difference, covariance of the second color difference, Δgr, respectively new 、ΔGB new The first color difference correction result and the second color difference correction result are respectively obtained. By calculating colour difference after RGB interpolationAfter the series correction is performed on the chromatic aberration, the RGB is corrected.
Because of the special position of the G pixel in the RGB image, the G pixel is corrected in advance, and when the G pixel is corrected according to the correction result of the chromatic aberration:
G R =R+ΔGR new
G B =B+ΔGB new
wherein G is R 、G B For the correction result, delta GR is obtained by the color difference of the R pixel and the B pixel for the G pixel new 、ΔGB new Respectively a first chromatic aberration correction result and a second chromatic aberration correction result, and correcting the dependent correction result G R 、G B Fusion is carried out:
wherein Var is GRf 、Var GBf Covariance of the first color difference, covariance of the second color difference, G new The correction result for the G pixel. The above formula is simplified as follows:
specifically, the pseudo-color of the RGB image is mostly generated by the R/B interpolation process, and the interpolation of R/B pixels is more correlated with G pixels. After correction of the G pixel, the R/B pixel is corrected by using the correction result of the G pixel and the correction result of the chromatic aberration, so that correction of the pseudo color can be more effective, and the calculation of the rest pixels comprises:
R new =G new -ΔGR new
B new =G new -ΔGB new
R new 、B new correction results of R pixel and B pixel respectively, delta GR new 、ΔGB new The first color difference correction result and the second color difference correction result are respectively obtained.
Specifically, the correction result of each pixel is fused with the original pixel of the image to be processed and output: and taking the saturation of the original pixel of the image to be processed as a fusion factor, generating a correction curve related to the saturation by using the fusion factor, and fusing the correction result of each pixel of R, G, B with the original R, G, B pixel of the image to be processed.
It will be appreciated that the above-described correction result for R, G, B pixels may be overcorrected and not expected, and thus the correction result and the original pixel result are fused to reduce the correction risk. Firstly, calculating saturation as a fusion factor Sat, wherein the method for calculating the fusion factor comprises the following steps: there are various methods for obtaining saturation, but not limited to, converting to HSI space, HSV space, YCbCr space, YUV space, and the like. The method of calculating saturation based on the use of YCbCr space is described in detail below:
Cb=alphaR1*R+alphaG1*G+alphaB1*B
Cr=alphaR2*R+alphaG2*G+alphaB2*B
Sat=|Cb|+|Cr|
wherein, the values of the alphaR1, the alphaG1, the alphaB1, the alphaR2, the alphaG2, and the alphaB2 are related weights, and are different according to different standards, for example, the values of bt.601, bt.709, and bt.2020 are also different, and parameters of the bt.709 standard are provided for use in the examples: alphar1= -0.115, alphag1= -0.385, alphab1= 0.5; alphar2=0.5, alphag2= -0.454, alphab2= -0.046.
In one embodiment, the fusion coefficient alpha is calculated after Sat is obtained, i.e. the correction curve is output in relation to saturation, where the correction curve is constructed in the manner of only two threshold three-segment lines:
wherein thL and thH are lower and upper gradient threshold values, and referring to the schematic diagram in FIG. 2, the slope of the curve is positive, and obviously can be negative:
the application only uses two threshold three-section curves to describe, the related weight can be n (n > =1) threshold values, and the curve of n+1 section fold lines is not particularly limited. And then fusing the obtained R, G, B pixel correction result with the original R, G, B pixels to output. The correction formula is related to the trend of the correction curve, the higher the saturation is, the more components of original R, G, B pixels are, the lower the saturation is, the more components of R, G, B correction values participate in calculation are, and the purpose of fusion is to eliminate false colors and prevent the normal colors from being corrected by errors due to judgment errors. When the slope of the curve is positive, the calculation formula is as follows:
R out =R new *(1-alphaP)+R*alphaP
G out =G new *(1-alphaP)+G*alphaP
B out =B new *(1-alphaP)+B*alphaP
alphaP∈[0,1]
secondly, when the slope of the correction curve is negative, the calculation formula is as follows:
R out =R*(1-alphaN)+R new *alphaN
G out =G*(1-alphaN)+G new *alphaN
B out =B*(1-alphaN)+B new *alphaN
alphaN∈[0,1]
based on the same technical concept, the present application further provides an image pseudo-color correction device, as shown in fig. 3, including: an image input unit 1, a color difference calculation unit 2, a color difference correction unit 3, a G pixel correction unit 4, an R/B pixel correction unit 5, and a data fusion output unit 6, each of which functions as follows:
an image input unit 1 for inputting an image to be processed.
And a color difference calculating unit 2 for calculating a first color difference between an R pixel and the G pixel and a second color difference between a B pixel and the G pixel in the image to be processed by using the G pixel as a reference pixel.
And a chromatic aberration correcting unit 3 for calculating the characteristic values of the first chromatic aberration and the second chromatic aberration and correcting the first chromatic aberration and the second chromatic aberration based on a linear minimum mean square error method.
And 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 the first color difference and the second color difference to obtain the correction result of the G pixel.
The R pixel and B pixel correction unit, i.e. the R/B pixel correction unit 5 in fig. 5, calculates the correction results of the R pixel and the B pixel according to the correction result of the G pixel.
And the data fusion output unit 6 is used for carrying out fusion output on the correction result of each pixel and the original pixel of the image to be processed.
The method for correcting the chromatic aberration of the pixels is provided, the chromatic aberration is calculated after interpolation, the pixels are corrected after the chromatic aberration is corrected in series, and further, the correction results of the pixels are fused with the original pixels, so that the false color can be eliminated, and the normal color can not be corrected in error due to judgment errors. After the Bayer image is obtained and RGB pixel interpolation is completed, the false color is effectively removed and the true color of the image is restored to the maximum extent by a method for judging and correcting the false color through the color correlation among pixels.
Referring to the detailed flowchart of fig. 4, in S1, the image to be processed input in the image input unit 1 is an RGB color image, and in the color difference calculating unit 2 of S2, each point of the RGB color image has three pixels R, G, B, so that the color differences of the G pixel and the R pixel, and the G pixel and the B pixel of each point are calculated respectively, and then the color differences are low-pass filtered, so that noise interference risks unrelated to the color differences are reduced. The types of the filters are not limited, and include but are not limited to low-pass filters, average filters, median filters, laplacian filters and other filters capable of realizing the low-pass filtering function, and values before and after color difference filtering are used for calculating characteristic values of subsequent color differences.
Referring to each step in the chromatic aberration correcting unit 3 in fig. 5, the unit needs a sliding window with k×l, where k and l can take the same or different values, in general, k=l=3 or k=l=5, if the sliding window is too large, the effect is not improved greatly, the calculation amount is increased, the hardware implementation is not facilitated, and the cost performance is not high. However, this is not a limitation of the present invention, and the range of values is not required.
In S301, the variance of the color difference is calculated based on the expected value of 0, simplifying the calculation, and then the covariance is calculated based on the calculated expected value and variance.
In S302, a residual error and a residual error variance are calculated using the color differences before and after filtering: the variance of the difference of the R pixel color difference and the color difference filtering result and the variance of the difference of the B pixel color difference and the color difference filtering result. Similarly, assuming that the difference, i.e., the expected value of the residual is 0, the residual variance is calculated. Finally, in S303, the color difference filtering result is corrected using the calculation results of S301 and S302 using the linear minimum mean square error method.
In S4, due to the special position of the G pixel in the RGB image, the G pixel is corrected by the G pixel correction unit 4, as shown in fig. 6, the G pixel is corrected by using the correction result of the R, B pixel color difference in the preamble in S401, and the two obtained correction result dependent values are fused in S402, and the filtered color difference variance is used as the fusion weight.
In S5, for the R/B pixel correction unit 5, the R/B pixel is corrected using the G pixel correction result and the color difference correction result, to obtain a more realistic color image.
As shown in fig. 7, the correction results of the R, G and B pixels 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, where the saturation Sat is calculated by, for example, converting to an HSI space, an HSV space, or a YCbCr (or YUV) space, and the converted space is characterized by separating color information and luminance information, and the like, which are not interfered with each other, and are not particularly limited herein. Taking conversion to YCbCr (or YUV) space as an example only, the saturation Sat is simply calculated from Cb, cr. Cb. The weight of Cr is not nearly the same as the values of BT.601, BT.709 and BT.2020, and the invention can adopt parameters of BT.709 standard without specific requirements.
In the subsequent correction curve generating process, that is, in S602 in fig. 7, the fusion weight alpha is calculated according to the saturation, and the correction curve is a curve with n (n > =1) thresholds, where n+1 segments of fold lines, and the number of the thresholds is not specifically limited. In one example, two threshold three-segment lines construct a correction curve with a slope of positive or negative values. Further, the correction value of R, G, B pixels is fused with the original R, G, B pixels. The higher the saturation is, the more components of the original R, G, B pixels are, and the lower the saturation is, the more components of R, G, B pixels are involved in calculation, so that the pseudo color can be eliminated through fusion, and the normal color cannot be corrected by mistake due to judgment errors.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may 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)), etc.
In summary, in the method and the device for correcting the pseudo-color of the image provided by the embodiment of the invention, firstly, a correction mode is provided by utilizing R, G, B pixel chromatic aberration, after interpolation, the chromatic aberration is corrected in series by calculating the chromatic aberration, R, G, B pixels are corrected, and further, a sliding window is introduced during variance calculation, and the size of the window is not unique; secondly, considering the importance of the G pixel, correcting the G pixel according to the correction value of the chromatic aberration, correcting the R/B pixel according to the correction result of the G pixel, correlating with the original R/B pixel and the chromatic aberration correction result in the correction process of the G pixel, fusing the correction results, and using the chromatic aberration correlated variance as a weight; then, the saturation is used as a fusion weight, and the R, G, B pixel correction result is fused with the original R, G, B pixel, so that the pseudo color can be eliminated through fusion, and the normal color cannot be corrected by mistake due to judgment errors. The method for judging and correcting the pseudo color through the color correlation among the pixels can effectively remove the pseudo color and restore the true color of the image to the maximum extent.
The above description is only illustrative of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention, and any alterations and modifications made by those skilled in the art based on the above disclosure shall fall within the scope of the appended claims.
Claims (10)
1. A method for correcting false color of an image, comprising the steps of:
selecting a reference pixel in an image to be processed, calculating chromatic aberration between other pixels and the reference pixel, and correcting the chromatic aberration;
and correcting the reference pixel by using the correction result of the chromatic aberration, fusing the obtained dependent correction result to obtain the correction result of the reference pixel, calculating the correction results of other pixels, and fusing and outputting the correction result of each pixel with the original pixel of the image to be processed.
2. The method of claim 1, wherein the reference pixel is a G pixel, and the color difference includes a first color difference between an R pixel and the G pixel and a second color difference between a B pixel and the G pixel.
3. The method of correcting an image false color as defined in claim 2, wherein correcting the color difference includes: and calculating the characteristic value of the chromatic aberration, wherein the characteristic value of the chromatic aberration comprises an expected value, a variance, a covariance, a residual error and a residual error variance of the chromatic aberration.
4. A method of correcting an image pseudocolor as defined in claim 3, wherein the variance of the color difference is calculated assuming that the expected value of the color difference is 0.
5. A method of correcting an image pseudocolor as defined in claim 3, wherein a residual variance of the color difference is calculated assuming that a desired value of the residual of the color difference is 0, wherein after the color difference is obtained, the color difference is further filtered before the color difference feature value is calculated, and the residual and residual variance of the color difference are calculated using the values before and after the color difference filtering.
6. A method of correcting an image false color as defined in claim 3, wherein correcting said color difference further comprises: correcting the chromatic aberration using a linear least mean square error method:
wherein DeltaGR, deltaGB are the first color difference between the G pixel and the R pixel, the G pixel and the B pixel respectivelyThe second color difference between the elements, diffΔgrf, diffΔ GBf represent the residual of the first color difference, the residual of the second color difference, E GRf 、E GBf Respectively representing the expected value of the first color difference and the expected value of the second color difference, cov GR 、cov GB Covariance of the first color difference, covariance of the second color difference, Δgr, respectively new 、ΔGB new The first color difference correction result and the second color difference correction result are respectively obtained.
7. The method of correcting an image false color according to claim 6, wherein correcting a G pixel based on the correction result of the color difference yields the dependent correction result:
G R =R+ΔGR new
G B =B+ΔGB new
wherein G is R 、G B For the correction result, delta GR is obtained by the color difference of the R pixel and the B pixel for the G pixel new 、ΔGB new Respectively a first chromatic aberration correction result and a second chromatic aberration correction result, and correcting the dependent correction result G R 、G B Fusion is carried out:
wherein Var is GRf 、Var GBf Covariance of the first color difference, covariance of the second color difference, G new The correction result for the G pixel.
8. The method of image pseudocolor correction of claim 2, wherein calculating remaining pixels includes:
R new =G new -ΔGR new
B new =G new -ΔGB new
R new 、B new correction results of R pixel and B pixel respectively, G new Correction junction for G pixelFruit, deltaGR new 、ΔGB new The first color difference correction result and the second color difference correction result are respectively obtained.
9. The method for correcting pseudo-color of an image according to claim 2, wherein the correction result of each pixel is fused with the original pixel of the image to be processed and output: and taking the saturation of the original pixel of the image to be processed as a fusion factor, generating a correction curve related to the saturation by using the fusion factor, and fusing the correction result of each pixel of R, G, B with the original R, G, B pixel of the image to be processed.
10. An image false color correction device, comprising:
an image input unit for inputting an image to be processed;
a color difference calculation unit that calculates a first color difference between an R pixel and the G pixel and a second color difference between a B pixel and the G pixel in the image to be processed, with the G pixel as a reference pixel;
the chromatic aberration correcting unit is used for calculating characteristic values of the first chromatic aberration and the second chromatic aberration and correcting the first chromatic aberration and the second chromatic aberration based on a linear minimum mean square error method;
the G pixel correction unit is used for respectively correcting the G pixels according to the correction results of the first chromatic aberration and the second chromatic aberration, and then fusing the dependent correction results obtained by the first chromatic aberration and the second chromatic aberration to obtain the correction results of the G pixels;
an R pixel and B pixel correction unit for calculating the correction results of the R pixel and the B pixel according to the correction results of the G pixel;
and the data fusion output unit is used for carrying out fusion output on the correction result of each pixel and the original pixel of the image to be processed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311845555.1A CN117808715A (en) | 2023-12-28 | 2023-12-28 | Image pseudo-color correction method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311845555.1A CN117808715A (en) | 2023-12-28 | 2023-12-28 | Image pseudo-color correction method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117808715A true CN117808715A (en) | 2024-04-02 |
Family
ID=90429430
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311845555.1A Pending CN117808715A (en) | 2023-12-28 | 2023-12-28 | Image pseudo-color correction method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117808715A (en) |
-
2023
- 2023-12-28 CN CN202311845555.1A patent/CN117808715A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5546229B2 (en) | Image processing method, image processing apparatus, imaging apparatus, and image processing program | |
US6842536B2 (en) | Image processing apparatus, image processing method and computer program product for correcting image obtained by shooting subject | |
US7916937B2 (en) | Image processing device having color shift correcting function, image processing program and electronic camera | |
US9633417B2 (en) | Image processing device and image capture device performing restoration processing using a restoration filter based on a point spread function | |
US8233710B2 (en) | Image processing device and image processing method | |
US8363123B2 (en) | Image pickup apparatus, color noise reduction method, and color noise reduction program | |
EP1966725B1 (en) | Automatic removal of purple fringing from images | |
US8565524B2 (en) | Image processing apparatus, and image pickup apparatus using same | |
JP4979595B2 (en) | Imaging system, image processing method, and image processing program | |
WO2011122284A1 (en) | Image processing device and image capturing apparatus using same | |
JP5840008B2 (en) | Image processing apparatus, image processing method, and program | |
US8553978B2 (en) | System and method for providing multi resolution purple fringing detection and correction | |
US20080056607A1 (en) | Method and apparatus for image noise reduction using noise models | |
US8717460B2 (en) | Methods and systems for automatic white balance | |
JP2011123589A5 (en) | ||
US20070211307A1 (en) | Image processing apparatus and method for reducing noise in image signal | |
JP2013219705A (en) | Image processor, image processing method and program | |
WO2016002283A1 (en) | Image processing device, image pickup device, information processing device and program | |
WO2011121763A1 (en) | Image processing apparatus and image capturing apparatus using same | |
JP5479187B2 (en) | Image processing apparatus and imaging apparatus using the same | |
US20070268503A1 (en) | Image processing system | |
CN101771882B (en) | Image processing apparatus and image processing method | |
US20170206641A1 (en) | Method for generating a pixel filtering boundary for use in auto white balance calibration | |
US20140037207A1 (en) | System and a method of adaptively suppressing false-color artifacts | |
JP2007028042A (en) | Image processing apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |