WO2014079189A1 - 图像处理方法、装置以及成像设备 - Google Patents

图像处理方法、装置以及成像设备 Download PDF

Info

Publication number
WO2014079189A1
WO2014079189A1 PCT/CN2013/073878 CN2013073878W WO2014079189A1 WO 2014079189 A1 WO2014079189 A1 WO 2014079189A1 CN 2013073878 W CN2013073878 W CN 2013073878W WO 2014079189 A1 WO2014079189 A1 WO 2014079189A1
Authority
WO
WIPO (PCT)
Prior art keywords
value
current pixel
component
pixel point
difference
Prior art date
Application number
PCT/CN2013/073878
Other languages
English (en)
French (fr)
Inventor
李水平
陈海
Original Assignee
华为技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to JP2015543249A priority Critical patent/JP6059359B2/ja
Publication of WO2014079189A1 publication Critical patent/WO2014079189A1/zh
Priority to US14/719,590 priority patent/US9374567B2/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/646Circuits for processing colour signals for image enhancement, e.g. vertical detail restoration, cross-colour elimination, contour correction, chrominance trapping filters
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4015Image demosaicing, e.g. colour filter arrays [CFA] or Bayer patterns
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • H04N23/843Demosaicing, e.g. interpolating colour pixel values
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N25/00Circuitry of solid-state image sensors [SSIS]; Control thereof
    • H04N25/10Circuitry of solid-state image sensors [SSIS]; Control thereof for transforming different wavelengths into image signals
    • H04N25/11Arrangement of colour filter arrays [CFA]; Filter mosaics
    • H04N25/13Arrangement of colour filter arrays [CFA]; Filter mosaics characterised by the spectral characteristics of the filter elements
    • H04N25/134Arrangement of colour filter arrays [CFA]; Filter mosaics characterised by the spectral characteristics of the filter elements based on three different wavelength filter elements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details

Definitions

  • the present invention relates to the field of image processing technologies, and in particular, to an image processing method, apparatus, and imaging apparatus.
  • the camera's sensor chip can only obtain one of the three color components of red, green and blue (R/G/B) for each pixel point when acquiring each pixel of the raw (RAW) image.
  • R/G/B red, green and blue
  • BMP bitmap
  • the remaining two color component values at that pixel need to be estimated using the correlation between the current pixel point in the RAW image and the three color components of the surrounding pixel points.
  • a complete color BMP image can be obtained by performing similar operations on each pixel in the RAW image. This process is called interpolation or demosaicing.
  • the simplest method used in the above process is the bilinear interpolation algorithm, which processes R, G, and B independently, regardless of the correlation between the three.
  • the complex interpolation algorithm utilizes the correlation between R, G, and B and considers different directions.
  • the inventor of the present application found in the long-term development process that the fluctuation of the color component of the current pixel point in the neighborhood is transmitted to the other two color components interpolated, forming an erroneous color crosstalk.
  • the technical problem to be solved by the present invention is to provide an image processing method, apparatus and imaging apparatus capable of reducing the crosstalk of the color components of the current pixel point and the other two color components interpolated.
  • An aspect of the present invention provides an image processing method, including: obtaining a first result of the current pixel point, where the first result of the current pixel point includes: the first pixel obtained by the interpolation algorithm a green component value and a first red component value or a first blue component value, a first gradient minimum value of the current pixel point in a horizontal and vertical direction, a second gradient minimum value of the current pixel point in an oblique direction, a threshold value of a green component of the current pixel point, and a threshold value of a red component or a blue component of the current pixel point; obtaining a first pixel of the current pixel point according to a first result of the current pixel point a second result, the second result of the current pixel point includes: a correction value of the green component of the current pixel point and a correction value of the red component or the blue component; according to the first green component value of the current pixel point, a red component value or a first blue component value and a second result of the current pixel point
  • the step of obtaining the second result of the current pixel point according to the first result of the current pixel point comprising: if the first gradient minimum value is less than or equal to the second gradient minimum value, The correction value of the green component of the current pixel is equal to the first difference, and when the color component of the current pixel is the blue component, the correction value of the red component of the current pixel is equal to the first difference And a difference value of the second difference, when the color component of the current pixel point is a red component, the correction value of the blue component of the current pixel point is equal to the first difference value and the third difference value a difference value; or, if the first gradient minimum value is greater than the second gradient minimum value, when the color component of the current pixel point is a blue component, the correction value of the green component of the current pixel point is equal to a difference between the first difference value and the second difference value, the correction value of the red component of the current pixel point is equal to the second difference value, when the color component of the current pixel point is a red
  • the step of the correction value of the red component of the current pixel is equal to one of the first difference and the second difference, and the correction value of the red component of the current pixel is equal to the first The smallest difference between the difference and the second difference.
  • the step of the correction value of the blue component of the current pixel is equal to one of the first difference and the third difference, including: the correction value of the blue component of the current pixel is equal to The smallest difference between the first difference and the third difference.
  • the step of the correction value of the green component of the current pixel is equal to one of the first difference and the second difference, and the correction value of the green component of the current pixel is equal to the first The smallest difference between the difference and the second difference.
  • the step of obtaining a first gradient minimum value of the current pixel point in the horizontal and vertical directions and a second gradient minimum value of the current pixel point in the oblique direction includes: 3 ⁇ centering on the current pixel point 3 in the window, obtaining the gradient values of the current pixel point in the horizontal direction, the vertical direction, the oblique 45 degree direction, and the oblique 135 degree direction; obtaining the minimum value of the gradient value of the current pixel point in the horizontal direction and the vertical direction
  • the minimum value of the obtained gradient value in the horizontal direction and the vertical direction is the first gradient minimum value of the current pixel point in the horizontal and vertical directions, and the current pixel point is obtained in a diagonal direction of 45 degrees and obliquely
  • the minimum value of the gradient value in the 135-degree direction, the minimum value of the obtained gradient value in the oblique 45-degree direction and the oblique 135-degree direction is the second gradient minimum value of the current pixel point in the oblique direction.
  • the step of obtaining a gradient value of the current pixel point in the horizontal direction, the vertical direction, the oblique 45 degree direction, and the oblique 135 degree direction includes: obtaining the same color component value of the current pixel point in a certain direction
  • An absolute value of the subtraction, the certain direction is any one of the horizontal direction, the vertical direction, the oblique 45 degree direction, and the oblique 135 degree direction; all the same color components of the current pixel point in a certain direction
  • the absolute value of the value subtraction is summed, and the result of the summation is the gradient value of the current pixel point in a certain direction.
  • the current pixel point can be obtained in the horizontal direction, the vertical direction, and the oblique direction.
  • the gradient direction and the gradient value in the 135-degree direction includes: obtaining the same color component value of the current pixel point in a certain direction
  • An absolute value of the subtraction, the certain direction is any one of the horizontal direction, the vertical direction, the o
  • the step of obtaining a threshold value of a green component of the current pixel point and a threshold value of a red component or a blue component of the current pixel point includes: 3 ⁇ 3 centering on a current pixel point In the window, the four green component values and the four red component values or the four blue component values of the adjacent pixel points of the current pixel point are respectively sorted according to the size; the sorted green component and the red component or the blue component are obtained.
  • first weighted average value and a fourth weighted average value or a seventh weighted average value wherein the first weighted average value and the fourth weighted average value or the seventh weighted average value are threshold values of the green component of the current pixel point and the current The threshold of the red or blue component of the pixel.
  • the step of sorting the four green component values of the adjacent pixel points of the current pixel point according to the size in the 3*3 window centered on the current pixel point further includes: obtaining the sorted green component And a second weighted average value, wherein the second weighted average value is greater than a third weighted average value, where the second weighted average value and the third weighted average value are thresholds of a threshold value of a green component of the current pixel point Maximum value and threshold minimum.
  • the method further includes : obtaining a fifth weighted mean value and a sixth weighted mean value of the sorted red component when the color component of the current pixel point is a blue component, wherein the fifth weighted mean value is greater than a sixth weighted mean value, and the fifth weighted mean value and The sixth weighted average is the threshold maximum value and the threshold minimum value of the threshold value of the red component of the current pixel point, and the eighth weight of the sorted blue component is obtained when the color component of the current pixel point is a red component.
  • a mean value and a ninth weighted mean value wherein the eighth weighted average value is greater than a ninth weighted mean value, wherein the eighth weighted average value and the ninth weighted average value are threshold maximum values of threshold values of blue components of the current pixel point The minimum threshold.
  • the first green component value, or the first red component value, or the first blue component value of the current pixel point is smaller than a green component of the current pixel point, or a threshold of a red component or a blue component is minimum
  • a value of the first difference, or the second difference, or the third difference is a first green component value, or a first red component value, or a first blue component value of the current pixel point a difference between a green component of a current pixel point, or a red component, or a threshold value of a blue component; a first green component value at the current pixel point, or a first red component value, or a first blue
  • the first difference, or the second difference, or the third difference is the current pixel a difference between a first green component value of the point, or a first red component value, or a first blue component value and a green component of the current pixel point
  • Another aspect of the present invention is to provide an image processing apparatus, the apparatus comprising: a first obtaining module, a second obtaining module, and a third obtaining module; the first obtaining module is configured to obtain the current pixel point a first result, the first result of the current pixel point includes: a first green component value obtained by the interpolation algorithm by the current pixel point, and a first red component value or a first blue component value, where the current pixel point is a first gradient minimum in a horizontal vertical direction, a second gradient minimum of the current pixel point in an oblique direction, a threshold value of a green component of the current pixel point, and a red component of the current pixel point or a threshold value of the blue component, the first obtaining module transmitting the first result of the obtained current pixel point to the second obtaining module and the third obtaining module; the second obtaining module is configured to receive the a first result of the current pixel point sent by the first obtaining module, according to the first result of the current pixel point, obtaining
  • the second obtaining module includes: a first correction value determining unit and a second correction value determining unit; the first correction value determining unit is configured to receive a first result of the current pixel point sent by the first obtaining module And when the first gradient minimum value is less than or equal to the second gradient minimum value, a correction value of a green component of the current pixel point is equal to the first difference value, and a color component at the current pixel point is a blue component, the correction value of the red component of the current pixel point is equal to one of the first difference value and the second difference value, when the color component of the current pixel point is a red component, The correction value of the blue component of the current pixel is equal to one of the first difference and the third difference; the second correction value determining unit is configured to receive the current pixel sent by the first obtaining module a first result, when the first gradient minimum is greater than the second gradient minimum, when the color component of the current pixel is a blue component, the correction value of the green component of the current pixel is equal to the First
  • the first correction value determining unit is specifically configured to: when the color component of the current pixel point is a blue component, the correction value of the red component of the current pixel point is equal to the first difference value and the second difference The smallest difference among the values, when the color component of the current pixel point is a red component, the correction value of the blue component of the current pixel point is equal to the smallest difference between the first difference value and the third difference value .
  • the second correction value determining unit is specifically configured to: when the color component of the current pixel point is a blue component, the correction value of the green component of the current pixel point is equal to the first difference value and the second difference The smallest difference among the values, when the color component of the current pixel point is a red component, the correction value of the green component of the current pixel point is equal to the smallest difference between the first difference value and the third difference value.
  • the first obtaining module includes: a first obtaining unit and a second obtaining unit; the first obtaining unit is configured to obtain the current pixel point in a 3 ⁇ 3 window centered on a current pixel point a gradient value in a direction, a vertical direction, a 45-degree oblique direction, and a 135-degree oblique direction, and transmitting the current pixel point to the second obtaining unit in a horizontal direction, a vertical direction, a 45-degree oblique direction, and a 135-degree oblique direction a gradient value; the second obtaining unit is configured to receive a gradient value of the current pixel point sent by the first obtaining unit in a horizontal direction, a vertical direction, a diagonal 45 degree direction, and a diagonal 135 degree direction, to obtain the a minimum value of the gradient values of the current pixel in the horizontal direction and the vertical direction, and the obtained minimum value of the gradient values in the horizontal direction and the vertical direction is the first gradient of the current pixel point in the horizontal and vertical directions
  • the first obtaining unit includes: a first obtaining subunit and a second obtaining subunit; the first obtaining subunit is configured to obtain a subtraction of the same color component value of the current pixel point in a certain direction
  • An absolute value the certain direction is any one of the horizontal direction, the vertical direction, the oblique 45 degree direction, and the oblique 135 degree direction
  • the current pixel point obtained by transmitting to the second obtained subunit is An absolute value of the same color component value subtracted in a certain direction
  • the second obtaining subunit is configured to receive the subtraction of the same color component value of the current pixel point sent by the first obtaining subunit in a certain direction Absolute value, summing the absolute values of all the same color component values in the current pixel point in a certain direction, the result of the summation is the gradient value of the current pixel point in a certain direction, according to In the method, the gradient values of the current pixel point in the horizontal direction, the vertical direction, the oblique 45 degree direction, and the
  • the first obtaining module includes: a sorting unit and a first threshold obtaining unit; the sorting unit is configured to: adjacent pixels of the current pixel in a 3 ⁇ 3 window centered on a current pixel point The four green component values and the four red component values or the four blue component values of the points are respectively sorted by size, and the neighboring pixel points of the current pixel point are sent to the first threshold value obtaining unit and the related unit respectively.
  • the first threshold value obtaining unit is configured to receive the sorting result sent by the sorting unit, obtain the sorted green component and a first weighted mean and a fourth weighted mean or a seventh weighted mean of the red component or the blue component, the first weighted mean and the fourth weighted mean or the seventh weighted mean are gates of the green component of the current pixel A limit value and a threshold value of a red component or a blue component of the current pixel point.
  • the first obtaining module further includes: a second threshold value obtaining unit; the second threshold value obtaining unit is configured to receive the sorting result sent by the sorting unit, and obtain a second weighted mean value of the sorted green component a third weighted average value, wherein the second weighted average value is greater than a third weighted average value, wherein the second weighted average value and the third weighted average value are threshold maximum values and threshold minimum values of threshold values of green components of the current pixel point .
  • the first obtaining module further includes: a third threshold value obtaining unit and a fourth threshold value obtaining unit; the third threshold value obtaining unit is configured to receive the sorting result sent by the sorting unit, at the current When the color component of the pixel is a blue component, obtaining a fifth weighted mean value and a sixth weighted mean value of the sorted red component, the fifth weighted average value being greater than a sixth weighted mean value, the fifth weighted average value and the sixth weighting
  • the average value is the threshold maximum value and the threshold minimum value of the threshold value of the red component of the current pixel point;
  • the fourth threshold value obtaining unit is configured to receive the sorting result sent by the sorting unit, at the current pixel point When the color component is a red component, an eighth weighted mean and a ninth weighted mean of the sorted blue component are obtained, the eighth weighted mean is greater than a ninth weighted mean, and the eighth weighted mean and the ninth weighted mean are The threshold maximum value of the threshold
  • the first green component value, or the first red component value, or the first blue component value of the current pixel point is smaller than a green component of the current pixel point, or a threshold of a red component or a blue component is minimum
  • a value of the first difference, or the second difference, or the third difference is a first green component value, or a first red component value, or a first blue component value of the current pixel point a difference between a green component of a current pixel point, or a red component, or a threshold value of a blue component; a first green component value at the current pixel point, or a first red component value, or a first blue
  • the first difference, or the second difference, or the third difference is the current pixel a difference between a first green component value of the point, or a first red component value, or a first blue component value and a green component of the current pixel point
  • Yet another aspect of the present invention is to provide an imaging apparatus including: a color imaging device, a first obtaining module, a second obtaining module, a third obtaining module, and an output module; the color imaging device including a Bayer array, Obtaining one of three color components of each pixel of the original image, and transmitting, to the first obtaining module, one of three color components of each pixel of the acquired original image;
  • the first obtaining module is configured to receive one of three color components of each pixel point sent by the color imaging device, to obtain a first result of the current pixel point, and a first of the current pixel point
  • the result includes: a first green component value obtained by the interpolation algorithm by the current pixel point, and a first red component value or a first blue component value, a first gradient minimum value of the current pixel point in a horizontal and vertical direction, a second gradient minimum value of the current pixel point in an oblique direction, a threshold value of a green component of the current pixel point, and a current
  • the invention corrects the green component value and the red component value or the blue component value obtained by the interpolation algorithm, and comprehensively considers the gradient value of the pixel point in different directions, the threshold value of the green component, and the red component or blue in the correction.
  • the threshold value of the component In the above manner, the gradient value of the pixel point in different directions, the threshold value of the green component, and the threshold value of the red component or the blue component can be skillfully utilized, and the green component value and the red component value obtained by the interpolation algorithm or The blue component values are corrected to mitigate the crosstalk of the color components of the current pixel point to the other two color components interpolated.
  • FIG. 1 is a flow chart of an embodiment of an image processing method of the present invention
  • FIG. 2 is a flow chart of another embodiment of an image processing method of the present invention.
  • FIG. 3 is a flow chart showing still another embodiment of the image processing method of the present invention.
  • FIG. 4 is a schematic structural view of an embodiment of an image processing apparatus according to the present invention.
  • FIG. 5 is a schematic structural view of another embodiment of an image processing apparatus according to the present invention.
  • FIG. 6 is a schematic structural view of still another embodiment of an image processing apparatus according to the present invention.
  • FIG. 7 is a schematic structural view of still another embodiment of an image processing apparatus according to the present invention.
  • FIG. 8 is a schematic structural view of an embodiment of an image forming apparatus of the present invention.
  • Fig. 9 is a view showing the configuration of still another embodiment of the image processing apparatus of the present invention.
  • the optical system When using a conventional conventional camera, the optical system hits the captured light onto the film, which is then exposed and rinsed by a chemical process.
  • a digital camera system light is still passed through an optical system consisting of a lens and a lens barrel, except that the light is struck on a flat digital sensor consisting of rows and columns.
  • a sensor chip has millions or even tens of millions of pixels.
  • the sensor itself is a monochromatic electronic component that can only sense the brightness of light and cannot sense color information. For this reason, before the light hits the sensor chip, it must first Through a color filter array (CFA, Color Filter Array), so that the corresponding colored light is transmitted, and the other colors of light are filtered out.
  • CFA Color Filter Array
  • the intensity of the three color components must be measured at each pixel position, but in order to reduce the cost and volume of the digital camera, Manufacturers typically use a monolithic inductive coupling device (CCD, Charge) Coupled Device) and Complementary Metal-Oxide-Semiconductor Transistor's image sensor, and through its surface covered CFA, allows only one color component to reach each pixel position.
  • CCD Charge
  • CFA Complementary Metal-Oxide-Semiconductor Transistor's image sensor
  • the CFA of the GRGB swatch is used more, that is, Bayer For CFA, see Table 1, where G(Green) stands for green, R(Red) stands for red, and B(Blue) stands for blue.
  • CFA is the most widely used. It alternately uses a set of red and green filters and a set of green and blue filters, where the number of green components is one-half of the total number of pixels, the number of red components and the number of blue components. They only account for a quarter of the total number of pixels. This is because the human eye is more sensitive to green and can distinguish more details. At the same time, green also occupies the most important and widest position in the visible spectrum.
  • the original output of the sensor made by CFA is a mosaic image with only one color component of red, green or blue at each pixel.
  • a mosaic image with only one red, green or blue color component of each pixel must be used.
  • the mid-transformation is a full-color map in which each pixel contains three color components of red, green, and blue. This process is called interpolation or demosaicing.
  • FIG. 1 is a flowchart of an embodiment of an image processing method according to the present invention, including:
  • Step S101 Obtain a first result of the current pixel point, where the first result of the current pixel point includes: a first green component value obtained by the current pixel point by the interpolation algorithm, and a first red component value or a first blue component value, a current pixel a first gradient minimum of the point in the horizontal and vertical directions, a second gradient minimum of the current pixel point in the oblique direction, a threshold value of the green component of the current pixel point, and a red component or a blue component of the current pixel point Threshold.
  • the first green component value and the first red component value of the current pixel point are obtained by an interpolation algorithm, and when the color component of the current pixel point is a red component, the current algorithm is used to obtain the current The first green component value of the pixel and the first blue component value.
  • the interpolation algorithm herein, the invention is not limited, for example, a nearest pixel interpolation algorithm, a bilinear interpolation algorithm or a bicubic interpolation algorithm, and the like.
  • the gradient value of the current pixel in the horizontal direction and the gradient value in the vertical direction are the first gradient minimum of the current pixel point in the horizontal and vertical directions, and the current pixel points are respectively on the two diagonal lines.
  • the smallest gradient value among the gradient values in the direction is the second gradient minimum of the current pixel point in the oblique direction.
  • the input signal-to-noise ratio at which the threshold effect begins to appear is called the threshold.
  • the so-called threshold effect is a phenomenon in which the output signal-to-noise ratio of the detector appears to deteriorate sharply after the input signal-to-noise ratio of the detector is reduced to a specific value.
  • the current pixel and the adjacent pixel are not independent of each other, but have a correlation relationship. With this correlation, when the color component of the current pixel is a blue component, the green component of the current pixel can be obtained.
  • the threshold value and the threshold value of the red component of the current pixel point when the color component of the current pixel point is a red component, the threshold value of the green component of the current pixel point and the threshold value of the blue component are obtained.
  • Step S102 Obtain a second result of the current pixel point according to the first result of the current pixel point.
  • the second result of the current pixel point includes: a correction value of the green component of the current pixel point and a correction value of the red component or the blue component.
  • step S102 when the correction value of the green component of the current pixel point and the correction value of the red component or the blue component are obtained, the first gradient minimum value of the current pixel point in the horizontal and vertical directions and the current pixel point in the oblique direction are fully considered.
  • the first gradient minimum value of the current pixel in the horizontal and vertical directions and the second gradient minimum of the current pixel point in the oblique direction are mainly considering which direction the current pixel point is more directional in the direction; the green component of the current pixel point
  • the threshold value, and the threshold value of the red component or the blue component of the current pixel point are used to perform the first green component value and the first red component value or the first blue component value obtained by the interpolation algorithm by the current pixel point.
  • the comparison is performed to obtain a correction value of the green component of the current pixel point and a correction value of the red component or the blue component.
  • Step S103 Obtain a second green component value and a second red component of the current pixel point according to the first green component value, the first red component value or the first blue component value of the current pixel point, and the second result of the current pixel point. a value or a second blue component value, wherein the second green component value of the current pixel point is equal to a sum of a first green component value of the current pixel point and a correction value of a green component of the current pixel point, and a second red color of the current pixel point.
  • the component value or the second blue component value is equal to the sum of the first red component value or the first blue component value of the current pixel point and the correction value of the red component or the blue component of the current pixel point.
  • a second green component value of the current pixel point and a second red component value or a second blue component value are the corrected green component value of the current pixel point and the red component value or the blue component value.
  • the invention corrects the green component value and the red component value or the blue component value obtained by the interpolation algorithm, and comprehensively considers the gradient value of the pixel point in different directions, the threshold value of the green component, and the red component or blue in the correction.
  • the threshold value of the component In the above manner, the gradient value of the pixel point in different directions, the threshold value of the green component, and the threshold value of the red component or the blue component can be skillfully utilized, and the green component value and the red component value obtained by the interpolation algorithm or The blue component values are corrected to mitigate the crosstalk of the color components of the current pixel point to the other two color components interpolated.
  • FIG. 2 and FIG. 3 are respectively a flowchart of two other embodiments of the image processing method of the present invention, the method comprising:
  • the first part obtaining the first result of the current pixel, the first result of the current pixel includes: the first green component value obtained by the interpolation algorithm by the current pixel point, and the first red component value or the first blue component value, the current pixel a first gradient minimum of the point in the horizontal and vertical directions, a second gradient minimum of the current pixel point in the oblique direction, a threshold value of the green component of the current pixel point, and a red component or a blue component of the current pixel point Threshold.
  • the first part includes step S201, step S202, and step S203.
  • Step S201 Obtain a first green component value of the current pixel point and a first red component value or a first blue component value by using an interpolation algorithm.
  • the first green component value of the current pixel point and the first red component value or the first blue component value are interpolated by some interpolation algorithm. If the color component of the current pixel is a blue component, the first green component value of the current pixel point and the first red component value are interpolated. If the color component of the current pixel point is a red component, the current pixel point is interpolated. A green component value and a first blue component value.
  • Step S202 Obtain a first gradient minimum value of the current pixel point in the horizontal and vertical directions and a second gradient minimum value of the current pixel point in the oblique direction.
  • Step S202 includes sub-step S202a and sub-step S202b, the specific contents are as follows:
  • Sub-step S202a Gradient values of the current pixel point in the horizontal direction, the vertical direction, the oblique 45-degree direction, and the oblique 135-degree direction are obtained in a 3 ⁇ 3 window centered on the current pixel point.
  • the 3 ⁇ 3 window centered on the current pixel point selects the smallest window centered on the current pixel point and includes adjacent pixel points, which simplifies the calculation process.
  • the sub-step S202a includes the following contents:
  • A. Obtain an absolute value of the same color component value subtracted from the current pixel point in a certain direction, and one direction is any one of a horizontal direction, a vertical direction, a 45-degree oblique direction, and a 135-degree oblique direction.
  • the absolute values of the current pixel's subtraction from the same color component value in the horizontal direction are:
  • the current pixel is in the same direction of 45 degrees.
  • the absolute values of the subtraction of the color component values are:
  • the absolute value of the current pixel point subtracted from the same color component value in the oblique 135 degree direction is:
  • the gradient value of the current pixel in the horizontal direction is:
  • the gradient value of the current pixel point in the oblique 135 degree direction is:
  • the gradient values of the current pixel in the horizontal direction, the vertical direction, the oblique 45 degree direction, and the oblique 135 degree direction can be obtained by the same method, and are not described herein again.
  • Sub-step S202b obtaining the minimum value of the gradient value of the current pixel point in the horizontal direction and the vertical direction, and obtaining the minimum value of the gradient value in the horizontal direction and the vertical direction is the first time of the current pixel point in the horizontal and vertical direction
  • the minimum value of the gradient is obtained, and the minimum value of the gradient value of the current pixel point in the oblique 45 degree direction and the oblique 135 degree direction is obtained, and the minimum value of the gradient value obtained in the oblique 45 degree direction and the oblique 135 degree direction is the current pixel point.
  • the second gradient minimum in the oblique direction is obtained.
  • the gradient value of the current pixel in the horizontal direction is compared
  • the minimum value of the first gradient in the vertical direction is
  • the gradient value, the first gradient minimum of the current pixel in the horizontal and vertical directions is
  • a first gradient minimum value of the current pixel point in the horizontal and vertical directions and a second gradient minimum value of the current pixel point in the oblique direction can be obtained.
  • Step S203 Obtain a threshold value of a green component of the current pixel point and a threshold value of a red component or a blue component of the current pixel point.
  • the color component of the current pixel is a blue component, obtain a threshold value of a green component of the current pixel point and a threshold value of a red component of the current pixel point, and if the color component of the current pixel point is a red component, obtain the current The threshold of the green component of the pixel and the threshold of the blue component of the current pixel.
  • Step S203 includes sub-step S203a and sub-step S203b, the specific contents are as follows:
  • Sub-step S203a In the 3 ⁇ 3 window centered on the current pixel point, the four green component values and the four red component values or the four blue component values of the adjacent pixel points of the current pixel point are respectively sorted by size.
  • the color component of the current pixel is a blue component
  • the four green component values G12, G21, G23, and G32 of the adjacent pixel of the current pixel are sorted by size
  • the four red component values R11, R13, R31, and R33 are sorted by size.
  • the color component of the current pixel is a red component, it is processed in the same way.
  • Sub-step S203b obtaining a first weighted average value and a fourth weighted average value or a seventh weighted average value of the sorted green component and the red component or the blue component, the first weighted average value and the fourth weighted average value or the seventh weighted average value are current The threshold value of the green component of the pixel and the threshold of the red component or the blue component of the current pixel.
  • the four green component values are multiplied by the respective weights, and then the four products are summed, and the result is the first weighted mean of the sorted green components.
  • the same method can be used to obtain the fourth weighted mean of the sorted red component (ie, the threshold of the red component of the current pixel). If the color component of the current pixel is a red component, the seventh weighted average of the sorted blue component (ie, the threshold of the blue component of the current pixel) can be obtained by the same reason.
  • the sum of the four weights of each color component value is 1, and the magnitude of the four weights of each weighted mean is determined according to actual conditions.
  • the sub-step S203a may further include: C, D, and E, and the specific content is as follows:
  • the threshold maximum value Compared with the sub-step S203b, there are two threshold values for the sorted green component, which are the threshold maximum value and the threshold minimum value.
  • the method adopted is basically the same as the sub-step S203b, and details are not described herein again.
  • the correction value of the subsequent green component can be made more accurate.
  • the color component of the current pixel is a blue component, obtaining a fifth weighted mean and a sixth weighted mean of the sorted red component, the fifth weighted mean is greater than the sixth weighted mean, the fifth weighted mean and the sixth weight
  • the mean value is the threshold maximum value and the threshold minimum value of the threshold value of the red component of the current pixel point.
  • sub-step S203b there are two threshold values for the sorted red component, which are the threshold maximum value and the threshold minimum value.
  • the method adopted is basically the same as the sub-step S203b, and details are not described herein again.
  • E Compared with sub-step S203b, E requires two threshold values for the sorted blue component, which are the threshold maximum value and the threshold minimum value, respectively.
  • the method adopted is basically the same as the sub-step S203b, and details are not described herein again.
  • step S201, step S202, and step S203 when there is no sequence, it may be executed in parallel. If sub-step S203b is executed, C, D, and E are not executed, and if C, D, or C, E is executed (i.e., D and E are alternatively executed), sub-step S203b is not performed.
  • the second part obtaining a second result of the current pixel point according to the first result of the current pixel point, and the second result of the current pixel point comprises: a correction value of the green component of the current pixel point and a correction value of the red component or the blue component .
  • the second part includes step S204, step S205, and step S206.
  • Step S204 determining whether the first gradient minimum value of the current pixel point in the horizontal and vertical directions is less than or equal to the second gradient minimum value of the current pixel point in the oblique direction. If the first gradient minimum value is less than or equal to the second gradient minimum value, the process proceeds to step S205, and if the first gradient minimum value is greater than the second gradient minimum value, the process proceeds to step S206.
  • the difference between the first green component value of the current pixel point and the threshold value of the green component of the current pixel point is the first difference;
  • the difference between the first red component value of the current pixel point and the threshold value of the red component of the current pixel point is the second difference;
  • the color component at the current pixel point When it is a red component, the difference between the first blue component value of the current pixel point and the threshold value of the blue component of the current pixel point is the third difference.
  • step S204 may be: determining whether the first gradient value of the current pixel point in the horizontal and vertical directions is less than or equal to a second gradient value of the current pixel point in an oblique direction, wherein the first gradient The value is equal to the first gradient minimum multiplied by the parameter a, the second gradient value is equal to the second gradient minimum multiplied by the parameter b, and the parameters a and b can be the following:
  • the parameter a is the reciprocal of the estimated mean corresponding to the first gradient minimum
  • the parameter b is the reciprocal of the estimated mean corresponding to the second gradient minimum
  • the parameter a is a constant 1 and the parameter b is a constant 1, which is the case corresponding to the step S204;
  • Parameters a and b are parameters obtained by some algorithm of the same type.
  • Step S205 includes sub-step S205a or sub-step S205b, and the two sub-steps are executed one by one.
  • the specific contents are as follows:
  • Step S205a If the first gradient minimum value is less than or equal to the second gradient minimum value, when the color component of the current pixel point is a blue component, the correction value of the green component of the current pixel point is equal to the first difference value, and the current pixel point is The correction value of the red component is equal to one of the first difference and the second difference.
  • the color component of the current pixel point is a blue component, indicating the horizontal and vertical directions of the four green components in the 3 ⁇ 3 window centered on the current pixel point It is more directional than the diagonal direction of the four red points.
  • the correction value of the green component of the current pixel point is equal to the first difference value (ie, the difference between the first green component value of the current pixel point and the threshold value of the green component of the current pixel point); the current pixel point
  • the correction value of the red component is equal to a difference between the first difference and the second difference (ie, the difference between the first red component value of the current pixel point and the threshold value of the red component of the current pixel point), ie, A difference between the first difference and the second difference is selected as a correction value of the red component of the current pixel.
  • the correction value of the red component of the current pixel is equal to one of the first difference and the second difference, and may be: the correction value of the red component of the current pixel is equal to the first difference and the second difference.
  • Sub-step S205b If the first gradient minimum value is less than or equal to the second gradient minimum value, when the color component of the current pixel point is a red component, the correction value of the green component of the current pixel point is equal to the first difference value, the current pixel point The correction value of the blue component is equal to one of the first difference and the third difference.
  • the color component of the current pixel is a red component, indicating the horizontal and vertical ratio of the four green components in the 3 ⁇ 3 window centered on the current pixel
  • the edges of the four blue points in the oblique direction are more directional.
  • the correction value of the green component of the current pixel point is equal to the first difference value (ie, the difference between the first green component value of the current pixel point and the threshold value of the green component of the current pixel point); the current pixel point
  • the correction value of the blue component is equal to a difference between the first difference and the third difference (ie, the difference between the first blue component value of the current pixel point and the threshold value of the blue component of the current pixel point)
  • the value, that is, one of the first difference value and the third difference value is selected as the correction value of the blue component of the current pixel point.
  • the correction value of the blue component of the current pixel is equal to one of the first difference and the third difference, and may be: the correction value of the blue component of the current pixel is equal to the first difference and the third difference The smallest difference in the value. That is, the smaller difference between the first difference value and the third difference value is selected as the correction value of the blue component of the current pixel point.
  • Step S206 includes sub-step S206a or sub-step S206b, and the two sub-steps are performed one by one, and the specific contents are as follows:
  • Step S206a If the first gradient minimum value is greater than the second gradient minimum value, when the color component of the current pixel point is a blue component, the correction value of the green component of the current pixel point is equal to the first difference value and the second difference value. A difference value, the correction value of the red component of the current pixel point is equal to the second difference value.
  • the correction value of the green component of the current pixel is equal to one of the first difference and the second difference, that is, selecting one of the first difference and the second difference as the green of the current pixel.
  • the correction value of the component; the correction value of the red component of the current pixel point is equal to the second difference value.
  • the correction value of the green component of the current pixel is equal to one of the first difference and the second difference, and may be: the correction value of the green component of the current pixel is equal to the first difference and the second difference.
  • the smallest difference That is, a smaller difference between the first difference and the second difference is selected as the correction value of the green component of the current pixel.
  • Sub-step S206b if the first gradient minimum value is greater than the second gradient minimum value, when the color component of the current pixel point is a red component, the correction value of the green component of the current pixel point is equal to the first difference value and the third difference value. A difference, the correction value of the blue component of the current pixel is equal to the third difference.
  • the correction value of the green component of the current pixel is equal to one of the first difference and the third difference, that is, selecting one of the first difference and the third difference as the green of the current pixel.
  • the correction value of the component; the correction value of the blue component of the current pixel point is equal to the third difference value.
  • the correction value of the green component of the current pixel is equal to one of the first difference and the third difference, and may be: the correction value of the green component of the current pixel is equal to the first difference and the third difference.
  • the smallest difference That is, a smaller difference between the first difference value and the third difference value is selected as the correction value of the green component of the current pixel point.
  • the first difference value is the first green component value of the current pixel point and the current pixel.
  • the threshold of the green component is maximum, the first difference is zero.
  • the first difference is 0; if the first green component of the current pixel is The threshold value is smaller than the threshold minimum of the green component of the current pixel, and the first difference is equal to the difference between the first green component value of the current pixel point and the threshold minimum value of the green component of the current pixel point.
  • the correction value of the green component of the current pixel point can be further improved to smoothly increase and decrease, thereby effectively reducing crosstalk between colors.
  • the second difference value is the first red component value of the current pixel point and the current pixel The difference between the threshold minimum values of the red components of the point; when the first red component value of the current pixel point is greater than the threshold maximum value of the red component of the current pixel point, the second difference is the first red component of the current pixel point The difference between the value and the threshold maximum of the red component of the current pixel; the first red component value at the current pixel is greater than or equal to the threshold minimum of the red component of the current pixel, and is less than or equal to the current pixel When the threshold of the red component is at the maximum, the second difference is zero.
  • the second difference is 0; if the first red component of the current pixel is The difference is smaller than the threshold minimum of the red component of the current pixel, and the second difference is equal to the difference between the first red component value of the current pixel and the threshold minimum of the red component of the current pixel. Is a positive number; if the first red component value of the current pixel point is greater than the threshold maximum value of the red component of the current pixel point, the second difference value is equal to the first red component value of the current pixel point and the red component of the current pixel point The difference between the maximum values of the thresholds, where the difference is a negative number.
  • the correction value of the red component of the current pixel point can be further better and smoothly increased and decreased, and crosstalk between colors is effectively reduced.
  • the third difference value is the first blue component value of the current pixel point.
  • the difference between the first blue component value of the point and the threshold maximum of the blue component of the current pixel; the first blue component value at the current pixel is greater than or equal to the threshold of the blue component of the current pixel.
  • the value, and less than or equal to the threshold maximum of the blue component of the current pixel point, the third difference is zero.
  • the third difference is 0; if the first blue of the current pixel The color component value is smaller than the threshold minimum of the blue component of the current pixel point, and the third difference is equal to the difference between the first blue component value of the current pixel point and the threshold minimum value of the blue component of the current pixel point. Value, the difference is a positive number; if the first blue component value of the current pixel is greater than the threshold maximum of the blue component of the current pixel, the third difference is equal to the first blue component of the current pixel The difference between the value and the maximum threshold value of the blue component of the current pixel, where the difference is a negative number.
  • the content of the third part is the content of step S207, as follows:
  • Step S207 Obtain a second green component value and a second red component of the current pixel point according to the first green component value, the first red component value or the first blue component value of the current pixel point, and the second result of the current pixel point. a value or a second blue component value, wherein the second green component value of the current pixel point is equal to a sum of a first green component value of the current pixel point and a correction value of a green component of the current pixel point, and a second red color of the current pixel point.
  • the component value or the second blue component value is equal to the sum of the first red component value or the first blue component value of the current pixel point and the correction value of the red component or the blue component of the current pixel point.
  • a second green component value of the current pixel point and a second red component value or a second blue component value are the corrected green component value of the current pixel point and the red component value or the blue component value.
  • the invention corrects the green component value and the red component value or the blue component value obtained by the interpolation algorithm, and comprehensively considers the gradient value of the pixel point in different directions, the threshold value of the green component, and the red component or blue in the correction.
  • the threshold value of the component In the above manner, the gradient value of the pixel point in different directions, the threshold value of the green component, and the threshold value of the red component or the blue component can be skillfully utilized, and the green component value and the red component value obtained by the interpolation algorithm or The blue component values are corrected to mitigate the crosstalk of the color components of the current pixel point to the other two color components interpolated.
  • the 3 ⁇ 3 window centered on the current pixel point selects the smallest window centered on the current pixel point and includes adjacent pixel points, which simplifies the calculation process; the color component can be made by the threshold maximum value and the threshold minimum value.
  • the correction value is more accurate, and the correction value of the color component of the current pixel point can be better adjusted to smoothly increase and decrease, thereby effectively reducing crosstalk between colors.
  • FIG. 4 is a schematic structural diagram of an embodiment of an image processing apparatus according to the present invention.
  • the apparatus includes: a first obtaining module 301, a second obtaining module 302, and a third obtaining module 303.
  • the first obtaining module 301 is configured to obtain a first result of the current pixel point, where the first result of the current pixel point comprises: a first green component value obtained by the current pixel point by the interpolation algorithm, and a first red component value or a first blue component a value, a first gradient minimum of the current pixel in the horizontal and vertical directions, a second gradient minimum of the current pixel in the oblique direction, a threshold of the green component of the current pixel, and a red component of the current pixel or For the threshold value of the blue component, the first obtaining module 301 transmits the obtained first result of the current pixel point to the second obtaining module 302 and the third obtaining module 303.
  • a first green component value of the current pixel point and a first red component value or a first blue component value are obtained by an interpolation algorithm.
  • the gradient value of the current pixel in the horizontal direction and the gradient value in the vertical direction are the first gradient minimum of the current pixel point in the horizontal and vertical directions, and the current pixel points are respectively on the two diagonal lines.
  • the smallest gradient value among the gradient values in the direction is the second gradient minimum of the current pixel point in the oblique direction.
  • the current pixel and the adjacent pixel are not independent of each other, but there is a correlation. With this correlation, the threshold of the green component of the current pixel and the threshold of the red component or blue can be obtained. The threshold value of the component.
  • the second obtaining module 302 is configured to receive a first result of the current pixel point sent by the first obtaining module 301, and obtain a second result of the current pixel point according to the first result of the current pixel point, where the second result of the current pixel point includes: The correction value of the green component of the current pixel and the correction value of the red component or the blue component, the second obtaining module 302 transmits the obtained second result of the current pixel to the third obtaining module 303.
  • the first gradient minimum value of the current pixel point in the horizontal and vertical directions and the second pixel of the current pixel point in the oblique direction are fully considered.
  • the gradient minimum, the threshold of the green component of the current pixel, and the threshold of the red component or the blue component of the current pixel are fully considered.
  • the third obtaining module 303 is configured to receive the first result and the second result of the current pixel point respectively sent by the first obtaining module 301 and the second obtaining module 302, according to the first green component value and the first red component value of the current pixel point. Or a second blue component value and a second result of the current pixel point, obtaining a second green component value of the current pixel point and a second red component value or a second blue component value, wherein the second green component of the current pixel point
  • the value is equal to the sum of the first green component value of the current pixel point and the correction value of the green component of the current pixel point
  • the second red component value or the second blue component value of the current pixel point is equal to the first red component value of the current pixel point. Or the sum of the first blue component value and the correction value of the red component or the blue component of the current pixel.
  • a second green component value of the current pixel point and a second red component value or a second blue component value are the corrected green component value of the current pixel point and the red component value or the blue component value.
  • the invention corrects the green component value and the red component value or the blue component value obtained by the interpolation algorithm, and comprehensively considers the gradient value of the pixel point in different directions, the threshold value of the green component, and the red component or blue in the correction.
  • the threshold value of the component In the above manner, it is possible to reduce the crosstalk of the color components of the current pixel point to the other two color components that are interpolated.
  • FIG. 5 to FIG. 7 are schematic structural diagrams of three embodiments of an image processing apparatus according to the present invention.
  • the apparatus includes: a first obtaining module 401, a second obtaining module 402, and a third obtaining module 403.
  • the first obtaining module 401 is configured to obtain a first result of the current pixel point, where the first result of the current pixel point comprises: a first green component value obtained by the current pixel point by the interpolation algorithm, and a first red component value or a first blue component a value, a first gradient minimum of the current pixel in the horizontal and vertical directions, a second gradient minimum of the current pixel in the oblique direction, a threshold of the green component of the current pixel, and a red component of the current pixel or For the threshold value of the blue component, the first obtaining module 401 transmits the obtained first result of the current pixel point to the second obtaining module 402 and the third obtaining module 403.
  • the first obtaining module 401 includes a first obtaining unit 4011, a second obtaining unit 4012, a third obtaining unit 4018, a sorting unit 4013, and a first threshold value obtaining unit 4014.
  • the first obtaining unit 4011 is configured to obtain a gradient value of the current pixel point in the horizontal direction, the vertical direction, the oblique 45 degree direction, and the oblique 135 degree direction in the 3 ⁇ 3 window centered on the current pixel point, and to the second
  • the obtaining unit 4012 transmits a gradient value of the current pixel point in the horizontal direction, the vertical direction, the oblique 45 degree direction, and the oblique 135 degree direction.
  • the first obtaining unit 4011 includes: a first obtaining subunit and a second obtaining subunit.
  • the first obtaining subunit is configured to obtain an absolute value of the same color component value subtracted by the current pixel point in a certain direction, and one direction is any one of a horizontal direction, a vertical direction, a diagonal 45 degree direction, and a diagonal 135 degree direction. Direction, and sending the obtained absolute value of the same color component value of the current pixel point in a certain direction to the second obtaining sub-unit.
  • the second obtaining subunit is configured to receive an absolute value of the same color component value subtracted by the current pixel point sent by the first obtaining subunit in a certain direction, and compare all the same color component values of the current pixel point in a certain direction
  • the absolute value of the subtraction is summed, and the result of the summation is the gradient value of the current pixel point in a certain direction.
  • the current pixel point can be obtained in the horizontal direction, the vertical direction, the oblique 45 degree direction, and the oblique 135 degree direction. Gradient value on.
  • the second obtaining unit 4012 is configured to receive the gradient values of the current pixel point sent by the first obtaining unit 4011 in the horizontal direction, the vertical direction, the oblique 45 degree direction, and the oblique 135 degree direction, and obtain the current pixel point in the horizontal direction and the vertical direction.
  • the minimum value of the gradient value, the minimum value of the gradient value obtained in the horizontal direction and the vertical direction is the first gradient minimum value of the current pixel point in the horizontal and vertical direction, and the current pixel point is inclined at 45 degrees and obliquely
  • the minimum value of the gradient value in the 135-degree direction, and the minimum value of the gradient value obtained in the oblique 45-degree direction and the oblique 135-degree direction is the second gradient minimum value of the current pixel point in the oblique direction.
  • the third obtaining unit 4018 is configured to obtain a first green component value of the current pixel point and a first red component value or a first blue component value by an interpolation algorithm.
  • the sorting unit 4013 is configured to sort the four green component values and the four red component values or the four blue component values of the adjacent pixel points of the current pixel point by size in a 3 ⁇ 3 window centered on the current pixel point. And transmitting the neighboring pixel points of the current pixel point to the first threshold value obtaining unit 4014 and the related units (the second threshold value obtaining unit 4015, the third threshold value obtaining unit 4016, and the fourth threshold value obtaining unit 4017) The order of the four green component values and the four red component values or the four blue component values.
  • the first threshold obtaining unit 4014 is configured to receive the sorting result sent by the sorting unit 4013, and obtain the first weighted average value and the fourth weighted average value or the seventh weighted average value of the sorted green component and the red component or the blue component, first The weighted mean and the fourth weighted mean or the seventh weighted mean are the threshold value of the green component of the current pixel and the threshold of the red component or the blue component of the current pixel.
  • the first obtaining module 401 further includes a second threshold value obtaining unit 4015, a third threshold value obtaining unit 4016, or a fourth threshold value obtaining unit 4017.
  • the second threshold obtaining unit 4015 is configured to receive the sorting result sent by the sorting unit 4013, obtain a second weighted average value and a third weighted average value of the sorted green component, the second weighted average value is greater than the third weighted average value, and the second weighted average value And the third weighted mean value is the threshold maximum value and the threshold minimum value of the threshold value of the green component of the current pixel point.
  • the third threshold obtaining unit 4016 is configured to receive the sorting result sent by the sorting unit 4013, and obtain a fifth weighted mean value and a sixth weighted mean value of the sorted red component when the color component of the current pixel point is a blue component,
  • the fifth weighted mean value is greater than the sixth weighted mean value, and the fifth weighted average value and the sixth weighted average value are the threshold maximum value and the threshold minimum value of the threshold value of the red component of the current pixel point.
  • the fourth threshold obtaining unit 4017 is configured to receive the sorting result sent by the sorting unit 4013, and obtain the eighth weighted mean value and the ninth weighted mean value of the sorted blue component when the color component of the current pixel point is a red component,
  • the eight weighted mean value is greater than the ninth weighted mean value, and the eighth weighted average value and the ninth weighted average value are the threshold maximum value and the threshold minimum value of the threshold value of the blue component of the current pixel point.
  • the first obtaining module 401 includes the first threshold obtaining unit 4014, the second threshold obtaining unit 4015, the third threshold obtaining unit 4016 or the fourth threshold obtaining unit 4017 is not included;
  • the first obtaining module 401 includes the second threshold value obtaining unit 4015 and the third threshold value obtaining unit 4016 or the second threshold value obtaining unit 4015 and the fourth threshold value obtaining unit 4017, the first threshold value is not included.
  • the unit 4014 is obtained.
  • the second obtaining module 402 is configured to receive a first result of the current pixel point sent by the first obtaining module 401, and obtain a second result of the current pixel point according to the first result of the current pixel point, where the second result of the current pixel point includes: a correction value of the green component of the current pixel point and a correction value of the red component or the blue component, and the second obtaining module 402 transmits the obtained second result of the current pixel point to the third obtaining module 403;
  • the second obtaining module 402 includes a first correction value determining unit 4021 and a second correction value determining unit 4022.
  • the difference between the first green component value of the current pixel point and the threshold value of the green component of the current pixel point is the first difference; when the color component of the current pixel point is the blue component, the current The difference between the first red component value of the pixel and the threshold of the red component of the current pixel is the second difference; when the color component of the current pixel is the red component, the first blue of the current pixel The difference between the component value and the threshold value of the blue component of the current pixel point is the third difference.
  • the first correction value determining unit 4021 is configured to receive a first result of the current pixel point sent by the first obtaining module 401, and the correction value of the green component of the current pixel point when the first gradient minimum value is less than or equal to the second gradient minimum value Equal to the first difference, when the color component of the current pixel is a blue component, the correction value of the red component of the current pixel is equal to a difference between the first difference and the second difference, and the color at the current pixel When the component is a red component, the correction value of the blue component of the current pixel is equal to one of the first difference and the third difference.
  • the first correction value determining unit 4021 is specifically configured to: when the color component of the current pixel point is a blue component, the correction value of the red component of the current pixel point is equal to the smallest difference between the first difference value and the second difference value, at the current When the color component of the pixel is a red component, the correction value of the blue component of the current pixel is equal to the smallest difference between the first difference and the third difference.
  • the second correction value determining unit 4022 is configured to receive a first result of the current pixel point sent by the first obtaining module 401.
  • the color component at the current pixel point is a blue component.
  • the correction value of the green component of the current pixel is equal to one of the first difference and the second difference, and the correction value of the red component of the current pixel is equal to the second difference, and the color component at the current pixel is In the red component, the correction value of the green component of the current pixel is equal to one of the first difference and the third difference, and the correction value of the blue component of the current pixel is equal to the third difference.
  • the second correction value determining unit 4022 is specifically configured to: when the color component of the current pixel point is a blue component, the correction value of the green component of the current pixel point is equal to the smallest difference between the first difference value and the second difference value, at the current When the color component of the pixel is a red component, the correction value of the green component of the current pixel is equal to the smallest difference between the first difference and the third difference.
  • a difference, or a second difference, or a third difference is a first green component value of the current pixel point, or a first red component value, or a first blue component value and a green component of the current pixel point, or a red color The difference between the threshold values of the component or blue component.
  • a difference, or a second difference, or a third difference is a first green component value of the current pixel point, or a first red component value, or a first blue component value and a green component of the current pixel point, or a red color
  • the difference between the threshold values of the component or blue component is a first green component value of the current pixel point, or a first red component value, or a first blue component value and a green component of the current pixel point, or a red color
  • the first green component value, or the first red component value, or the first blue component value of the current pixel point is greater than or equal to a green component of the current pixel point, or a threshold value minimum of a red component or a blue component, And when less than or equal to the green component of the current pixel point, or the threshold value of the red component or the blue component, the first difference, or the second difference, or the third difference is zero.
  • the third obtaining module 403 is configured to receive a first result and a second result of the current pixel point respectively sent by the first obtaining module and the second obtaining module, according to the first green component value, the first red component value or the first pixel of the current pixel point a blue component value and a second result of the current pixel point, obtaining a second green component value of the current pixel point and a second red component value or a second blue component value, wherein the second green component value of the current pixel point is equal to The sum of the first green component value of the current pixel point and the correction value of the green component of the current pixel point, the second red component value or the second blue component value of the current pixel point is equal to the first red component value of the current pixel point or the first The sum of a blue component value and a correction value of the red component or the blue component of the current pixel.
  • the invention corrects the green component value and the red component value or the blue component value obtained by the interpolation algorithm, and comprehensively considers the gradient value of the pixel point in different directions, the threshold value of the green component, and the red component or blue in the correction.
  • the threshold value of the component In the above manner, it is possible to reduce the crosstalk of the color components of the current pixel point to the other two color components that are interpolated.
  • FIG. 8 is a schematic structural diagram of an embodiment of an imaging device according to the present invention.
  • the device includes a color imaging device 501, a first obtaining module 502, a second obtaining module 503, a third obtaining module 504, and an output module 505.
  • the color imaging device 501 includes a Bayer array for acquiring one of three color components of each pixel of the original image, and transmits the three colors of each pixel of the acquired original image to the first obtaining module 502. A color component in a component.
  • the first obtaining module 502 is configured to receive one of three color components of each pixel point sent by the color imaging device 501, to obtain a first result of the current pixel point, where the first result of the current pixel point includes: a current pixel point a first green component value obtained by an interpolation algorithm and a first red component value or a first blue component value, a first gradient minimum value of a current pixel point in a horizontal and vertical direction, and a second gradient of a current pixel point in an oblique direction a minimum value, a threshold value of a green component of the current pixel point, and a threshold value of a red component or a blue component of the current pixel point, and the first obtaining module 502 transmits the obtained value to the second obtaining module 503 and the third obtaining module 504.
  • the first result of the current pixel includes: a current pixel point a first green component value obtained by an interpolation algorithm and a first red component value or a first blue component value, a first gradient minimum value of
  • the second obtaining module 503 is configured to receive a first result of the current pixel point sent by the first obtaining module 502, and obtain a second result of the current pixel point according to the first result of the current pixel point, where the second result of the current pixel point includes: The correction value of the green component of the current pixel point and the correction value of the red component or the blue component, the second obtaining module 503 transmits the obtained second result of the current pixel point to the third obtaining module 504.
  • the third obtaining module 504 is configured to receive the first result and the second result of the current pixel point respectively sent by the first obtaining module 502 and the second obtaining module 503, according to the first green component value and the first red component value of the current pixel point. Or a second blue component value and a second result of the current pixel point, obtaining a second green component value of the current pixel point and a second red component value or a second blue component value, wherein the second green component of the current pixel point The value is equal to the sum of the first green component value of the current pixel point and the correction value of the green component of the current pixel point, and the second red component value or the second blue component value of the current pixel point is equal to the first red component value of the current pixel point. Or the sum of the first blue component value and the correction value of the red component or the blue component of the current pixel, the third obtaining module transmitting the second green component value of the current pixel point and the second red component value or the second to the output module Blue component value.
  • the output module 505 is configured to receive a second green component value and a second red component value or a second blue component value of the current pixel point sent by the third obtaining module 504.
  • the blue component value, the second green component value, and the second red component value of the current pixel are combined to output the final color of the current pixel.
  • the color component of the current pixel is a red component
  • the red component value of the current pixel is obtained.
  • the second green component value and the second blue component value are combined to output a final color of the current pixel.
  • the invention corrects the green component value and the red component value or the blue component value obtained by the interpolation algorithm, and comprehensively considers the gradient value of the pixel point in different directions, the threshold value of the green component, and the red component or blue in the correction.
  • the threshold value of the component In the above manner, it is possible to reduce the crosstalk of the color components of the current pixel point to the other two color components that are interpolated.
  • FIG. 9 is another image processing apparatus provided by the present invention, which includes a processor 91 and a memory 92.
  • the processor 91 is configured to obtain a first result of the current pixel, where the first result of the current pixel includes: a first green component value obtained by the interpolation algorithm by the current pixel point, and a first red component value or a first blue component value, The first gradient minimum of the current pixel in the horizontal and vertical directions, the second gradient minimum of the current pixel in the oblique direction, the threshold of the green component of the current pixel, and the red component or blue of the current pixel The threshold value of the component; and the first result of the current pixel is saved in memory 92.
  • the processor 91 is further configured to read a first result of the current pixel point stored in the memory 92, and obtain a second result of the current pixel point according to the first result of the current pixel point, where the second result of the current pixel point includes: current A correction value of the green component of the pixel and a correction value of the red component or the blue component; and storing the second result of the current pixel in the memory 92.
  • the processor 91 is further configured to read the first result and the second result of the current pixel point saved in the memory 92, according to the first green component value, the first red component value or the first blue component value of the current pixel point, and a second result of the current pixel, obtaining a second green component value of the current pixel point and a second red component value or a second blue component value, wherein the second green component value of the current pixel point is equal to the first of the current pixel point
  • the sum of the green component value and the correction value of the green component of the current pixel point, the second red component value or the second blue component value of the current pixel point is equal to the first red component value or the first blue component value of the current pixel point and The sum of the correction values of the red or blue component of the current pixel.
  • the invention corrects the green component value and the red component value or the blue component value obtained by the interpolation algorithm, and comprehensively considers the gradient value of the pixel point in different directions, the threshold value of the green component, and the red component or blue in the correction.
  • the threshold value of the component In the above manner, it is possible to reduce the crosstalk of the color components of the current pixel point to the other two color components that are interpolated.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device implementations described above are merely illustrative.
  • the division of the modules or units is only a logical function division.
  • there may be another division manner for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the embodiments of the present embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the methods of the various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (ROM, Read-Only) Memory, random access memory (RAM), disk or optical disk, and other media that can store program code.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Color Television Image Signal Generators (AREA)
  • Editing Of Facsimile Originals (AREA)

Abstract

本发明公开了一种图像处理方法、装置以及成像设备,所述方法包括:获得所述当前像素点通过插值算法得到的第一绿色分量值以及第一红色分量值或第一蓝色分量值、在水平垂直方向上的第一梯度最小值、在斜方向上的第二梯度最小值、绿色分量的门限值,以及红色分量或蓝色分量的门限值;获得所述当前像素点的绿色分量的修正值以及红色分量或蓝色分量的修正值;获得所述当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值。通过上述方式,本发明能够减轻当前像素点所在的颜色分量对插值出的其它两种颜色分量的串扰。

Description

图像处理方法、装置以及成像设备
【技术领域】
本发明涉及图像处理技术领域,特别是涉及一种图像处理方法、装置以及成像设备。
【背景技术】
摄像机的感光芯片在获取未加工(RAW)图像的每个像素点时,只能获得每个像素点红绿蓝(R/G/B)三种颜色分量中的一种颜色分量值。要想获得位图(BMP)图像,该像素点上其余两种颜色分量值需要利用RAW图像中当前像素点以及周围像素点的三个颜色分量之间的相关性估计得到。通过对RAW图像中的每一个像素点进行类似的操作即可获得一幅完整的彩色BMP图像,这种处理过程称为插值或去马赛克。
上述的处理过程所采用的最简单的是双线性插值算法,分别独立对R、G、B进行处理,不考虑三者之间的相关性。复杂的插值算法是利用R、G、B三者之间的相关性并综合考虑不同的方向。本申请的发明人在长期的研发过程中发现,当前像素点所在颜色分量在邻域内的波动会传导到插值出的另外两个颜色分量上,形成错误颜色串扰。
【发明内容】
本发明主要解决的技术问题是提供一种图像处理方法、装置以及成像设备,能够减轻当前像素点所在的颜色分量对插值出的其它两种颜色分量的串扰。
本发明的一方面是,提供一种图像处理方法,包括:获得所述当前像素点的第一结果,所述当前像素点的第一结果包括:所述当前像素点通过插值算法得到的第一绿色分量值以及第一红色分量值或第一蓝色分量值、所述当前像素点在水平垂直方向上的第一梯度最小值、所述当前像素点在斜方向上的第二梯度最小值、所述当前像素点的绿色分量的门限值,以及所述当前像素点的红色分量或蓝色分量的门限值;按照所述当前像素点的第一结果,获得所述当前像素点的第二结果,所述当前像素点的第二结果包括:所述当前像素点的绿色分量的修正值以及红色分量或蓝色分量的修正值;根据所述当前像素点的第一绿色分量值、第一红色分量值或第一蓝色分量值以及当前像素点的第二结果,获得所述当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值,其中,所述当前像素点的第二绿色分量值等于所述当前像素点的第一绿色分量值与所述当前像素点的绿色分量的修正值之和,所述当前像素点的第二红色分量值或第二蓝色分量值等于所述当前像素点的第一红色分量值或第一蓝色分量值与所述当前像素点的红色分量或蓝色分量的修正值之和。
其中,所述按照当前像素点的第一结果,获得所述当前像素点的第二结果的步骤,包括:若所述第一梯度最小值小于或等于所述第二梯度最小值,则所述当前像素点的绿色分量的修正值等于所述第一差值,在所述当前像素点的颜色分量是蓝色分量时,所述当前像素点的红色分量的修正值等于所述第一差值与第二差值中的一个差值,在所述当前像素点的颜色分量是红色分量时,所述当前像素点的蓝色分量的修正值等于所述第一差值与第三差值中的一个差值;或,若所述第一梯度最小值大于第二梯度最小值,则在所述当前像素点的颜色分量是蓝色分量时,所述当前像素点的绿色分量的修正值等于所述第一差值与第二差值中的一个差值,所述当前像素点的红色分量的修正值等于所述第二差值,在所述当前像素点的颜色分量是红色分量时,所述当前像素点的绿色分量的修正值等于所述第一差值与第三差值中的一个差值,所述当前像素点的蓝色分量的修正值等于所述第三差值;其中,所述当前像素点的第一绿色分量值与所述当前像素点的绿色分量的门限值之间的差值是第一差值;在所述当前像素点的颜色分量是蓝色分量时,所述当前像素点的第一红色分量值与所述当前像素点的红色分量的门限值之间的差值是第二差值;在所述当前像素点的颜色分量是红色分量时,所述当前像素点的第一蓝色分量值与所述当前像素点的蓝色分量的门限值之间的差值是第三差值。
其中,所述当前像素点的红色分量的修正值等于所述第一差值与第二差值中的一个差值的步骤,包括:所述当前像素点的红色分量的修正值等于所述第一差值与第二差值中最小的差值。
其中,所述当前像素点的蓝色分量的修正值等于所述第一差值与第三差值中的一个差值的步骤,包括:所述当前像素点的蓝色分量的修正值等于所述第一差值与第三差值中最小的差值。
其中,所述当前像素点的绿色分量的修正值等于所述第一差值与第二差值中的一个差值的步骤,包括:所述当前像素点的绿色分量的修正值等于所述第一差值与第二差值中最小的差值。
其中,所述当前像素点的绿色分量的修正值等于所述第一差值与第三差值中的一个差值的步骤,包括:所述当前像素点的绿色分量的修正值等于所述第一差值与第三差值中最小的差值。
其中,所述获得当前像素点在水平垂直方向上的第一梯度最小值、所述当前像素点在斜方向上的第二梯度最小值的步骤,包括:在以当前像素点为中心的3×3窗口内,获得所述当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值;获得所述当前像素点在水平方向与垂直方向上的梯度值的最小值,所述获得的在水平方向与垂直方向上的梯度值的最小值即为所述当前像素点在水平垂直方向上的第一梯度最小值,获得所述当前像素点在斜45度方向与斜135度方向上的梯度值的最小值,所述获得的在斜45度方向与斜135度方向上的梯度值的最小值即为所述当前像素点在斜方向上的第二梯度最小值。
其中,所述获得当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值的步骤,包括:获得所述当前像素点在某一方向上的同一种颜色分量值相减的绝对值,所述某一方向是所述水平方向、垂直方向、斜45度方向以及斜135度方向中的任一个方向;将所述当前像素点在某一方向上所有的同一种颜色分量值相减的绝对值求和,所述求和的结果即为所述当前像素点在某一方向上的梯度值,按照所述方法,即可获得当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值。
其中,所述获得所述当前像素点的绿色分量的门限值以及所述当前像素点的红色分量或蓝色分量的门限值的步骤,包括:在以当前像素点为中心的3×3窗口内,将所述当前像素点的邻近像素点的四个绿色分量值和四个红色分量值或者四个蓝色分量值分别按照大小排序;获得排序后的绿色分量和红色分量或者蓝色分量的第一加权均值和第四加权均值或第七加权均值,所述第一加权均值和第四加权均值或第七加权均值即为所述当前像素点的绿色分量的门限值以及所述当前像素点的红色分量或蓝色分量的门限值。
其中,所述在以当前像素点为中心的3*3窗口内,将所述当前像素点的邻近像素点的四个绿色分量值按照大小排序的步骤之后,还包括:获得排序后的绿色分量的第二加权均值和第三加权均值,所述第二加权均值大于第三加权均值,所述第二加权均值和第三加权均值即为所述当前像素点的绿色分量的门限值的门限最大值与门限最小值。
其中,所述在以当前像素点为中心的3×3窗口内,将所述当前像素点的邻近像素点的四个红色分量值或者四个蓝色分量值按照大小排序的步骤之后,还包括:在当前像素点的颜色分量是蓝色分量时,获得排序后的红色分量的第五加权均值和第六加权均值,所述第五加权均值大于第六加权均值,所述第五加权均值和第六加权均值即为所述当前像素点的红色分量的门限值的门限最大值与门限最小值,在当前像素点的颜色分量是红色分量时,获得排序后的蓝色分量的第八加权均值和第九加权均值,所述第八加权均值大于第九加权均值,所述第八加权均值和第九加权均值即为所述当前像素点的蓝色分量的门限值的门限最大值与门限最小值。
其中,在所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值小于所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最小值时,所述第一差值、或第二差值、或第三差值是所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值与所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最小值之间的差值;在所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值大于所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最大值时,所述第一差值、或第二差值、或第三差值是所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值与所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最大值之间的差值;在所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值大于或等于所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最小值,且小于或等于所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最大值时,所述第一差值、或第二差值、或第三差值为0。
本发明的另一方面是:提供一种图像处理装置,所述装置包括:第一获得模块、第二获得模块以及第三获得模块;所述第一获得模块用于获得所述当前像素点的第一结果,所述当前像素点的第一结果包括:所述当前像素点通过插值算法得到的第一绿色分量值以及第一红色分量值或第一蓝色分量值、所述当前像素点在水平垂直方向上的第一梯度最小值、所述当前像素点在斜方向上的第二梯度最小值、所述当前像素点的绿色分量的门限值,以及所述当前像素点的红色分量或蓝色分量的门限值,所述第一获得模块向所述第二获得模块和第三获得模块发送所述获得的当前像素点的第一结果;所述第二获得模块用于接收所述第一获得模块发送的当前像素点的第一结果,按照所述当前像素点的第一结果,获得所述当前像素点的第二结果,所述当前像素点的第二结果包括:所述当前像素点的绿色分量的修正值以及红色分量或蓝色分量的修正值,所述第二获得模块向所述第三获得模块发送获得的当前像素点的第二结果;所述第三获得模块用于接收所述第一获得模块和第二获得模块分别发送的当前像素点的第一结果和第二结果,根据所述当前像素点的第一绿色分量值、第一红色分量值或第一蓝色分量值以及当前像素点的第二结果,获得所述当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值,其中,所述当前像素点的第二绿色分量值等于所述当前像素点的第一绿色分量值与所述当前像素点的绿色分量的修正值之和,所述当前像素点的第二红色分量值或第二蓝色分量值等于所述当前像素点的第一红色分量值或第一蓝色分量值与所述当前像素点的红色分量或蓝色分量的修正值之和。
其中,所述第二获得模块包括:第一修正值确定单元和第二修正值确定单元;所述第一修正值确定单元用于接收所述第一获得模块发送的当前像素点的第一结果,在所述第一梯度最小值小于或等于所述第二梯度最小值时,所述当前像素点的绿色分量的修正值等于所述第一差值,在所述当前像素点的颜色分量是蓝色分量时,所述当前像素点的红色分量的修正值等于所述第一差值与第二差值中的一个差值,在所述当前像素点的颜色分量是红色分量时,所述当前像素点的蓝色分量的修正值等于所述第一差值与第三差值中的一个差值;所述第二修正值确定单元用于接收所述第一获得模块发送的当前像素点的第一结果,在所述第一梯度最小值大于第二梯度最小值时,在所述当前像素点的颜色分量是蓝色分量时,所述当前像素点的绿色分量的修正值等于所述第一差值与第二差值中的一个差值,所述当前像素点的红色分量的修正值等于所述第二差值,在所述当前像素点的颜色分量是红色分量时,所述当前像素点的绿色分量的修正值等于所述第一差值与第三差值中的一个差值,所述当前像素点的蓝色分量的修正值等于所述第三差值;其中,所述当前像素点的第一绿色分量值与所述当前像素点的绿色分量的门限值之间的差值是第一差值;在所述当前像素点的颜色分量是蓝色分量时,所述当前像素点的第一红色分量值与所述当前像素点的红色分量的门限值之间的差值是第二差值;在所述当前像素点的颜色分量是红色分量时,所述当前像素点的第一蓝色分量值与所述当前像素点的蓝色分量的门限值之间的差值是第三差值。
其中,所述第一修正值确定单元具体用于在所述当前像素点的颜色分量是蓝色分量时,所述当前像素点的红色分量的修正值等于所述第一差值与第二差值中最小的差值,在所述当前像素点的颜色分量是红色分量时,所述当前像素点的蓝色分量的修正值等于所述第一差值与第三差值中最小的差值。
其中,所述第二修正值确定单元具体用于在所述当前像素点的颜色分量是蓝色分量时,所述当前像素点的绿色分量的修正值等于所述第一差值与第二差值中最小的差值,在所述当前像素点的颜色分量是红色分量时,所述当前像素点的绿色分量的修正值等于所述第一差值与第三差值中最小的差值。
其中,所述第一获得模块包括:第一获得单元和第二获得单元;所述第一获得单元用于在以当前像素点为中心的3×3窗口内,获得所述当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值,并向所述第二获得单元发送所述当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值;所述第二获得单元用于接收所述第一获得单元发送的所述当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值,获得所述当前像素点在水平方向与垂直方向上的梯度值的最小值,所述获得的在水平方向与垂直方向上的梯度值的最小值即为所述当前像素点在水平垂直方向上的第一梯度最小值,获得所述当前像素点在斜45度方向与斜135度方向上的梯度值的最小值,所述获得的在斜45度方向与斜135度方向上的梯度值的最小值即为所述当前像素点在斜方向上的第二梯度最小值。
其中,所述第一获得单元包括:第一获得子单元和第二获得子单元;所述第一获得子单元用于获得所述当前像素点在某一方向上的同一种颜色分量值相减的绝对值,所述某一方向是所述水平方向、垂直方向、斜45度方向以及斜135度方向中的任一个方向,并向所述第二获得子单元发送获得的所述当前像素点在某一方向上的同一种颜色分量值相减的绝对值;第二获得子单元用于接收所述第一获得子单元发送的所述当前像素点在某一方向上的同一种颜色分量值相减的绝对值,将所述当前像素点在某一方向上所有的同一种颜色分量值相减的绝对值求和,所述求和的结果即为所述当前像素点在某一方向上的梯度值,按照所述方法,即可获得当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值。
其中,所述第一获得模块包括:排序单元和第一门限值获得单元;所述排序单元用于在以当前像素点为中心的3×3窗口内,将所述当前像素点的邻近像素点的四个绿色分量值和四个红色分量值或者四个蓝色分量值分别按照大小排序,并向所述第一门限值获得单元及相关单元发送所述当前像素点的邻近像素点的四个绿色分量值和四个红色分量值或者四个蓝色分量值的排序结果;所述第一门限值获得单元用于接收所述排序单元发送的排序结果,获得排序后的绿色分量和红色分量或者蓝色分量的第一加权均值和第四加权均值或第七加权均值,所述第一加权均值和第四加权均值或第七加权均值即为所述当前像素点的绿色分量的门限值以及所述当前像素点的红色分量或蓝色分量的门限值。
其中,所述第一获得模块还包括:第二门限值获得单元;第二门限值获得单元用于接收所述排序单元发送的排序结果,获得排序后的绿色分量的第二加权均值和第三加权均值,所述第二加权均值大于第三加权均值,所述第二加权均值和第三加权均值即为所述当前像素点的绿色分量的门限值的门限最大值与门限最小值。
其中,所述第一获得模块还包括:第三门限值获得单元和第四门限值获得单元;所述第三门限值获得单元用于接收所述排序单元发送的排序结果,在当前像素点的颜色分量是蓝色分量时,获得排序后的红色分量的第五加权均值和第六加权均值,所述第五加权均值大于第六加权均值,所述第五加权均值和第六加权均值即为所述当前像素点的红色分量的门限值的门限最大值与门限最小值;所述第四门限值获得单元用于接收所述排序单元发送的排序结果,在当前像素点的颜色分量是红色分量时,获得排序后的蓝色分量的第八加权均值和第九加权均值,所述第八加权均值大于第九加权均值,所述第八加权均值和第九加权均值即为所述当前像素点的蓝色分量的门限值的门限最大值与门限最小值。
其中,在所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值小于所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最小值时,所述第一差值、或第二差值、或第三差值是所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值与所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最小值之间的差值;在所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值大于所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最大值时,所述第一差值、或第二差值、或第三差值是所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值与所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最大值之间的差值;在所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值大于或等于所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最小值,且小于或等于所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最大值时,所述第一差值、或第二差值、或第三差值为0。
本发明的又一方面是:提供一种成像设备,所述设备包括:彩色成像装置、第一获得模块、第二获得模块、第三获得模块以及输出模块;所述彩色成像装置包括拜耳阵列,用于获取原始图像的每个像素点的三个颜色分量中的一个颜色分量,并向所述第一获得模块发送获取的原始图像的每个像素点的三个颜色分量中的一个颜色分量;所述第一获得模块用于接收所述彩色成像装置发送的每个像素点的三个颜色分量中的一个颜色分量,获得所述当前像素点的第一结果,所述当前像素点的第一结果包括:所述当前像素点通过插值算法得到的第一绿色分量值以及第一红色分量值或第一蓝色分量值、所述当前像素点在水平垂直方向上的第一梯度最小值、所述当前像素点在斜方向上的第二梯度最小值、所述当前像素点的绿色分量的门限值,以及所述当前像素点的红色分量或蓝色分量的门限值,所述第一获得模块向所述第二获得模块和第三获得模块发送所述获得的当前像素点的第一结果;所述第二获得模块用于接收所述第一获得模块发送的当前像素点的第一结果,按照所述当前像素点的第一结果,获得所述当前像素点的第二结果,所述当前像素点的第二结果包括:所述当前像素点的绿色分量的修正值以及红色分量或蓝色分量的修正值,所述第二获得模块向所述第三获得模块发送获得的当前像素点的第二结果;所述第三获得模块用于接收所述第一获得模块和第二获得模块分别发送的当前像素点的第一结果和第二结果,根据所述当前像素点的第一绿色分量值、第一红色分量值或第一蓝色分量值以及当前像素点的第二结果,获得所述当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值,其中,所述当前像素点的第二绿色分量值等于所述当前像素点的第一绿色分量值与所述当前像素点的绿色分量的修正值之和,所述当前像素点的第二红色分量值或第二蓝色分量值等于所述当前像素点的第一红色分量值或第一蓝色分量值与所述当前像素点的红色分量或蓝色分量的修正值之和,所述第三获得模块向所述输出模块发送所述当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值;所述输出模块用于接收所述第三获得模块发送的所述当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值,在当前像素点的颜色分量是蓝色分量时,将所述当前像素点的蓝色分量值、第二绿色分量值以及第二红色分量值合成后输出当前像素点的最终颜色,在当前像素点的颜色分量是红色分量时,将所述当前像素点的红色分量值、第二绿色分量值以及第二蓝色分量值合成后输出当前像素点的最终颜色。
本发明对通过插值算法得出的绿色分量值以及红色分量值或蓝色分量值进行修正,在修正时综合考虑像素点在不同方向的梯度值、绿色分量的门限值以及红色分量或蓝色分量的门限值。通过上述方式,能够巧妙地利用像素点在不同方向的梯度值、绿色分量的门限值以及红色分量或蓝色分量的门限值,对通过插值算法得出的绿色分量值以及红色分量值或蓝色分量值进行修正,从而减轻当前像素点所在的颜色分量对插值出的其它两种颜色分量的串扰。
【附图说明】
图1是 本发明图像处理方法一实施方式的流程图;
图2是 本发明图像处理方法另一实施方式的流程图;
图3是 本发明图像处理方法又一实施方式的流程图;
图4是 本发明图像处理装置一实施方式的结构示意图;
图5是 本发明图像处理装置另一实施方式的结构示意图;
图6是 本发明图像处理装置又一实施方式的结构示意图;
图7是 本发明图像处理装置又一实施方式的结构示意图;
图8是 本发明成像设备一实施方式的结构示意图;
图9是 本发明图像处理装置又一实施方式的结构示意图。
【具体实施方式】
在使用普通的传统相机时,光学系统把捕捉到的光打在胶卷上,随后人们通过化学过程对其进行曝光和冲洗。在数码摄像系统里,光线仍然通过由镜头和镜筒组成的光学系统,不同之处是光打在由行和列组成的平面数码传感器上。一个传感芯片拥有上百万甚至上千万个像素,传感器本身是一个单色电子元件,只能感应光线亮度,不能感应色彩信息,为此,在光打在传感芯片之前,它要首先通过一个彩色滤镜阵列(CFA,Color Filter Array),使得相应的彩色光透过,而滤除其它颜色的光,为了得到全彩色图,必须在每个像素位置测出三种颜色分量的强度,但为了降低数码相机的成本与体积,生产厂家通常会采用单片电感耦合器件(CCD,Charge Coupled Device)和互补金属氧化物半导体器件(CMOS ,Complementary Metal-Oxide-Semiconductor Transistor)的图像传感器,并通过其表面覆盖的CFA,使得只有一种颜色分量达到每个像素位置。
在普通数码相机里,使用较多的是GRGB色板的CFA,即Bayer CFA,请参见表1,其中,G(Green)代表绿色,R(Red)代表红色,B(Blue)代表蓝色。
表1 Bayer CFA阵列
B G B G B G B G B
G R G R G R G R G
B G B G B G B G B
G R G R G R G R G
B G B G B G B G B
G R G R G R G R G
B G B G B G B G B
G R G R G R G R G
B G B G B G B G B
Bayer CFA作为最经典的阵列,应用最为广泛。它交替使用一组红色和绿色滤镜以及一组绿色和蓝色滤镜,其中,绿色分量的个数占总像素个数的二分之一,红色分量的个数和蓝色分量的个数分别只占了总像素个数的四分之一。这是由于人眼对绿色更为敏感,能分辨更多的细节,同时,绿色也占据了可见光谱中最重要和最宽的位置。
用Bayer CFA制作的传感器的原始输出是每个像素点只有红、绿或蓝一种颜色分量的马赛克图像,为此必须采用插值算法将每个像素点只有红、绿或蓝一种颜色分量的马赛克图像中变换成每个像素包含红、绿、蓝三种颜色分量的全彩色图,这个过程被称为插值或去马赛克(Demosaicing)。
下面结合附图和实施方式对本发明进行详细说明。
参阅图1,图1是本发明图像处理方法一实施方式的流程图,包括:
步骤S101:获得当前像素点的第一结果,当前像素点的第一结果包括:当前像素点通过插值算法得到的第一绿色分量值以及第一红色分量值或第一蓝色分量值、当前像素点在水平垂直方向上的第一梯度最小值、当前像素点在斜方向上的第二梯度最小值、当前像素点的绿色分量的门限值,以及当前像素点的红色分量或蓝色分量的门限值。
在当前像素点的颜色分量是蓝色分量时,通过插值算法获得当前像素点的第一绿色分量值以及第一红色分量值,在当前像素点的颜色分量是红色分量时,通过插值算法获得当前像素点的第一绿色分量值以及第一蓝色分量值。对于此处的插值算法,本发明不作限制,例如:最近像素插值算法、双线性插值算法或双三次插值算法等等。
当前像素点在水平方向上的梯度值与在垂直方向上的梯度值中最小的梯度值即为当前像素点在水平垂直方向上的第一梯度最小值,当前像素点分别在两个对角线方向上的梯度值中最小的梯度值即为当前像素点在斜方向上的第二梯度最小值。
开始出现门限效应的输入信噪比称为门限值。所谓门限效应,就是当检波器的输入信噪比降低到一个特定的数值后,检波器的输出信噪比出现急剧恶化的一种现象。当前像素点和邻近像素点之间不是彼此独立的,而是存在相关关系的,利用这种相关关系,在当前像素点的颜色分量是蓝色分量时,即可获得当前像素点的绿色分量的门限值以及当前像素点的红色分量的门限值,在当前像素点的颜色分量是红色分量时,即可获得当前像素点的绿色分量的门限值以及蓝色分量的门限值。
步骤S102:按照当前像素点的第一结果,获得当前像素点的第二结果,当前像素点的第二结果包括:当前像素点的绿色分量的修正值以及红色分量或蓝色分量的修正值。
本步骤S102在获得当前像素点的绿色分量的修正值以及红色分量或蓝色分量的修正值时,充分考虑当前像素点在水平垂直方向上的第一梯度最小值、当前像素点在斜方向上的第二梯度最小值、当前像素点的绿色分量的门限值,以及当前像素点的红色分量或蓝色分量的门限值这些影响因素。当前像素点在水平垂直方向上的第一梯度最小值和当前像素点在斜方向上的第二梯度最小值主要是考虑当前像素点在哪个方向的边沿方向性更强;当前像素点的绿色分量的门限值,以及当前像素点的红色分量或蓝色分量的门限值用来与当前像素点通过插值算法得到的第一绿色分量值以及第一红色分量值或第一蓝色分量值进行比较,以获得当前像素点的绿色分量的修正值以及红色分量或蓝色分量的修正值。
步骤S103:根据当前像素点的第一绿色分量值、第一红色分量值或第一蓝色分量值以及当前像素点的第二结果,获得当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值,其中,当前像素点的第二绿色分量值等于当前像素点的第一绿色分量值与当前像素点的绿色分量的修正值之和,当前像素点的第二红色分量值或第二蓝色分量值等于当前像素点的第一红色分量值或第一蓝色分量值与当前像素点的红色分量或蓝色分量的修正值之和。
在获得当前像素点的第一绿色分量值、第一红色分量值或第一蓝色分量值,以及当前像素点的绿色分量的修正值以及红色分量或蓝色分量的修正值后,即可获得当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值。当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值即为经过修正后的当前像素点的绿色分量值以及红色分量值或蓝色分量值。
本发明对通过插值算法得出的绿色分量值以及红色分量值或蓝色分量值进行修正,在修正时综合考虑像素点在不同方向的梯度值、绿色分量的门限值以及红色分量或蓝色分量的门限值。通过上述方式,能够巧妙地利用像素点在不同方向的梯度值、绿色分量的门限值以及红色分量或蓝色分量的门限值,对通过插值算法得出的绿色分量值以及红色分量值或蓝色分量值进行修正,从而减轻当前像素点所在的颜色分量对插值出的其它两种颜色分量的串扰。
参阅图2和图3,图2和图3分别是本发明图像处理方法另外两个实施方式的流程图,该方法包括:
第一部分:获得当前像素点的第一结果,当前像素点的第一结果包括:当前像素点通过插值算法得到的第一绿色分量值以及第一红色分量值或第一蓝色分量值、当前像素点在水平垂直方向上的第一梯度最小值、当前像素点在斜方向上的第二梯度最小值、当前像素点的绿色分量的门限值,以及当前像素点的红色分量或蓝色分量的门限值。
第一部分包括步骤S201、步骤S202以及步骤S203。
步骤S201:通过插值算法得到当前像素点的第一绿色分量值以及第一红色分量值或第一蓝色分量值。
通过某种插值算法插值出当前像素点的第一绿色分量值以及第一红色分量值或第一蓝色分量值。如果当前像素点的颜色分量是蓝色分量,则插值出当前像素点的第一绿色分量值以及第一红色分量值,如果当前像素点的颜色分量是红色分量,则插值出当前像素点的第一绿色分量值以及第一蓝色分量值。
步骤S202:获得当前像素点的在水平垂直方向上的第一梯度最小值和当前像素点在斜方向上的第二梯度最小值。
步骤S202包括子步骤S202a和子步骤S202b,具体内容如下:
子步骤S202a:在以当前像素点为中心的3×3窗口内,获得当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值。
以当前像素点为中心的3×3窗口,选取了以当前像素点为中心且包括邻近像素点的最小的窗口,可以简化计算过程。
其中,子步骤S202a包括如下内容:
A.获得当前像素点在某一方向上的同一种颜色分量值相减的绝对值,某一方向是水平方向、垂直方向、斜45度方向以及斜135度方向中的任一个方向。
例如,参见表2,如果当前像素点的颜色分量是蓝色分量,当前像素点在水平方向同一种颜色分量值相减的绝对值是:|R11-R13|、|G21-G23|以及|R31-R33|;当前像素点在垂直方向同一种颜色分量值相减的绝对值是:|R11-R31|、|G12-G32|以及|R13-R33|;当前像素点在斜45度方向同一种颜色分量值相减的绝对值是:|G21-G12|、|R31-R13|以及|G32-G23|;当前像素点在斜135度方向同一种颜色分量值相减的绝对值是:|G12-G23|、|R11-R33|以及|G21-G32|。
表2 当前像素点的颜色分量是蓝色分量时的3×3窗口
R11 G12 R13
G21 B22 G23
R31 G32 R33
B.将当前像素点在某一方向上所有的同一种颜色分量值相减的绝对值求和,求和的结果即为当前像素点在某一方向上的梯度值,按照该方法,即可获得当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值。
参见表2,如果当前像素点的颜色分量是蓝色分量,当前像素点在水平方向的梯度值是:|R11-R13|+|G21-G23|+|R31-R33|;当前像素点在垂直方向的梯度值是:|R11-R31|+|G12-G32|+|R13-R33|;当前像素点在斜45度方向的梯度值是:|G21-G12|+|R31-R13|+|G32-G23|;当前像素点在斜135度方向的梯度值是:|G12-G23|+|R11-R33|+|G21-G32|。如果当前像素点的颜色分量是红色分量,当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值用同样的方法可以得到,在此不再进行赘述。
子步骤S202b:获得当前像素点在水平方向与垂直方向上的梯度值的最小值,获得的在水平方向与垂直方向上的梯度值的最小值即为当前像素点在水平垂直方向上的第一梯度最小值,获得当前像素点在斜45度方向与斜135度方向上的梯度值的最小值,获得的在斜45度方向与斜135度方向上的梯度值的最小值即为当前像素点在斜方向上的第二梯度最小值。
参见表2,如果当前像素点的颜色分量是蓝色分量,比较当前像素在水平方向的梯度值|R11-R13|+|G21-G23|+|R31-R33|和当前像素点在垂直方向的梯度值|R11-R31|+|G12-G32|+|R13-R33|之间的大小,如果当前像素在水平方向的梯度值大于当前像素点在垂直方向的梯度值,则当前像素点在水平垂直方向上的第一梯度最小值即为|R11-R31|+|G12-G32|+|R13-R33|;如果当前像素在水平方向的梯度值小于当前像素点在垂直方向的梯度值,则当前像素点在水平垂直方向上的第一梯度最小值即为|R11-R13|+|G21-G23|+|R31-R33|;如果当前像素在水平方向的梯度值等于当前像素点在垂直方向的梯度值,则当前像素点在水平垂直方向上的第一梯度最小值是|R11-R31|+|G12-G32|+|R13-R33|或者|R11-R13|+|G21-G23|+|R31-R33|;同理可获得当前像素点在斜方向上的第二梯度最小值。
根据上述方法,如果当前像素点的颜色分量是红色分量,即可获得当前像素点在水平垂直方向上的第一梯度最小值、当前像素点在斜方向上的第二梯度最小值。
步骤S203:获得当前像素点的绿色分量的门限值以及当前像素点的红色分量或蓝色分量的门限值。
如果当前像素点的颜色分量是蓝色分量,则获得当前像素点的绿色分量的门限值以及当前像素点的红色分量的门限值,如果当前像素点的颜色分量是红色分量,则获得当前像素点的绿色分量的门限值以及当前像素点的蓝色分量的门限值。
步骤S203包括子步骤S203a和子步骤S203b,具体内容如下:
子步骤S203a:在以当前像素点为中心的3×3窗口内,将当前像素点的邻近像素点的四个绿色分量值和四个红色分量值或者四个蓝色分量值分别按照大小排序。
请参见表2,如果当前像素点的颜色分量是蓝色分量,则将当前像素点的邻近像素点的四个绿色分量值G12、G21、G23以及G32按照大小排序,四个红色分量值R11、R13、R31以及R33按照大小排序。反之,如果当前像素点的颜色分量是红色分量,则按照同样的方法处理。
子步骤S203b:获得排序后的绿色分量和红色分量或者蓝色分量的第一加权均值和第四加权均值或第七加权均值,第一加权均值和第四加权均值或第七加权均值即为当前像素点的绿色分量的门限值以及当前像素点的红色分量或蓝色分量的门限值。
请参见表2,如果当前像素点的颜色分量是蓝色分量,四个绿色分量值与各自的权重相乘,然后对四个乘积求和,所得结果是排序后的绿色分量的第一加权均值,也是当前像素点的绿色分量的门限值,例如:G12×α1 +G21×α2 +G23×α3 +G32×α4,其中,α1+α2+α3+α4=1。采用同样的方法可以获得排序后的红色分量的第四加权均值(即当前像素点的红色分量的门限值)。如果当前像素点的颜色分量是红色分量,同理可以获得排序后的蓝色分量的第七加权均值(即当前像素点的蓝色分量的门限值)。
其中,每个颜色分量值的四个权重的和为1,每个加权均值的四个权重的大小根据实际情况确定。
其中,子步骤S203a之后,还可以包括:C、D以及E,具体内容如下:
C:获得排序后的绿色分量的第二加权均值和第三加权均值,第二加权均值大于第三加权均值,第二加权均值和第三加权均值即为当前像素点的绿色分量的门限值的门限最大值与门限最小值。
C相比子步骤S203b来说,对排序后的绿色分量的门限值要求有两个,分别是门限最大值与门限最小值。采用的方法和子步骤S203b基本一样,在此不再赘述。
通过门限最大值与门限最小值,可以使得后续的绿色分量的修正值更加精确。
D:在当前像素点的颜色分量是蓝色分量时,获得排序后的红色分量的第五加权均值和第六加权均值,第五加权均值大于第六加权均值,第五加权均值和第六加权均值即为当前像素点的红色分量的门限值的门限最大值与门限最小值。
D相比子步骤S203b来说,对排序后的红色分量的门限值要求有两个,分别是门限最大值与门限最小值。采用的方法和子步骤S203b基本一样,在此不再赘述。
E:在当前像素点的颜色分量是红色分量时,获得排序后的蓝色分量的第八加权均值和第九加权均值,第八加权均值大于第九加权均值,第八加权均值和第九加权均值即为当前像素点的蓝色分量的门限值的门限最大值与门限最小值。
E相比子步骤S203b来说,对排序后的蓝色分量的门限值要求有两个,分别是门限最大值与门限最小值。采用的方法和子步骤S203b基本一样,在此不再赘述。
需要指出的是,步骤S201、步骤S202以及步骤S203在执行时,没有先后顺序,也可以并行执行。如果执行子步骤S203b,不用执行C、D以及E,如果执行C、D或者C、E(即D和E择一执行),则不用执行子步骤S203b。
第二部分:按照当前像素点的第一结果,获得当前像素点的第二结果,当前像素点的第二结果包括:当前像素点的绿色分量的修正值以及红色分量或蓝色分量的修正值。
第二部分包括步骤S204、步骤S205以及步骤S206。
步骤S204:判断当前像素点在水平垂直方向上的第一梯度最小值是否小于或等于当前像素点在斜方向上的第二梯度最小值。如果第一梯度最小值小于或等于第二梯度最小值,进入步骤S205,如果第一梯度最小值大于第二梯度最小值,进入步骤S206。
为了便于理解步骤S205、步骤S206以及后续的内容,需要说明的是:当前像素点的第一绿色分量值与当前像素点的绿色分量的门限值之间的差值是第一差值;在当前像素点的颜色分量是蓝色分量时,当前像素点的第一红色分量值与当前像素点的红色分量的门限值之间的差值是第二差值;在当前像素点的颜色分量是红色分量时,当前像素点的第一蓝色分量值与当前像素点的蓝色分量的门限值之间的差值是第三差值。
需要说明的是,步骤S204判断的方式也可以是:判断当前像素点在水平垂直方向上的第一梯度值是否小于或等于当前像素点在斜方向上的第二梯度值,其中,第一梯度值等于第一梯度最小值乘以参数a,第二梯度值等于第二梯度最小值乘以参数b,参数a和b可以是以下几种情况:
(1)参数a是第一梯度最小值所对应的估计均值的倒数,且参数b是第二梯度最小值所对应的估计均值的倒数;
(2)参数a是常数1且参数b是常数1,即为步骤S204对应的情况;
(3)参数a和b是通过某种同一类算法求得的参数。
其中,步骤S205包括子步骤S205a或者子步骤S205b,两个子步骤择一执行,具体内容如下:
步骤S205a:若第一梯度最小值小于或等于第二梯度最小值,在当前像素点的颜色分量是蓝色分量时,当前像素点的绿色分量的修正值等于第一差值,当前像素点的红色分量的修正值等于第一差值与第二差值中的一个差值。
如果第一梯度最小值小于或等于第二梯度最小值,且当前像素点的颜色分量是蓝色分量,表明在以当前像素点为中心的3×3窗口内四个绿色分量所在的水平垂直方向比四个红色分所在的斜方向的边沿方向性更强。此时,当前像素点的绿色分量的修正值等于第一差值(即当前像素点的第一绿色分量值与当前像素点的绿色分量的门限值之间的差值);当前像素点的红色分量的修正值等于第一差值与第二差值(即当前像素点的第一红色分量值与当前像素点的红色分量的门限值之间的差值)中的一个差值,即选择第一差值与第二差值中的一个差值作为当前像素点的红色分量的修正值。
其中,当前像素点的红色分量的修正值等于第一差值与第二差值中的一个差值,可以是:当前像素点的红色分量的修正值等于第一差值与第二差值中最小的差值。即选择第一差值与第二差值中的较小的差值作为当前像素点的红色分量的修正值。
通过这种方式,可以更好的让当前像素点的红色分量的修正值保持平滑的增减,有效减少颜色之间的串扰。
子步骤S205b:若第一梯度最小值小于或等于第二梯度最小值,在当前像素点的颜色分量是红色分量时,则当前像素点的绿色分量的修正值等于第一差值,当前像素点的蓝色分量的修正值等于第一差值与第三差值中的一个差值。
如果第一梯度最小值小于或等于第二梯度最小值,且当前像素点的颜色分量是红色分量,表明在以当前像素点为中心的3×3窗口内四个绿色分量所在的水平垂直方向比四个蓝色分所在的斜方向的边沿方向性更强。此时,当前像素点的绿色分量的修正值等于第一差值(即当前像素点的第一绿色分量值与当前像素点的绿色分量的门限值之间的差值);当前像素点的蓝色分量的修正值等于第一差值与第三差值(即当前像素点的第一蓝色分量值与当前像素点的蓝色分量的门限值之间的差值)中的一个差值,即选择第一差值与第三差值中的一个差值作为当前像素点的蓝色分量的修正值。
其中,当前像素点的蓝色分量的修正值等于第一差值与第三差值中的一个差值,可以是:当前像素点的蓝色分量的修正值等于第一差值与第三差值中最小的差值。即选择第一差值与第三差值中的较小的差值作为当前像素点的蓝色分量的修正值。
通过这种方式,可以更好的让当前像素点的蓝色分量的修正值保持平滑的增减,有效减少颜色之间的串扰。
其中,步骤S206包括子步骤S206a或者子步骤S206b,两个子步骤择一执行,具体内容如下:
步骤S206a:若第一梯度最小值大于第二梯度最小值,在当前像素点的颜色分量是蓝色分量时,则当前像素点的绿色分量的修正值等于第一差值与第二差值中的一个差值,当前像素点的红色分量的修正值等于第二差值。
如果第一梯度最小值大于第二梯度最小值,且当前像素点的颜色分量是蓝色分量,表明在以当前像素点为中心的3×3窗口内四个红色分量所在的斜方向比四个绿色分量所在的水平垂直方向的边沿方向性更强。此时,当前像素点的绿色分量的修正值等于第一差值与第二差值中的一个差值,即选择第一差值与第二差值中的一个差值作为当前像素点的绿色分量的修正值;当前像素点的红色分量的修正值等于第二差值。
其中,当前像素点的绿色分量的修正值等于第一差值与第二差值中的一个差值,可以是:当前像素点的绿色分量的修正值等于第一差值与第二差值中最小的差值。即选择第一差值与第二差值中的一个较小的差值作为当前像素点的绿色分量的修正值。
通过这种方式,可以更好的让当前像素点的绿色分量的修正值保持平滑的增减,有效减少颜色之间的串扰。
子步骤S206b:若第一梯度最小值大于第二梯度最小值,在当前像素点的颜色分量是红色分量时,则当前像素点的绿色分量的修正值等于第一差值与第三差值中的一个差值,当前像素点的蓝色分量的修正值等于第三差值。
如果第一梯度最小值大于第二梯度最小值,且当前像素点的颜色分量是红色分量,表明在以当前像素点为中心的3×3窗口内四个蓝色分量所在的斜方向比四个绿色分量所在的水平垂直方向的边沿方向性更强。此时,当前像素点的绿色分量的修正值等于第一差值与第三差值中的一个差值,即选择第一差值与第三差值中的一个差值作为当前像素点的绿色分量的修正值;当前像素点的蓝色分量的修正值等于第三差值。
其中,当前像素点的绿色分量的修正值等于第一差值与第三差值中的一个差值,可以是:当前像素点的绿色分量的修正值等于第一差值与第三差值中最小的差值。即选择第一差值与第三差值中的一个较小的差值作为当前像素点的绿色分量的修正值。
进一步地,如果第一部分中执行C,在当前像素点的第一绿色分量值小于当前像素点的绿色分量的门限最小值时,第一差值是当前像素点的第一绿色分量值与当前像素点的绿色分量的门限最小值之间的差值;在当前像素点的第一绿色分量值大于当前像素点的绿色分量的门限最大值时,第一差值是当前像素点的第一绿色分量值与当前像素点的绿色分量的门限最大值之间的差值;在当前像素点的第一绿色分量值大于或等于当前像素点的绿色分量的门限最小值,且小于或等于当前像素点的绿色分量的门限最大值时,第一差值为0。
简单来说,如果当前像素点的第一绿色分量值在当前像素点的绿色分量的门限最小值与门限最大值之间,则第一差值为0;如果当前像素点的第一绿色分量值比当前像素点的绿色分量的门限最小值还小,则第一差值等于当前像素点的第一绿色分量值与当前像素点的绿色分量的门限最小值之间的差值,此时差值是正数;如果当前像素点的第一绿色分量值比当前像素点的绿色分量的门限最大值还大,则第一差值等于当前像素点的第一绿色分量值与当前像素点的绿色分量的门限最大值之间的差值,此时差值是负数。
通过这种方式,可以进一步更好的让当前像素点的绿色分量的修正值保持平滑的增减,有效减少颜色之间的串扰。
进一步地,如果第一部分中执行D,在当前像素点的第一红色分量值小于当前像素点的红色分量的门限最小值时,第二差值是当前像素点的第一红色分量值与当前像素点的红色分量的门限最小值之间的差值;在当前像素点的第一红色分量值大于当前像素点的红色分量的门限最大值时,第二差值是当前像素点的第一红色分量值与当前像素点的红色分量的门限最大值之间的差值;在当前像素点的第一红色分量值大于或等于当前像素点的红色分量的门限最小值,且小于或等于当前像素点的红色分量的门限最大值时,第二差值为0。
简单来说,如果当前像素点的第一红色分量值在当前像素点的红色分量的门限最小值与门限最大值之间,则第二差值为0;如果当前像素点的第一红色分量值比当前像素点的红色分量的门限最小值还小,则第二差值等于当前像素点的第一红色分量值与当前像素点的红色分量的门限最小值之间的差值,此时差值是正数;如果当前像素点的第一红色分量值比当前像素点的红色分量的门限最大值还大,则第二差值等于当前像素点的第一红色分量值与当前像素点的红色分量的门限最大值之间的差值,此时差值是负数。
通过这种方式,可以进一步更好的让当前像素点的红色分量的修正值保持平滑的增减,有效减少颜色之间的串扰。
进一步地,如果第一部分中执行E,在当前像素点的第一蓝色分量值小于当前像素点的蓝色分量的门限最小值时,第三差值是当前像素点的第一蓝色分量值与当前像素点的蓝色分量的门限最小值之间的差值;在当前像素点的第一蓝色分量值大于当前像素点的蓝色分量的门限最大值时,第三差值是当前像素点的第一蓝色分量值与当前像素点的蓝色分量的门限最大值之间的差值;在当前像素点的第一蓝色分量值大于或等于当前像素点的蓝色分量的门限最小值,且小于或等于当前像素点的蓝色分量的门限最大值时,第三差值为0。
简单来说,如果当前像素点的第一蓝色分量值在当前像素点的蓝色分量的门限最小值与门限最大值之间,则第三差值为0;如果当前像素点的第一蓝色分量值比当前像素点的蓝色分量的门限最小值还小,则第三差值等于当前像素点的第一蓝色分量值与当前像素点的蓝色分量的门限最小值之间的差值,此时差值是正数;如果当前像素点的第一蓝色分量值比当前像素点的蓝色分量的门限最大值还大,则第三差值等于当前像素点的第一蓝色分量值与当前像素点的蓝色分量的门限最大值之间的差值,此时差值是负数。
通过这种方式,可以进一步更好的让当前像素点的蓝色分量的修正值保持平滑的增减,有效减少颜色之间的串扰。
第三部分的内容即为步骤S207的内容,具体如下:
步骤S207:根据当前像素点的第一绿色分量值、第一红色分量值或第一蓝色分量值以及当前像素点的第二结果,获得当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值,其中,当前像素点的第二绿色分量值等于当前像素点的第一绿色分量值与当前像素点的绿色分量的修正值之和,当前像素点的第二红色分量值或第二蓝色分量值等于当前像素点的第一红色分量值或第一蓝色分量值与当前像素点的红色分量或蓝色分量的修正值之和。
在获得当前像素点的第一绿色分量值、第一红色分量值或第一蓝色分量值,以及当前像素点的绿色分量的修正值以及红色分量或蓝色分量的修正值后,即可获得当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值。当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值即为经过修正后的当前像素点的绿色分量值以及红色分量值或蓝色分量值。
本发明对通过插值算法得出的绿色分量值以及红色分量值或蓝色分量值进行修正,在修正时综合考虑像素点在不同方向的梯度值、绿色分量的门限值以及红色分量或蓝色分量的门限值。通过上述方式,能够巧妙地利用像素点在不同方向的梯度值、绿色分量的门限值以及红色分量或蓝色分量的门限值,对通过插值算法得出的绿色分量值以及红色分量值或蓝色分量值进行修正,从而减轻当前像素点所在的颜色分量对插值出的其它两种颜色分量的串扰。
另外,以当前像素点为中心的3×3窗口,选取了以当前像素点为中心且包括邻近像素点的最小的窗口,可以简化计算过程;通过门限最大值与门限最小值,可以使得颜色分量的修正值更加精确,可以更好的让当前像素点的颜色分量的修正值保持平滑的增减,有效减少颜色之间的串扰。
参阅图4,图4是本发明图像处理装置一实施方式的结构示意图,该装置包括:第一获得模块301、第二获得模块302以及第三获得模块303。
第一获得模块301用于获得当前像素点的第一结果,当前像素点的第一结果包括:当前像素点通过插值算法得到的第一绿色分量值以及第一红色分量值或第一蓝色分量值、当前像素点在水平垂直方向上的第一梯度最小值、当前像素点在斜方向上的第二梯度最小值、当前像素点的绿色分量的门限值,以及当前像素点的红色分量或蓝色分量的门限值,第一获得模块301向第二获得模块302和第三获得模块303发送获得的当前像素点的第一结果。
通过插值算法获得当前像素点的第一绿色分量值以及第一红色分量值或第一蓝色分量值。
当前像素点在水平方向上的梯度值与在垂直方向上的梯度值中最小的梯度值即为当前像素点在水平垂直方向上的第一梯度最小值,当前像素点分别在两个对角线方向上的梯度值中最小的梯度值即为当前像素点在斜方向上的第二梯度最小值。
当前像素点和邻近像素点之间不是彼此独立的,而是存在相关关系的,利用这种相关关系,即可获得当前像素点的绿色分量的门限值以及红色分量的门限值或蓝色分量的门限值。
第二获得模块302用于接收第一获得模块301发送的当前像素点的第一结果,按照当前像素点的第一结果,获得当前像素点的第二结果,当前像素点的第二结果包括:当前像素点的绿色分量的修正值以及红色分量或蓝色分量的修正值,第二获得模块302向第三获得模块303发送获得的当前像素点的第二结果。
在获得当前像素点的绿色分量的修正值以及红色分量或蓝色分量的修正值时,充分考虑当前像素点在水平垂直方向上的第一梯度最小值、当前像素点在斜方向上的第二梯度最小值、当前像素点的绿色分量的门限值,以及当前像素点的红色分量或蓝色分量的门限值这些影响因素。
第三获得模块303用于接收第一获得模块301和第二获得模块302分别发送的当前像素点的第一结果和第二结果,根据当前像素点的第一绿色分量值、第一红色分量值或第一蓝色分量值以及当前像素点的第二结果,获得当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值,其中,当前像素点的第二绿色分量值等于当前像素点的第一绿色分量值与当前像素点的绿色分量的修正值之和,当前像素点的第二红色分量值或第二蓝色分量值等于当前像素点的第一红色分量值或第一蓝色分量值与当前像素点的红色分量或蓝色分量的修正值之和。
在获得当前像素点的第一绿色分量值、第一红色分量值或第一蓝色分量值,以及当前像素点的绿色分量的修正值以及红色分量或蓝色分量的修正值后,即可获得当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值。当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值即为经过修正后的当前像素点的绿色分量值以及红色分量值或蓝色分量值。
本发明对通过插值算法得出的绿色分量值以及红色分量值或蓝色分量值进行修正,在修正时综合考虑像素点在不同方向的梯度值、绿色分量的门限值以及红色分量或蓝色分量的门限值。通过上述方式,能够减轻当前像素点所在的颜色分量对插值出的其它两种颜色分量的串扰。
参阅图5至图7,图5至图7是本发明图像处理装置三个实施方式的结构示意图,该装置包括:第一获得模块401、第二获得模块402以及第三获得模块403。
第一获得模块401用于获得当前像素点的第一结果,当前像素点的第一结果包括:当前像素点通过插值算法得到的第一绿色分量值以及第一红色分量值或第一蓝色分量值、当前像素点在水平垂直方向上的第一梯度最小值、当前像素点在斜方向上的第二梯度最小值、当前像素点的绿色分量的门限值,以及当前像素点的红色分量或蓝色分量的门限值,第一获得模块401向第二获得模块402和第三获得模块403发送获得的当前像素点的第一结果。
第一获得模块401包括:第一获得单元4011、第二获得单元4012、第三获得单元4018、排序单元4013以及第一门限值获得单元4014。
第一获得单元4011用于在以当前像素点为中心的3×3窗口内,获得当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值,并向第二获得单元4012发送当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值。
第一获得单元4011包括:第一获得子单元和第二获得子单元。
第一获得子单元用于获得当前像素点在某一方向上的同一种颜色分量值相减的绝对值,某一方向是水平方向、垂直方向、斜45度方向以及斜135度方向中的任一个方向,并向第二获得子单元发送获得的当前像素点在某一方向上的同一种颜色分量值相减的绝对值。
第二获得子单元用于接收第一获得子单元发送的当前像素点在某一方向上的同一种颜色分量值相减的绝对值,将当前像素点在某一方向上所有的同一种颜色分量值相减的绝对值求和,求和的结果即为当前像素点在某一方向上的梯度值,按照该方法,即可获得当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值。
第二获得单元4012用于接收第一获得单元4011发送的当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值,获得当前像素点在水平方向与垂直方向上的梯度值的最小值,获得的在水平方向与垂直方向上的梯度值的最小值即为当前像素点在水平垂直方向上的第一梯度最小值,获得当前像素点在斜45度方向与斜135度方向上的梯度值的最小值,获得的在斜45度方向与斜135度方向上的梯度值的最小值即为当前像素点在斜方向上的第二梯度最小值。
第三获得单元4018用于通过插值算法得到当前像素点的第一绿色分量值以及第一红色分量值或第一蓝色分量值。
排序单元4013用于在以当前像素点为中心的3×3窗口内,将当前像素点的邻近像素点的四个绿色分量值和四个红色分量值或者四个蓝色分量值分别按照大小排序,并向第一门限值获得单元4014及相关单元(第二门限值获得单元4015、第三门限值获得单元4016以及第四门限值获得单元4017)发送当前像素点的邻近像素点的四个绿色分量值和四个红色分量值或者四个蓝色分量值的排序结果。
第一门限值获得单元4014用于接收排序单元4013发送的排序结果,获得排序后的绿色分量和红色分量或者蓝色分量的第一加权均值和第四加权均值或第七加权均值,第一加权均值和第四加权均值或第七加权均值即为当前像素点的绿色分量的门限值以及当前像素点的红色分量或蓝色分量的门限值。
第一获得模块401还包括:第二门限值获得单元4015、第三门限值获得单元4016或者第四门限值获得单元4017。
第二门限值获得单元4015用于接收排序单元4013发送的排序结果,获得排序后的绿色分量的第二加权均值和第三加权均值,第二加权均值大于第三加权均值,第二加权均值和第三加权均值即为当前像素点的绿色分量的门限值的门限最大值与门限最小值。
第三门限值获得单元4016用于接收排序单元4013发送的排序结果,在当前像素点的颜色分量是蓝色分量时,获得排序后的红色分量的第五加权均值和第六加权均值,第五加权均值大于第六加权均值,第五加权均值和第六加权均值即为当前像素点的红色分量的门限值的门限最大值与门限最小值。
第四门限值获得单元4017用于接收排序单元4013发送的排序结果,在当前像素点的颜色分量是红色分量时,获得排序后的蓝色分量的第八加权均值和第九加权均值,第八加权均值大于第九加权均值,第八加权均值和第九加权均值即为当前像素点的蓝色分量的门限值的门限最大值与门限最小值。
需要指出的是,第一获得模块401包括第一门限值获得单元4014时,不包括第二门限值获得单元4015、第三门限值获得单元4016或者第四门限值获得单元4017;第一获得模块401包括第二门限值获得单元4015与第三门限值获得单元4016或者第二门限值获得单元4015与第四门限值获得单元4017时,不包括第一门限值获得单元4014。
第二获得模块402用于接收第一获得模块401发送的当前像素点的第一结果,按照当前像素点的第一结果,获得当前像素点的第二结果,当前像素点的第二结果包括:当前像素点的绿色分量的修正值以及红色分量或蓝色分量的修正值,第二获得模块402向第三获得模块403发送获得的当前像素点的第二结果;
第二获得模块402包括:第一修正值确定单元4021和第二修正值确定单元4022。
需要指出的是,当前像素点的第一绿色分量值与当前像素点的绿色分量的门限值之间的差值是第一差值;在当前像素点的颜色分量是蓝色分量时,当前像素点的第一红色分量值与当前像素点的红色分量的门限值之间的差值是第二差值;在当前像素点的颜色分量是红色分量时,当前像素点的第一蓝色分量值与当前像素点的蓝色分量的门限值之间的差值是第三差值。
第一修正值确定单元4021用于接收第一获得模块401发送的当前像素点的第一结果,在第一梯度最小值小于或等于第二梯度最小值时,当前像素点的绿色分量的修正值等于第一差值,在当前像素点的颜色分量是蓝色分量时,当前像素点的红色分量的修正值等于第一差值与第二差值中的一个差值,在当前像素点的颜色分量是红色分量时,当前像素点的蓝色分量的修正值等于第一差值与第三差值中的一个差值。
第一修正值确定单元4021具体用于在当前像素点的颜色分量是蓝色分量时,当前像素点的红色分量的修正值等于第一差值与第二差值中最小的差值,在当前像素点的颜色分量是红色分量时,当前像素点的蓝色分量的修正值等于第一差值与第三差值中最小的差值。
第二修正值确定单元4022用于接收第一获得模块401发送的当前像素点的第一结果,在第一梯度最小值大于第二梯度最小值时,在当前像素点的颜色分量是蓝色分量时,当前像素点的绿色分量的修正值等于第一差值与第二差值中的一个差值,当前像素点的红色分量的修正值等于第二差值,在当前像素点的颜色分量是红色分量时,当前像素点的绿色分量的修正值等于第一差值与第三差值中的一个差值,当前像素点的蓝色分量的修正值等于第三差值。
第二修正值确定单元4022具体用于在当前像素点的颜色分量是蓝色分量时,当前像素点的绿色分量的修正值等于第一差值与第二差值中最小的差值,在当前像素点的颜色分量是红色分量时,当前像素点的绿色分量的修正值等于第一差值与第三差值中最小的差值。
其中,在当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值小于当前像素点的绿色分量、或红色分量、或蓝色分量的门限最小值时,第一差值、或第二差值、或第三差值是当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值与当前像素点的绿色分量、或红色分量、或蓝色分量的门限最小值之间的差值。
其中,在当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值大于当前像素点的绿色分量、或红色分量、或蓝色分量的门限最大值时,第一差值、或第二差值、或第三差值是当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值与当前像素点的绿色分量、或红色分量、或蓝色分量的门限最大值之间的差值。
其中,在当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值大于或等于当前像素点的绿色分量、或红色分量、或蓝色分量的门限最小值,且小于或等于当前像素点的绿色分量、或红色分量、或蓝色分量的门限最大值时,第一差值、或第二差值、或第三差值为0。
第三获得模块403用于接收第一获得模块和第二获得模块分别发送的当前像素点的第一结果和第二结果,根据当前像素点的第一绿色分量值、第一红色分量值或第一蓝色分量值以及当前像素点的第二结果,获得当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值,其中,当前像素点的第二绿色分量值等于当前像素点的第一绿色分量值与当前像素点的绿色分量的修正值之和,当前像素点的第二红色分量值或第二蓝色分量值等于当前像素点的第一红色分量值或第一蓝色分量值与当前像素点的红色分量或蓝色分量的修正值之和。
本发明对通过插值算法得出的绿色分量值以及红色分量值或蓝色分量值进行修正,在修正时综合考虑像素点在不同方向的梯度值、绿色分量的门限值以及红色分量或蓝色分量的门限值。通过上述方式,能够减轻当前像素点所在的颜色分量对插值出的其它两种颜色分量的串扰。
参阅图8,图8是本发明成像设备一实施方式的结构示意图,该设备包括:彩色成像装置501、第一获得模块502、第二获得模块503、第三获得模块504以及输出模块505。
彩色成像装置501包括拜耳阵列,用于获取原始图像的每个像素点的三个颜色分量中的一个颜色分量,并向第一获得模块502发送获取的原始图像的每个像素点的三个颜色分量中的一个颜色分量。
第一获得模块502用于接收彩色成像装置501发送的每个像素点的三个颜色分量中的一个颜色分量,获得当前像素点的第一结果,当前像素点的第一结果包括:当前像素点通过插值算法得到的第一绿色分量值以及第一红色分量值或第一蓝色分量值、当前像素点在水平垂直方向上的第一梯度最小值、当前像素点在斜方向上的第二梯度最小值、当前像素点的绿色分量的门限值,以及当前像素点的红色分量或蓝色分量的门限值,第一获得模块502向第二获得模块503和第三获得模块504发送获得的当前像素点的第一结果。
第二获得模块503用于接收第一获得模块502发送的当前像素点的第一结果,按照当前像素点的第一结果,获得当前像素点的第二结果,当前像素点的第二结果包括:当前像素点的绿色分量的修正值以及红色分量或蓝色分量的修正值,第二获得模块503向第三获得模块504发送获得的当前像素点的第二结果。
第三获得模块504用于接收第一获得模块502和第二获得模块503分别发送的当前像素点的第一结果和第二结果,根据当前像素点的第一绿色分量值、第一红色分量值或第一蓝色分量值以及当前像素点的第二结果,获得当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值,其中,当前像素点的第二绿色分量值等于当前像素点的第一绿色分量值与当前像素点的绿色分量的修正值之和,当前像素点的第二红色分量值或第二蓝色分量值等于当前像素点的第一红色分量值或第一蓝色分量值与当前像素点的红色分量或蓝色分量的修正值之和,第三获得模块向输出模块发送当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值。
输出模块505用于接收第三获得模块504发送的当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值,在当前像素点的颜色分量是蓝色分量时,将当前像素点的蓝色分量值、第二绿色分量值以及第二红色分量值合成后输出当前像素点的最终颜色,在当前像素点的颜色分量是红色分量时,将当前像素点的红色分量值、第二绿色分量值以及第二蓝色分量值合成后输出当前像素点的最终颜色。
本发明对通过插值算法得出的绿色分量值以及红色分量值或蓝色分量值进行修正,在修正时综合考虑像素点在不同方向的梯度值、绿色分量的门限值以及红色分量或蓝色分量的门限值。通过上述方式,能够减轻当前像素点所在的颜色分量对插值出的其它两种颜色分量的串扰。
参阅图9,图9是本发明提供的另一种图像处理装置,该装置包括处理器91和存储器92。
处理器91用于获得当前像素点的第一结果,当前像素点的第一结果包括:当前像素点通过插值算法得到的第一绿色分量值以及第一红色分量值或第一蓝色分量值、当前像素点在水平垂直方向上的第一梯度最小值、当前像素点在斜方向上的第二梯度最小值、当前像素点的绿色分量的门限值,以及当前像素点的红色分量或蓝色分量的门限值;并将当前像素点的第一结果保存在存储器92中。
处理器91还用于读取保存在存储器92中的当前像素点的第一结果,按照当前像素点的第一结果,获得当前像素点的第二结果,当前像素点的第二结果包括:当前像素点的绿色分量的修正值以及红色分量或蓝色分量的修正值;并将当前像素点的第二结果保存在存储器92中。
处理器91还用于读取保存在存储器92中的当前像素点的第一结果和第二结果,根据当前像素点的第一绿色分量值、第一红色分量值或第一蓝色分量值以及当前像素点的第二结果,获得当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值,其中,当前像素点的第二绿色分量值等于当前像素点的第一绿色分量值与当前像素点的绿色分量的修正值之和,当前像素点的第二红色分量值或第二蓝色分量值等于当前像素点的第一红色分量值或第一蓝色分量值与当前像素点的红色分量或蓝色分量的修正值之和。
本发明对通过插值算法得出的绿色分量值以及红色分量值或蓝色分量值进行修正,在修正时综合考虑像素点在不同方向的梯度值、绿色分量的门限值以及红色分量或蓝色分量的门限值。通过上述方式,能够减轻当前像素点所在的颜色分量对插值出的其它两种颜色分量的串扰。
在本发明所提供的几个实施方式中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施方式仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例实施方式方案的目的。
另外,在本发明各个实施方式中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本发明各个实施方式所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述仅为本发明的实施方式,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。

Claims (23)

  1. 一种图像处理方法,其特征在于,包括:
    获得所述当前像素点的第一结果,所述当前像素点的第一结果包括:所述当前像素点通过插值算法得到的第一绿色分量值以及第一红色分量值或第一蓝色分量值、所述当前像素点在水平垂直方向上的第一梯度最小值、所述当前像素点在斜方向上的第二梯度最小值、所述当前像素点的绿色分量的门限值,以及所述当前像素点的红色分量或蓝色分量的门限值;
    按照所述当前像素点的第一结果,获得所述当前像素点的第二结果,所述当前像素点的第二结果包括:所述当前像素点的绿色分量的修正值以及红色分量或蓝色分量的修正值;
    根据所述当前像素点的第一绿色分量值、第一红色分量值或第一蓝色分量值以及当前像素点的第二结果,获得所述当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值,其中,所述当前像素点的第二绿色分量值等于所述当前像素点的第一绿色分量值与所述当前像素点的绿色分量的修正值之和,所述当前像素点的第二红色分量值或第二蓝色分量值等于所述当前像素点的第一红色分量值或第一蓝色分量值与所述当前像素点的红色分量或蓝色分量的修正值之和。
  2. 根据权利要求1所述的方法,其特征在于,所述按照当前像素点的第一结果,获得所述当前像素点的第二结果的步骤,包括:
    若所述第一梯度最小值小于或等于所述第二梯度最小值,则所述当前像素点的绿色分量的修正值等于所述第一差值,在所述当前像素点的颜色分量是蓝色分量时,所述当前像素点的红色分量的修正值等于所述第一差值与第二差值中的一个差值,在所述当前像素点的颜色分量是红色分量时,所述当前像素点的蓝色分量的修正值等于所述第一差值与第三差值中的一个差值;
    或,若所述第一梯度最小值大于第二梯度最小值,则在所述当前像素点的颜色分量是蓝色分量时,所述当前像素点的绿色分量的修正值等于所述第一差值与第二差值中的一个差值,所述当前像素点的红色分量的修正值等于所述第二差值,在所述当前像素点的颜色分量是红色分量时,所述当前像素点的绿色分量的修正值等于所述第一差值与第三差值中的一个差值,所述当前像素点的蓝色分量的修正值等于所述第三差值;
    其中,所述当前像素点的第一绿色分量值与所述当前像素点的绿色分量的门限值之间的差值是第一差值;在所述当前像素点的颜色分量是蓝色分量时,所述当前像素点的第一红色分量值与所述当前像素点的红色分量的门限值之间的差值是第二差值;在所述当前像素点的颜色分量是红色分量时,所述当前像素点的第一蓝色分量值与所述当前像素点的蓝色分量的门限值之间的差值是第三差值。
  3. 根据权利要求2所述的方法,其特征在于,所述当前像素点的红色分量的修正值等于所述第一差值与第二差值中的一个差值的步骤,包括:所述当前像素点的红色分量的修正值等于所述第一差值与第二差值中最小的差值。
  4. 根据权利要求2所述的方法,其特征在于,所述当前像素点的蓝色分量的修正值等于所述第一差值与第三差值中的一个差值的步骤,包括:所述当前像素点的蓝色分量的修正值等于所述第一差值与第三差值中最小的差值。
  5. 根据权利要求2所述的方法,其特征在于,所述当前像素点的绿色分量的修正值等于所述第一差值与第二差值中的一个差值的步骤,包括:所述当前像素点的绿色分量的修正值等于所述第一差值与第二差值中最小的差值。
  6. 根据权利要求2所述的方法,其特征在于,所述当前像素点的绿色分量的修正值等于所述第一差值与第三差值中的一个差值的步骤,包括:所述当前像素点的绿色分量的修正值等于所述第一差值与第三差值中最小的差值。
  7. 根据权利要求1所述的方法,其特征在于,所述获得当前像素点在水平垂直方向上的第一梯度最小值、所述当前像素点在斜方向上的第二梯度最小值的步骤,包括:
    在以当前像素点为中心的3×3窗口内,获得所述当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值;
    获得所述当前像素点在水平方向与垂直方向上的梯度值的最小值,所述获得的在水平方向与垂直方向上的梯度值的最小值即为所述当前像素点在水平垂直方向上的第一梯度最小值,获得所述当前像素点在斜45度方向与斜135度方向上的梯度值的最小值,所述获得的在斜45度方向与斜135度方向上的梯度值的最小值即为所述当前像素点在斜方向上的第二梯度最小值。
  8. 根据权利要求7所述的方法,其特征在于,所述获得当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值的步骤,包括:
    获得所述当前像素点在某一方向上的同一种颜色分量值相减的绝对值,所述某一方向是所述水平方向、垂直方向、斜45度方向以及斜135度方向中的任一个方向;
    将所述当前像素点在某一方向上所有的同一种颜色分量值相减的绝对值求和,所述求和的结果即为所述当前像素点在某一方向上的梯度值,按照所述方法,即可获得当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值。
  9. 根据权利要求1所述的方法,其特征在于,所述获得所述当前像素点的绿色分量的门限值以及所述当前像素点的红色分量或蓝色分量的门限值的步骤,包括:
    在以当前像素点为中心的3×3窗口内,将所述当前像素点的邻近像素点的四个绿色分量值和四个红色分量值或者四个蓝色分量值分别按照大小排序;
    获得排序后的绿色分量和红色分量或者蓝色分量的第一加权均值和第四加权均值或第七加权均值,所述第一加权均值和第四加权均值或第七加权均值即为所述当前像素点的绿色分量的门限值以及所述当前像素点的红色分量或蓝色分量的门限值。
  10. 根据权利要求9所述的方法,其特征在于,所述在以当前像素点为中心的3*3窗口内,将所述当前像素点的邻近像素点的四个绿色分量值按照大小排序的步骤之后,还包括:
    获得排序后的绿色分量的第二加权均值和第三加权均值,所述第二加权均值大于第三加权均值,所述第二加权均值和第三加权均值即为所述当前像素点的绿色分量的门限值的门限最大值与门限最小值。
  11. 根据权利要求9所述的方法,其特征在于,所述在以当前像素点为中心的3×3窗口内,将所述当前像素点的邻近像素点的四个红色分量值或者四个蓝色分量值按照大小排序的步骤之后,还包括:
    在当前像素点的颜色分量是蓝色分量时,获得排序后的红色分量的第五加权均值和第六加权均值,所述第五加权均值大于第六加权均值,所述第五加权均值和第六加权均值即为所述当前像素点的红色分量的门限值的门限最大值与门限最小值,在当前像素点的颜色分量是红色分量时,获得排序后的蓝色分量的第八加权均值和第九加权均值,所述第八加权均值大于第九加权均值,所述第八加权均值和第九加权均值即为所述当前像素点的蓝色分量的门限值的门限最大值与门限最小值。
  12. 根据权利要求2、10或11任一项所述的方法,其特征在于:
    在所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值小于所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最小值时,所述第一差值、或第二差值、或第三差值是所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值与所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最小值之间的差值;
    在所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值大于所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最大值时,所述第一差值、或第二差值、或第三差值是所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值与所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最大值之间的差值;
    在所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值大于或等于所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最小值,且小于或等于所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最大值时,所述第一差值、或第二差值、或第三差值为0。
  13. 一种图像处理装置,其特征在于,所述装置包括:第一获得模块、第二获得模块以及第三获得模块;
    所述第一获得模块用于获得所述当前像素点的第一结果,所述当前像素点的第一结果包括:所述当前像素点通过插值算法得到的第一绿色分量值以及第一红色分量值或第一蓝色分量值、所述当前像素点在水平垂直方向上的第一梯度最小值、所述当前像素点在斜方向上的第二梯度最小值、所述当前像素点的绿色分量的门限值,以及所述当前像素点的红色分量或蓝色分量的门限值,所述第一获得模块向所述第二获得模块和第三获得模块发送所述获得的当前像素点的第一结果;
    所述第二获得模块用于接收所述第一获得模块发送的当前像素点的第一结果,按照所述当前像素点的第一结果,获得所述当前像素点的第二结果,所述当前像素点的第二结果包括:所述当前像素点的绿色分量的修正值以及红色分量或蓝色分量的修正值,所述第二获得模块向所述第三获得模块发送获得的当前像素点的第二结果;
    所述第三获得模块用于接收所述第一获得模块和第二获得模块分别发送的当前像素点的第一结果和第二结果,根据所述当前像素点的第一绿色分量值、第一红色分量值或第一蓝色分量值以及当前像素点的第二结果,获得所述当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值,其中,所述当前像素点的第二绿色分量值等于所述当前像素点的第一绿色分量值与所述当前像素点的绿色分量的修正值之和,所述当前像素点的第二红色分量值或第二蓝色分量值等于所述当前像素点的第一红色分量值或第一蓝色分量值与所述当前像素点的红色分量或蓝色分量的修正值之和。
  14. 根据权利要求13所述的装置,其特征在于,所述第二获得模块包括:第一修正值确定单元和第二修正值确定单元;
    所述第一修正值确定单元用于接收所述第一获得模块发送的当前像素点的第一结果,在所述第一梯度最小值小于或等于所述第二梯度最小值时,所述当前像素点的绿色分量的修正值等于所述第一差值,在所述当前像素点的颜色分量是蓝色分量时,所述当前像素点的红色分量的修正值等于所述第一差值与第二差值中的一个差值,在所述当前像素点的颜色分量是红色分量时,所述当前像素点的蓝色分量的修正值等于所述第一差值与第三差值中的一个差值;
    所述第二修正值确定单元用于接收所述第一获得模块发送的当前像素点的第一结果,在所述第一梯度最小值大于第二梯度最小值时,在所述当前像素点的颜色分量是蓝色分量时,所述当前像素点的绿色分量的修正值等于所述第一差值与第二差值中的一个差值,所述当前像素点的红色分量的修正值等于所述第二差值,在所述当前像素点的颜色分量是红色分量时,所述当前像素点的绿色分量的修正值等于所述第一差值与第三差值中的一个差值,所述当前像素点的蓝色分量的修正值等于所述第三差值;
    其中,所述当前像素点的第一绿色分量值与所述当前像素点的绿色分量的门限值之间的差值是第一差值;在所述当前像素点的颜色分量是蓝色分量时,所述当前像素点的第一红色分量值与所述当前像素点的红色分量的门限值之间的差值是第二差值;在所述当前像素点的颜色分量是红色分量时,所述当前像素点的第一蓝色分量值与所述当前像素点的蓝色分量的门限值之间的差值是第三差值。
  15. 根据权利要求14所述的装置,其特征在于,所述第一修正值确定单元具体用于在所述当前像素点的颜色分量是蓝色分量时,所述当前像素点的红色分量的修正值等于所述第一差值与第二差值中最小的差值,在所述当前像素点的颜色分量是红色分量时,所述当前像素点的蓝色分量的修正值等于所述第一差值与第三差值中最小的差值。
  16. 根据权利要求14所述的装置,其特征在于,所述第二修正值确定单元具体用于在所述当前像素点的颜色分量是蓝色分量时,所述当前像素点的绿色分量的修正值等于所述第一差值与第二差值中最小的差值,在所述当前像素点的颜色分量是红色分量时,所述当前像素点的绿色分量的修正值等于所述第一差值与第三差值中最小的差值。
  17. 根据权利要求13所述的装置,其特征在于,所述第一获得模块包括:第一获得单元和第二获得单元;
    所述第一获得单元用于在以当前像素点为中心的3×3窗口内,获得所述当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值,并向所述第二获得单元发送所述当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值;
    所述第二获得单元用于接收所述第一获得单元发送的所述当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值,获得所述当前像素点在水平方向与垂直方向上的梯度值的最小值,所述获得的在水平方向与垂直方向上的梯度值的最小值即为所述当前像素点在水平垂直方向上的第一梯度最小值,获得所述当前像素点在斜45度方向与斜135度方向上的梯度值的最小值,所述获得的在斜45度方向与斜135度方向上的梯度值的最小值即为所述当前像素点在斜方向上的第二梯度最小值。
  18. 根据权利要求17所述的装置,其特征在于,所述第一获得单元包括:第一获得子单元和第二获得子单元;
    所述第一获得子单元用于获得所述当前像素点在某一方向上的同一种颜色分量值相减的绝对值,所述某一方向是所述水平方向、垂直方向、斜45度方向以及斜135度方向中的任一个方向,并向所述第二获得子单元发送获得的所述当前像素点在某一方向上的同一种颜色分量值相减的绝对值;
    第二获得子单元用于接收所述第一获得子单元发送的所述当前像素点在某一方向上的同一种颜色分量值相减的绝对值,将所述当前像素点在某一方向上所有的同一种颜色分量值相减的绝对值求和,所述求和的结果即为所述当前像素点在某一方向上的梯度值,按照所述方法,即可获得当前像素点在水平方向、垂直方向、斜45度方向以及斜135度方向上的梯度值。
  19. 根据权利要求13所述的装置,其特征在于,所述第一获得模块包括:排序单元和第一门限值获得单元;
    所述排序单元用于在以当前像素点为中心的3×3窗口内,将所述当前像素点的邻近像素点的四个绿色分量值和四个红色分量值或者四个蓝色分量值分别按照大小排序,并向所述第一门限值获得单元及相关单元发送所述当前像素点的邻近像素点的四个绿色分量值和四个红色分量值或者四个蓝色分量值的排序结果;
    所述第一门限值获得单元用于接收所述排序单元发送的排序结果,获得排序后的绿色分量和红色分量或者蓝色分量的第一加权均值和第四加权均值或第七加权均值,所述第一加权均值和第四加权均值或第七加权均值即为所述当前像素点的绿色分量的门限值以及所述当前像素点的红色分量或蓝色分量的门限值。
  20. 根据权利要求19所述的装置,其特征在于,所述第一获得模块还包括:第二门限值获得单元;
    第二门限值获得单元用于接收所述排序单元发送的排序结果,获得排序后的绿色分量的第二加权均值和第三加权均值,所述第二加权均值大于第三加权均值,所述第二加权均值和第三加权均值即为所述当前像素点的绿色分量的门限值的门限最大值与门限最小值。
  21. 根据权利要求19所述的装置,其特征在于,所述第一获得模块还包括:第三门限值获得单元和第四门限值获得单元;
    所述第三门限值获得单元用于接收所述排序单元发送的排序结果,在当前像素点的颜色分量是蓝色分量时,获得排序后的红色分量的第五加权均值和第六加权均值,所述第五加权均值大于第六加权均值,所述第五加权均值和第六加权均值即为所述当前像素点的红色分量的门限值的门限最大值与门限最小值;
    所述第四门限值获得单元用于接收所述排序单元发送的排序结果,在当前像素点的颜色分量是红色分量时,获得排序后的蓝色分量的第八加权均值和第九加权均值,所述第八加权均值大于第九加权均值,所述第八加权均值和第九加权均值即为所述当前像素点的蓝色分量的门限值的门限最大值与门限最小值。
  22. 根据权利要求14、20或21任一项所述的装置,其特征在于:
    在所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值小于所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最小值时,所述第一差值、或第二差值、或第三差值是所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值与所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最小值之间的差值;
    在所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值大于所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最大值时,所述第一差值、或第二差值、或第三差值是所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值与所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最大值之间的差值;
    在所述当前像素点的第一绿色分量值、或第一红色分量值、或第一蓝色分量值大于或等于所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最小值,且小于或等于所述当前像素点的绿色分量、或红色分量、或蓝色分量的门限最大值时,所述第一差值、或第二差值、或第三差值为0。
  23. 一种成像设备,其特征在于,所述设备包括:彩色成像装置、第一获得模块、第二获得模块、第三获得模块以及输出模块;
    所述彩色成像装置包括拜耳阵列,用于获取原始图像的每个像素点的三个颜色分量中的一个颜色分量,并向所述第一获得模块发送获取的原始图像的每个像素点的三个颜色分量中的一个颜色分量;
    所述第一获得模块用于接收所述彩色成像装置发送的每个像素点的三个颜色分量中的一个颜色分量,获得所述当前像素点的第一结果,所述当前像素点的第一结果包括:所述当前像素点通过插值算法得到的第一绿色分量值以及第一红色分量值或第一蓝色分量值、所述当前像素点在水平垂直方向上的第一梯度最小值、所述当前像素点在斜方向上的第二梯度最小值、所述当前像素点的绿色分量的门限值,以及所述当前像素点的红色分量或蓝色分量的门限值,所述第一获得模块向所述第二获得模块和第三获得模块发送所述获得的当前像素点的第一结果;
    所述第二获得模块用于接收所述第一获得模块发送的当前像素点的第一结果,按照所述当前像素点的第一结果,获得所述当前像素点的第二结果,所述当前像素点的第二结果包括:所述当前像素点的绿色分量的修正值以及红色分量或蓝色分量的修正值,所述第二获得模块向所述第三获得模块发送获得的当前像素点的第二结果;
    所述第三获得模块用于接收所述第一获得模块和第二获得模块分别发送的当前像素点的第一结果和第二结果,根据所述当前像素点的第一绿色分量值、第一红色分量值或第一蓝色分量值以及当前像素点的第二结果,获得所述当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值,其中,所述当前像素点的第二绿色分量值等于所述当前像素点的第一绿色分量值与所述当前像素点的绿色分量的修正值之和,所述当前像素点的第二红色分量值或第二蓝色分量值等于所述当前像素点的第一红色分量值或第一蓝色分量值与所述当前像素点的红色分量或蓝色分量的修正值之和,所述第三获得模块向所述输出模块发送所述当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值;
    所述输出模块用于接收所述第三获得模块发送的所述当前像素点的第二绿色分量值以及第二红色分量值或第二蓝色分量值,在当前像素点的颜色分量是蓝色分量时,将所述当前像素点的蓝色分量值、第二绿色分量值以及第二红色分量值合成后输出当前像素点的最终颜色,在当前像素点的颜色分量是红色分量时,将所述当前像素点的红色分量值、第二绿色分量值以及第二蓝色分量值合成后输出当前像素点的最终颜色。
PCT/CN2013/073878 2012-11-22 2013-04-08 图像处理方法、装置以及成像设备 WO2014079189A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2015543249A JP6059359B2 (ja) 2012-11-22 2013-04-08 画像処理方法および装置ならびにイメージングデバイス
US14/719,590 US9374567B2 (en) 2012-11-22 2015-05-22 Image processing method and apparatus, and imaging device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210478852.2 2012-11-22
CN201210478852.2A CN102938843B (zh) 2012-11-22 2012-11-22 图像处理方法、装置以及成像设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/719,590 Continuation US9374567B2 (en) 2012-11-22 2015-05-22 Image processing method and apparatus, and imaging device

Publications (1)

Publication Number Publication Date
WO2014079189A1 true WO2014079189A1 (zh) 2014-05-30

Family

ID=47697709

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/073878 WO2014079189A1 (zh) 2012-11-22 2013-04-08 图像处理方法、装置以及成像设备

Country Status (4)

Country Link
US (1) US9374567B2 (zh)
JP (1) JP6059359B2 (zh)
CN (1) CN102938843B (zh)
WO (1) WO2014079189A1 (zh)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102938843B (zh) 2012-11-22 2014-12-03 华为技术有限公司 图像处理方法、装置以及成像设备
CN103559692B (zh) * 2013-11-13 2017-01-11 华为技术有限公司 处理图像的方法与装置
CN104038746B (zh) * 2014-06-12 2016-06-08 北京英泰智软件技术发展有限公司 一种bayer格式图像数据插值方法
CN104202583B (zh) * 2014-08-07 2017-01-11 华为技术有限公司 图像处理装置和方法
JP6584131B2 (ja) * 2015-05-08 2019-10-02 キヤノン株式会社 撮像装置、撮像システム、および信号処理方法
CN107564047B (zh) * 2017-09-12 2020-10-20 北京小米移动软件有限公司 图像处理方法及装置、电子设备和计算机可读存储介质
US10572974B2 (en) * 2018-04-11 2020-02-25 Omnivision Technologies, Inc. Image demosaicer and method
CN109224462B (zh) * 2018-04-18 2020-02-04 解波 旋转木马客满状态分析方法
WO2020177123A1 (en) 2019-03-07 2020-09-10 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Color imaging system
CN110430403B (zh) * 2019-07-25 2021-11-02 上海晰图信息科技有限公司 一种图像处理方法和装置
CN111340693B (zh) * 2019-08-29 2023-12-01 杭州海康慧影科技有限公司 一种Bayer图像的插值方法、装置及电子设备
CN113393540B (zh) * 2021-06-10 2023-10-27 爱芯元智半导体(宁波)有限公司 图像中的色边像素点的确定方法、装置和计算机设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101511031A (zh) * 2008-12-15 2009-08-19 四川虹微技术有限公司 一种用于Bayer Data插值的方法
US20110141130A1 (en) * 2009-12-10 2011-06-16 Sony Corporation Display device
CN102254301A (zh) * 2011-07-22 2011-11-23 西安电子科技大学 基于边缘方向插值的cfa图像去马赛克方法
CN102938843A (zh) * 2012-11-22 2013-02-20 华为技术有限公司 图像处理方法、装置以及成像设备

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3771054B2 (ja) * 1998-07-01 2006-04-26 株式会社リコー 画像処理装置及び画像処理方法
JP3706789B2 (ja) 2000-05-12 2005-10-19 キヤノン株式会社 信号処理装置及び信号処理方法
US7502505B2 (en) * 2004-03-15 2009-03-10 Microsoft Corporation High-quality gradient-corrected linear interpolation for demosaicing of color images
US7830426B2 (en) * 2005-12-29 2010-11-09 Micron Technology, Inc. Method and apparatus providing color interpolation in color filter arrays using edge detection and correction terms
JP4688753B2 (ja) * 2006-08-02 2011-05-25 三菱電機株式会社 補間処理装置および補間処理方法
CN100568913C (zh) * 2006-12-05 2009-12-09 安凯(广州)软件技术有限公司 基于梯度的边缘增强颜色插值方法
US7825965B2 (en) * 2007-09-07 2010-11-02 Seiko Epson Corporation Method and apparatus for interpolating missing colors in a color filter array
JP5655355B2 (ja) * 2009-11-02 2015-01-21 ソニー株式会社 画素欠陥補正装置、撮像装置、画素欠陥補正方法、およびプログラム
CN102959958B (zh) 2011-02-28 2015-05-27 富士胶片株式会社 彩色成像设备
JP5353945B2 (ja) * 2011-05-13 2013-11-27 株式会社ニコン 画像処理装置および画像処理プログラム並びに電子カメラ

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101511031A (zh) * 2008-12-15 2009-08-19 四川虹微技术有限公司 一种用于Bayer Data插值的方法
US20110141130A1 (en) * 2009-12-10 2011-06-16 Sony Corporation Display device
CN102254301A (zh) * 2011-07-22 2011-11-23 西安电子科技大学 基于边缘方向插值的cfa图像去马赛克方法
CN102938843A (zh) * 2012-11-22 2013-02-20 华为技术有限公司 图像处理方法、装置以及成像设备

Also Published As

Publication number Publication date
CN102938843A (zh) 2013-02-20
JP6059359B2 (ja) 2017-01-11
JP2016503624A (ja) 2016-02-04
US9374567B2 (en) 2016-06-21
US20150256805A1 (en) 2015-09-10
CN102938843B (zh) 2014-12-03

Similar Documents

Publication Publication Date Title
WO2014079189A1 (zh) 图像处理方法、装置以及成像设备
US10070104B2 (en) Imaging systems with clear filter pixels
US8508631B2 (en) Pixel defect detection and correction device, imaging apparatus, pixel defect detection and correction method, and program
EP4161061A1 (en) Image acquisition method, camera assembly, and mobile terminal
KR101442242B1 (ko) 불량 화소 및 잡음 제거 방법
EP3120539A1 (en) Photographing apparatus, method of controlling the same, and computer-readable recording medium
US20230239589A1 (en) Solid state image sensor and electronic equipment
WO2016183859A1 (zh) 一种灰阶补偿方法
WO2016076497A1 (ko) 메타 데이터에 기초하여 영상을 디스플레이하는 방법 및 디바이스, 그에 따른 기록매체
US11470286B2 (en) Image sensors with color, panchromatic and infrared pixels
WO2012002742A2 (en) Camera module and method for driving the same
WO2021125645A1 (ko) 화이트 밸런스를 제공하는 방법 및 이를 지원하는 전자 장치
WO2011037391A2 (en) Video signal generation apparatus and method minimizing crosstalk between luminance signal and color difference signal
WO2019088407A1 (ko) 보색관계의 필터 어레이를 포함하는 카메라 모듈 및 그를 포함하는 전자 장치
WO2020111441A1 (ko) 프로세서 및 그 제어 방법
WO2022103121A1 (en) Electronic device for estimating camera illuminant and method of the same
WO2016041223A1 (zh) 图像数据处理方法及装置
US7843500B2 (en) Image capturing device and brightness correcting method thereof
WO2015115866A1 (ko) 이미지의 색상 신호를 보간하는 방법 및 장치
WO2024019331A1 (en) Apparatus and method for performing image authentication
WO2024049076A1 (en) Electronic device and method for processing image data
WO2021107264A1 (ko) 딥 러닝 기반 희소 컬러 센서 이미지 처리장치, 이미지 처리방법 및 컴퓨터-판독가능 매체
WO2020145740A1 (ko) 카메라 장치 및 이를 구비하는 전자 장치
WO2024085501A1 (ko) 이미지 센서의 이미지를 이용한 학습 기반 화질 개선 방법 및 이를 지원하는 전자 장치
TWI528817B (zh) 數位攝像裝置及其影像處理方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13856221

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2015543249

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13856221

Country of ref document: EP

Kind code of ref document: A1