Nothing Special   »   [go: up one dir, main page]

CN106920217B - Image correction method and device - Google Patents

Image correction method and device Download PDF

Info

Publication number
CN106920217B
CN106920217B CN201510996333.9A CN201510996333A CN106920217B CN 106920217 B CN106920217 B CN 106920217B CN 201510996333 A CN201510996333 A CN 201510996333A CN 106920217 B CN106920217 B CN 106920217B
Authority
CN
China
Prior art keywords
corrected
pixel value
pixel
phase point
correction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510996333.9A
Other languages
Chinese (zh)
Other versions
CN106920217A (en
Inventor
朱洪波
张玉光
彭晓峰
王浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Spreadtrum Communications Shanghai Co Ltd
Original Assignee
Spreadtrum Communications Shanghai Co Ltd
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 Spreadtrum Communications Shanghai Co Ltd filed Critical Spreadtrum Communications Shanghai Co Ltd
Priority to CN201510996333.9A priority Critical patent/CN106920217B/en
Publication of CN106920217A publication Critical patent/CN106920217A/en
Application granted granted Critical
Publication of CN106920217B publication Critical patent/CN106920217B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • 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/30Subject of image; Context of image processing
    • G06T2207/30168Image quality inspection

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Color Television Image Signal Generators (AREA)

Abstract

A method and apparatus for image rectification, the method comprising: acquiring a first pixel value of a current phase point to be corrected in an original image; determining a correction multiple corresponding to the current phase point to be corrected; and taking the product of the first pixel value and the correction multiple as a correction pixel value of the current phase point to be corrected. The scheme can improve the probability of obtaining correct output images.

Description

Image correction method and device
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a method and an apparatus for image rectification.
Background
With the continuous development of camera focusing technology, the focusing technology has been developed from manual focusing to automatic focusing. One type of focusing method in Auto-focusing is called Phase Detection Auto Focus (PDAF), in order to achieve Phase focusing, some image pixels are partially shielded from input light, and these pixels are called Phase pixels or Phase points (herein, Phase points), the left half of the shielded pixels are called left Phase points, and the right half of the shielded pixels are called right Phase points.
In the phase focusing mode, part of incident light of the phase point is shielded, which can generate an obvious image for the final image output, and the image is reflected that the phase point and the surrounding pixel points are dark or bright or appear pseudo-color. Therefore, the pixel values of the phase points need to be corrected to obtain a correct output image.
In the conventional method for correcting the pixel value of the phase point, the phase point is usually corrected as a dead pixel, so that the pixel value of the phase point is almost completely lost, the reference pixel value data used for calculation during imaging is less, the error probability is high, and in other words, the probability of obtaining a correct output image is lower.
Disclosure of Invention
The technical problem to be solved by the invention is to provide an image correction method and device to correct the pixel value of the phase point, thereby improving the probability of obtaining a correct output image.
To solve the above technical problem, an embodiment of the present invention provides an image rectification method, where the method includes:
acquiring a first pixel value of a current phase point to be corrected in an original image;
determining a correction multiple corresponding to the current phase point to be corrected;
and taking the product of the first pixel value and the correction multiple as a correction pixel value of the current phase point to be corrected.
Optionally, the correction factor is determined by:
enabling the camera module to image the appointed scene to obtain a calibration image;
and calculating the correction multiple according to the pixel value of the pixel point with the same color filter as the current phase point to be corrected in the calibration image and the first pixel value.
Optionally, the designated scene is a flat scene under uniform illumination.
Optionally, the calculating the correction multiple according to the pixel value of the pixel point having the same color filter as the current phase point to be corrected in the calibration image and the first pixel value includes:
acquiring a second pixel value of the current phase point to be corrected from the calibration image;
calculating the average value of pixel values of pixel points with the same color filter as the current phase point to be corrected in a first neighborhood of the current phase point to be corrected as a first average value;
and taking the quotient of the first average value and the second pixel value as the correction multiple.
Optionally, the image rectification method further comprises:
and when the color of the filter of the current phase point to be corrected is different from the color of the filter of the pixel point of the same color channel in the second neighborhood, updating and calculating the corrected pixel value by referring to the spectral correlation between the color of the channel of the pixel point of the same color channel in the second neighborhood and the color of the filter of the phase point to be corrected.
Optionally, the updating, with reference to the spectral correlation between the channel color of the pixel point of the same-color channel in the second neighborhood and the filter color of the phase point to be corrected, to calculate a corrected pixel value includes:
calculating the average value of pixel values of pixel points which are the same as the color channel of the current phase point to be corrected in a second neighborhood of the current phase point to be corrected to serve as a second average value;
calculating the average value of pixel values of pixel points which are the same as the color filter of the current phase point to be corrected in a second neighborhood of the current phase point to be corrected to serve as a third average value;
taking the difference between the third average value and the second average value as the spectral correlation;
and subtracting the spectral correlation from the corrected pixel value to update the corrected pixel value.
Optionally, the image rectification method further includes:
and performing Gaussian filtering on the correction pixel value of the phase point to be corrected and the pixel value of the pixel point with the same color channel in the second neighborhood, and updating the correction pixel value by using the result of the Gaussian filtering.
Optionally, the raw image is a bayer image.
The embodiment of the invention also provides an image correction device, which comprises:
the first pixel value acquisition unit is suitable for acquiring a first pixel value of a current phase point to be corrected in an original image;
the correction multiple determining unit is suitable for determining the correction multiple corresponding to the current phase point to be corrected;
and the correction pixel value calculation unit is suitable for taking the product of the first pixel value and the correction multiple as the correction pixel value of the current phase point to be corrected.
Optionally, the correction factor determining unit includes:
the calibration image acquisition subunit is suitable for acquiring a calibration image obtained after the camera module images the appointed scene;
and the correction multiple calculating subunit is suitable for calculating the correction multiple according to the pixel value of the pixel point with the same color filter as the current phase point to be corrected in the calibration image and the first pixel value.
Optionally, the designated scene is a flat scene under uniform illumination.
Optionally, the correction factor calculating subunit includes:
the second pixel value acquisition module is suitable for acquiring a second pixel value of the current phase point to be corrected from the calibration image;
the first average value calculation submodule is suitable for calculating the average value of pixel values of pixel points with the same color filter as the current phase point to be corrected in a first neighborhood of the current phase point to be corrected to serve as a first average value;
and the correction multiple calculation submodule is suitable for taking the quotient of the first average value and the second pixel value as the correction multiple.
Optionally, the image rectification apparatus further includes:
and the correction pixel value correction unit is suitable for updating and calculating the correction pixel value by referring to the spectral correlation between the channel color of the pixel point of the same-color channel in the second neighborhood and the filter color of the phase point to be corrected when the filter color of the current phase point to be corrected is different from the filter color of the pixel point of the same-color channel in the second neighborhood.
Optionally, the correction pixel value modification unit includes:
the second average value calculating subunit is adapted to calculate, in a second neighborhood of the current phase point to be corrected, an average value of pixel values of pixel points that are the same as the color channel of the current phase point to be corrected, as a second average value;
a third average value calculating subunit, adapted to calculate, in a second neighborhood of the current phase point to be corrected, an average value of pixel values of pixel points that are the same as the color filter of the current phase point to be corrected, as a third average value;
a spectral correlation calculation subunit adapted to take a difference between the third average value and the second average value as the spectral correlation;
and the correction pixel value correction subunit is suitable for subtracting the spectral correlation from the correction pixel value so as to update the correction pixel value.
Optionally, the image rectification apparatus further includes:
and the filtering unit is suitable for performing Gaussian filtering on the corrected pixel value of the phase to be corrected and the pixel value of the pixel point of the same color channel in the second field, and updating the corrected pixel value by using the result of the Gaussian filtering.
Optionally, the raw image is a bayer image.
Compared with the prior art, the technical scheme of the embodiment of the invention has the following beneficial effects:
according to the technical scheme of the embodiment of the invention, the correction multiple corresponding to the current to-be-corrected phase point is determined by acquiring the first pixel value of the current to-be-corrected phase point in the original image, and the product of the first pixel value and the correction multiple is used as the correction pixel value of the current to-be-corrected phase point, so that the corrected phase point pixel value can be used for calculation in the subsequent processing process of the image, the problem of error of the output image caused by the correction method that the phase point pixel value is almost lost in the prior art is further avoided, and the probability of obtaining the correct output image is improved.
Further, according to the technical scheme of the embodiment of the invention, when the color of the filter of the current phase point to be corrected is different from the color of the filter of the pixel point of the same-color channel in the second neighborhood, the corrected pixel value is updated and calculated by referring to the spectral correlation between the color of the channel of the pixel point of the same-color channel in the second neighborhood and the color of the filter of the phase point to be corrected, so that the calculation result of the corrected pixel value is more accurate.
Further, according to the technical scheme of the embodiment of the present invention, the correction pixel value of the phase point to be corrected and the pixel value of the pixel point having the same color channel in the second neighborhood are gaussian-filtered to update the correction pixel value, so that the pixel value of the corrected phase point is more accurate, and the probability of obtaining a correct output image is improved.
Drawings
FIG. 1 is a flow chart of a method of image rectification in an embodiment of the present invention;
FIG. 2 is a flow chart of another method of image rectification in an embodiment of the present invention;
fig. 3A and 3B are bayer images of a current phase point to be corrected and its neighborhood 5 × 7 window in the embodiment of the present invention;
FIG. 4 is a schematic diagram of an apparatus for image rectification according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a correction factor determining unit in fig. 4;
fig. 6 is a schematic structural diagram of another image rectification device in the embodiment of the invention.
Detailed Description
As described in the background art, in the conventional method for correcting the pixel value of the phase point, the phase point is usually corrected as a dead pixel, so that the pixel value of the phase point is almost completely discarded, the reference pixel value data used for calculation during imaging is less, the error probability is high, and in other words, the probability of obtaining a correct output image is low.
The inventor of the present application has found through research that, when a phase point has a fixed shielding object and a constant ratio of incident light blocked, it is presumed that the phase point is multiplied by a certain fixed magnification to obtain a pixel value of an output when the phase point is imaged. Therefore, in the technical scheme of the embodiment of the invention, the first pixel value of the current phase point to be corrected in the original image is obtained, the correction multiple corresponding to the current phase point to be corrected is determined, and the product of the first pixel value and the correction multiple is used as the correction pixel value of the current phase point to be corrected, so that the corrected phase point pixel value can be used for calculation in the subsequent processing process of the image, the problem of error of the output image caused by the correction method that the phase point pixel value is almost lost in the prior art is further avoided, and the probability of obtaining the correct output image is improved.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
Fig. 1 is a flowchart of a method for image rectification according to an embodiment of the present invention. The method of image rectification will be described in detail with reference to fig. 1.
Step S101: and acquiring a first pixel value of the current phase point to be corrected in the original image.
In a specific implementation, the raw image is an image obtained by converting a light source signal captured by an image sensor into a digital signal, the raw image records raw information of the image sensor, and usually the raw image inside the camera is a bayer (bayer) image, generally referred to by the suffix of. Of course, the original image may also be in other suitable formats, as long as the information of the phase points still remains therein.
Step S102: and determining the correction multiple corresponding to the current phase point to be corrected.
In specific implementation, the correction multiple is calculated and stored in advance, each phase point to be corrected has a corresponding correction multiple, and the correction multiple stored in advance can be found through the corresponding relationship. The correction factor may be calculated by various methods.
Step S103: and taking the product of the first pixel value and the correction multiple as a correction pixel value of the current phase point to be corrected.
And the corrected pixel value is the pixel value of the phase point to be corrected after being corrected.
In an embodiment of the present invention, the correction factor in step S102 may be determined by:
enabling the camera module to image the appointed scene to obtain a calibration image;
and calculating the correction multiple according to the pixel value of the pixel point with the same color filter as the current phase point to be corrected in the calibration image and the first pixel value.
In an example of the above method, the specified scene may be a flat scene under uniform illumination.
In an example of the foregoing method, after obtaining the calibration image in the flat scene, the calculating the correction multiple according to the pixel value of the pixel point having the same color filter as the current phase point to be corrected in the calibration image and the first pixel value may include:
acquiring a second pixel value of the current phase point to be corrected from the calibration image;
calculating the average value of pixel values of pixel points with the same color filter as the current phase point to be corrected in a first neighborhood of the current phase point to be corrected as a first average value;
and taking the quotient of the first average value and the second pixel value as the correction multiple.
In a specific implementation, the size of the first neighborhood region may be set according to needs, and is not limited herein.
In this embodiment, a first pixel value of a current phase point to be corrected in an original image is obtained, a correction multiple corresponding to the current phase point to be corrected is determined, and a product of the first pixel value and the correction multiple is used as a correction pixel value of the current phase point to be corrected, so that the corrected phase point pixel value can be used for calculation in a subsequent processing process of the image, and further, the problem of error of an output image caused by a correction method in which the phase point pixel value is almost lost in the prior art is avoided, thereby improving the probability of obtaining a correct output image.
Another embodiment of the present invention will be described with reference to fig. 2.
Fig. 2 is a flow chart of another method of image rectification in an embodiment of the present invention. The method of image rectification will be described in detail with reference to fig. 2.
Step S201: acquiring a first pixel value of a current phase point to be corrected in an original image;
step S202: determining a correction multiple corresponding to the current phase point to be corrected;
step S203: taking the product of the first pixel value and the correction multiple as a correction pixel value of the current phase point to be corrected;
step S204: when the color of the filter of the current phase point to be corrected is different from the color of the filter of the pixel point of the same color channel in a second neighborhood, updating and calculating a corrected pixel value by referring to the spectral correlation between the color of the channel of the pixel point of the same color channel in the second neighborhood and the color of the filter of the phase point to be corrected;
step S205: and performing Gaussian filtering on the correction pixel value of the phase point to be corrected and the pixel value of the pixel point with the same color channel in the second neighborhood, and updating the correction pixel value by using the result of the Gaussian filtering.
In this embodiment, the descriptions of step S201 to step S203 correspond to the descriptions of step S101 to step S103 in fig. 1, and are not repeated herein.
In a specific implementation of step S204, the corrected pixel value may be updated and calculated by:
calculating the average value of pixel values of pixel points which are the same as the color channel of the current phase point to be corrected in a second neighborhood of the current phase point to be corrected to serve as a second average value;
calculating the average value of pixel values of pixel points which are the same as the color filter of the current phase point to be corrected in a second neighborhood of the current phase point to be corrected to serve as a third average value;
taking the difference between the third average value and the second average value as the spectral correlation;
and subtracting the spectral correlation from the corrected pixel value to update the corrected pixel value.
An embodiment of the step S204 is illustrated below with reference to fig. 3A and 3B:
fig. 3A and 3B show a bayer image of a phase point and its neighborhood 5 x 7 window. Fig. 3A specifically shows color channels of each pixel point in the bayer image, where R denotes a red channel (R channel), G denotes a green channel (G channel), B denotes a blue channel (B channel), the current phase point o to be corrected is shown in a shaded portion in fig. 3A, and fig. 3B specifically identifies the current phase point o to be corrected and points a, B, c, d, e, f, G, and h in a 3 × 3 neighborhood thereof.
Referring to fig. 3A and 3B, the current phase point o to be corrected is located in the G channel, and points a, B, c and d are also located in the 3 × 3 neighborhood of the current phase point o, where points e and f are located in the R channel, and points G and h are located in the B channel.
The second neighborhood of this embodiment is a 3 × 3 neighborhood of the current phase point o to be corrected, and in general, the color of the filter covered on the pixel point is the same as the color of the channel of the pixel point, but the color of the filter covered on the phase point may be different from the color of the channel of the phase point. Referring to fig. 3A and 3B, the filter colors at points a, B, c and d are the same as the channel color, and are all red, while the filter color at the phase point may be other colors, in this case, assumed to be blue. At this time, the corrected pixel value may be updated and calculated with reference to the spectral correlation between the channel color of the pixel point of the same color channel in the second neighborhood and the filter color of the phase point to be corrected.
Specifically, in a 3 × 3 neighborhood of the current phase point o to be corrected, an average value of pixel values of pixel points (a, b, c, and d points) that are the same as the color channel of the current phase point o to be corrected is calculated as a second average value m;
calculating the average value of pixel values of pixel points (e and f points) with the same color blue as the filter of the current phase point o to be corrected in a 3 x 3 neighborhood of the current phase point o to be corrected to serve as a third average value n;
taking the difference n-m between the third average value and the second average value as the spectral correlation r;
assuming that the corrected pixel value calculated in step S203 is T, the corrected pixel value T is subtracted from the spectral correlation r, and the corrected pixel value T is updated using T-r.
With reference to fig. 3B, in step S205, a gaussian filtering is performed on the corrected pixel value of the phase point o to be corrected and the pixel values of the pixel points (a, B, c, and d points) having the same color channel in the second neighborhood, and the corrected pixel value is updated by using the result of the gaussian filtering.
It should be noted that, referring to fig. 1, after the corrected pixel value is obtained in step S103, the method described in step S204 in this embodiment may also be used to perform filtering so as to update the corrected pixel value obtained in step S103.
In this embodiment, a first pixel value of a current phase point to be corrected in an original image is obtained, a correction multiple corresponding to the current phase point to be corrected is determined, and a product of the first pixel value and the correction multiple is used as a correction pixel value of the current phase point to be corrected, so that the corrected phase point pixel value can be used for calculation in a subsequent processing process of the image, and further, the problem of error of an output image caused by a correction method in which the phase point pixel value is almost lost in the prior art is avoided, thereby improving the probability of obtaining a correct output image.
Further, in this embodiment, when the color of the filter of the current phase point to be corrected is different from the color of the filter of the pixel point of the same color channel in the second neighborhood, the corrected pixel value is updated and calculated with reference to the spectral correlation between the color of the channel of the pixel point of the same color channel in the second neighborhood and the color of the filter of the phase point to be corrected, so that the calculation result of the corrected pixel value is more accurate.
Further, in this embodiment, the correction pixel value of the phase point to be corrected and the pixel value of the pixel point having the same color channel in the second neighborhood are gaussian-filtered to update the correction pixel value, so that the pixel value of the corrected phase point is more accurate, and the probability of obtaining a correct output image is improved.
The following describes a device corresponding to the image rectification method in the embodiment of the present invention in further detail with reference to fig. 4 and 5.
Fig. 4 is a schematic structural diagram of an image correction apparatus according to an embodiment of the present invention, referring to fig. 4, the image correction apparatus 40 may include:
a first pixel value obtaining unit 401, adapted to obtain a first pixel value of a current phase point to be corrected in an original image;
a correction multiple determining unit 402, adapted to determine a correction multiple corresponding to the current phase point to be corrected;
a corrected pixel value calculating unit 403, adapted to take a product of the first pixel value and the correction multiple as a corrected pixel value of the current phase point to be corrected.
In a specific implementation, the correction multiple determining unit 402 may include a calibration image imaging subunit 4021 and a correction multiple calculating subunit 4022, please refer to fig. 5, fig. 5 shows a schematic structural diagram of the correction multiple determining unit shown in fig. 4, and the correction multiple determining unit 402 having the structure shown in fig. 5 may calculate the correction multiple in advance. Alternatively, in another specific implementation, the correction factor determining unit 402 may only have a lookup function, and obtain the previously determined correction factor from an external or internal database, a memory, or the like.
The calibration image obtaining subunit 4021 is adapted to obtain a calibration image obtained by imaging the specified scene with the camera module;
the correction multiple calculating subunit 4022 is adapted to calculate the correction multiple according to the pixel value of the pixel point having the same color filter as the current phase point to be corrected in the calibration image and the first pixel value.
In a specific implementation, the designated scene may be a flat scene under uniform illumination.
In a specific implementation, the correction multiple calculating subunit 4022 may include:
the second pixel value acquisition module is suitable for acquiring a second pixel value of the current phase point to be corrected from the calibration image;
the first average value calculation submodule is suitable for calculating the average value of pixel values of pixel points with the same color filter as the current phase point to be corrected in a first neighborhood of the current phase point to be corrected to serve as a first average value;
and the correction multiple calculation submodule is suitable for taking the quotient of the first average value and the second pixel value as the correction multiple.
In this embodiment, a first pixel value of a current phase point to be corrected in an original image is obtained, a correction multiple corresponding to the current phase point to be corrected is determined, and a product of the first pixel value and the correction multiple is used as a correction pixel value of the current phase point to be corrected, so that the corrected phase point pixel value can be used for calculation in a subsequent processing process of the image, and further, the problem of error of an output image caused by a correction method in which the phase point pixel value is almost lost in the prior art is avoided, thereby improving the probability of obtaining a correct output image.
Fig. 6 is a schematic structural diagram of an image correction apparatus according to an embodiment of the present invention, referring to fig. 6, the image correction apparatus 60 may include: a first pixel value acquisition unit 601, a correction factor determination unit 602, and a corrected pixel value calculation unit 603.
The descriptions of the first pixel value obtaining unit 601, the correction multiple determining unit 602, and the correction pixel value calculating unit 603 correspond to the descriptions of the first pixel value obtaining unit 401, the correction multiple determining unit 402, and the correction pixel value calculating unit 403 in fig. 4, which are not repeated herein.
The image rectification apparatus 60 of the present embodiment may further include: a correction pixel value correction unit 604 and a filtering unit 605. Wherein:
the correction pixel value correction unit 604 is adapted to update and calculate a correction pixel value with reference to spectral correlation between the channel color of the pixel point of the same-color channel in the second neighborhood and the filter color of the phase point to be corrected, when the filter color of the current phase point to be corrected is different from the filter color of the pixel point of the same-color channel in the second neighborhood in the original image.
The filtering unit 605 is adapted to perform gaussian filtering on the corrected pixel value of the phase to be corrected and the pixel values of the pixels in the same color channel in the second field, and update the corrected pixel value using the result of the gaussian filtering.
In a specific implementation, the corrected pixel value modification unit 604 may include:
the second average value calculating subunit 6041 is adapted to calculate, in a second neighborhood of the current phase point to be corrected, an average value of pixel values of pixel points that are the same as the color channel of the current phase point to be corrected, as a second average value;
a third average value calculating subunit 6042, configured to calculate, in a second neighborhood of the current phase point to be corrected, an average value of pixel values of pixel points that are the same as the color filter of the current phase point to be corrected, as a third average value;
a spectral correlation calculation subunit 6043 adapted to take a difference between the third average value and the second average value as the spectral correlation;
a corrected pixel value modification subunit 6044 adapted to subtract the corrected pixel value from the spectral correlation to update the corrected pixel value.
In this embodiment, a first pixel value of a current phase point to be corrected in an original image is obtained, a correction multiple corresponding to the current phase point to be corrected is determined, and a product of the first pixel value and the correction multiple is used as a correction pixel value of the current phase point to be corrected, so that the corrected phase point pixel value can be used for calculation in a subsequent processing process of the image, and further, the problem of error of an output image caused by a correction method in which the phase point pixel value is almost lost in the prior art is avoided, thereby improving the probability of obtaining a correct output image.
Further, in this embodiment, when the color of the filter of the current phase point to be corrected is different from the color of the filter of the pixel point of the same color channel in the second neighborhood, the corrected pixel value is updated and calculated with reference to the spectral correlation between the color of the channel of the pixel point of the same color channel in the second neighborhood and the color of the filter of the phase point to be corrected, so that the calculation result of the corrected pixel value is more accurate.
Further, in this embodiment, the correction pixel value of the phase point to be corrected and the pixel value of the pixel point having the same color channel in the second neighborhood are gaussian-filtered to update the correction pixel value, so that the pixel value of the corrected phase point is more accurate, and the probability of obtaining a correct output image is improved.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by instructions associated with hardware via a program, which may be stored in a computer-readable storage medium, and the storage medium may include: ROM, RAM, magnetic or optical disks, and the like.
The method and system of the embodiments of the present invention have been described in detail, but the present invention is not limited thereto. Various changes and modifications may be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (14)

1. A method of image rectification, comprising:
acquiring a first pixel value of a current phase point to be corrected in an original image;
determining a correction multiple corresponding to the current phase point to be corrected;
taking the product of the first pixel value and the correction multiple as a correction pixel value of the current phase point to be corrected;
further comprising: and when the color of the filter of the current phase point to be corrected is different from the color of the filter of the pixel point of the same color channel in the second neighborhood, updating and calculating the corrected pixel value by referring to the spectral correlation between the color of the channel of the pixel point of the same color channel in the second neighborhood and the color of the filter of the phase point to be corrected.
2. The method for image rectification according to claim 1, wherein the rectification multiple is determined by:
enabling the camera module to image the appointed scene to obtain a calibration image;
and calculating the correction multiple according to the pixel value of the pixel point with the same color filter as the current phase point to be corrected in the calibration image and the first pixel value.
3. The method of image rectification according to claim 2, wherein the designated scene is a flat scene under uniform illumination.
4. The method for image correction according to claim 3, wherein the calculating the correction multiple according to the pixel values of the pixel points in the calibration image having the same color filters as the current phase point to be corrected and the first pixel value comprises:
acquiring a second pixel value of the current phase point to be corrected from the calibration image;
calculating the average value of pixel values of pixel points with the same color filter as the current phase point to be corrected in a first neighborhood of the current phase point to be corrected as a first average value;
and taking the quotient of the first average value and the second pixel value as the correction multiple.
5. The method for image rectification according to claim 1, wherein the updating of the computed corrected pixel value with reference to the spectral correlation between the channel color of the pixel points of the same color channel in the second neighborhood and the filter color of the phase point to be corrected comprises:
calculating the average value of pixel values of pixel points which are the same as the color channel of the current phase point to be corrected in a second neighborhood of the current phase point to be corrected to serve as a second average value;
calculating the average value of pixel values of pixel points which are the same as the color filter of the current phase point to be corrected in a second neighborhood of the current phase point to be corrected to serve as a third average value;
taking the difference between the third average value and the second average value as the spectral correlation;
and subtracting the spectral correlation from the corrected pixel value to update the corrected pixel value.
6. The method of image rectification according to claim 1 or 5, further comprising:
and performing Gaussian filtering on the correction pixel value of the phase point to be corrected and the pixel value of the pixel point with the same color channel in the second neighborhood, and updating the correction pixel value by using the result of the Gaussian filtering.
7. The method of image rectification according to any one of claims 1-5, wherein the raw image is a Bayer image.
8. An apparatus for image rectification, comprising:
the first pixel value acquisition unit is suitable for acquiring a first pixel value of a current phase point to be corrected in an original image;
the correction multiple determining unit is suitable for determining the correction multiple corresponding to the current phase point to be corrected;
a correction pixel value calculating unit adapted to take a product of the first pixel value and the correction multiple as a correction pixel value of the current phase point to be corrected, further comprising:
and the correction pixel value correction unit is suitable for updating and calculating the correction pixel value by referring to the spectral correlation between the channel color of the pixel point of the same-color channel in the second neighborhood and the filter color of the phase point to be corrected when the filter color of the current phase point to be corrected is different from the filter color of the pixel point of the same-color channel in the second neighborhood.
9. The apparatus for image rectification according to claim 8, wherein the rectification factor determining unit includes:
the calibration image acquisition subunit is suitable for acquiring a calibration image obtained after the camera module images the appointed scene;
and the correction multiple calculating subunit is suitable for calculating the correction multiple according to the pixel value of the pixel point with the same color filter as the current phase point to be corrected in the calibration image and the first pixel value.
10. The apparatus according to claim 9, wherein the designated scene is a flat scene under uniform illumination.
11. The apparatus for image rectification according to claim 10, wherein the rectification multiple calculation subunit includes:
the second pixel value acquisition module is suitable for acquiring a second pixel value of the current phase point to be corrected from the calibration image;
the first average value calculation submodule is suitable for calculating the average value of pixel values of pixel points with the same color filter as the current phase point to be corrected in a first neighborhood of the current phase point to be corrected to serve as a first average value;
and the correction multiple calculation submodule is suitable for taking the quotient of the first average value and the second pixel value as the correction multiple.
12. The apparatus for image correction according to claim 8, wherein the correction pixel value correction unit includes:
the second average value calculating subunit is adapted to calculate, in a second neighborhood of the current phase point to be corrected, an average value of pixel values of pixel points that are the same as the color channel of the current phase point to be corrected, as a second average value;
a third average value calculating subunit, adapted to calculate, in a second neighborhood of the current phase point to be corrected, an average value of pixel values of pixel points that are the same as the color filter of the current phase point to be corrected, as a third average value;
a spectral correlation calculation subunit adapted to take a difference between the third average value and the second average value as the spectral correlation;
and the correction pixel value correction subunit is suitable for subtracting the spectral correlation from the correction pixel value so as to update the correction pixel value.
13. The image rectification apparatus according to claim 8 or 12, further comprising:
and the filtering unit is suitable for performing Gaussian filtering on the corrected pixel value of the phase to be corrected and the pixel value of the pixel point of the same color channel in the second neighborhood, and updating the corrected pixel value by using the result of the Gaussian filtering.
14. The apparatus according to any one of claims 8 to 12, wherein the raw image is a bayer image.
CN201510996333.9A 2015-12-25 2015-12-25 Image correction method and device Active CN106920217B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510996333.9A CN106920217B (en) 2015-12-25 2015-12-25 Image correction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510996333.9A CN106920217B (en) 2015-12-25 2015-12-25 Image correction method and device

Publications (2)

Publication Number Publication Date
CN106920217A CN106920217A (en) 2017-07-04
CN106920217B true CN106920217B (en) 2020-06-02

Family

ID=59456405

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510996333.9A Active CN106920217B (en) 2015-12-25 2015-12-25 Image correction method and device

Country Status (1)

Country Link
CN (1) CN106920217B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111340721B (en) * 2020-02-18 2021-02-12 国网电子商务有限公司 Pixel correction method, device, equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1646007A2 (en) * 2004-10-08 2006-04-12 Samsung Electronics Co., Ltd. Apparatus and method of compressing dynamic range of image
JP2008113236A (en) * 2006-10-30 2008-05-15 Kyocera Corp Shading correction method and device in imaging apparatus
CN101291437A (en) * 2007-01-26 2008-10-22 株式会社东芝 Solid-state image pickup device
CN102630021A (en) * 2011-02-07 2012-08-08 索尼公司 Signal processing device, signal processing method, imaging apparatus, and imaging processing method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9943289B2 (en) * 2013-05-29 2018-04-17 B-K Medical Aps Color flow ultrasound imaging

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1646007A2 (en) * 2004-10-08 2006-04-12 Samsung Electronics Co., Ltd. Apparatus and method of compressing dynamic range of image
JP2008113236A (en) * 2006-10-30 2008-05-15 Kyocera Corp Shading correction method and device in imaging apparatus
CN101291437A (en) * 2007-01-26 2008-10-22 株式会社东芝 Solid-state image pickup device
CN102630021A (en) * 2011-02-07 2012-08-08 索尼公司 Signal processing device, signal processing method, imaging apparatus, and imaging processing method

Also Published As

Publication number Publication date
CN106920217A (en) 2017-07-04

Similar Documents

Publication Publication Date Title
CN108600725B (en) White balance correction device and method based on RGB-IR image data
JP6928388B2 (en) Color matching across multiple sensors in optical system
US8436910B2 (en) Image processing apparatus and image processing method
CN107071234B (en) Lens shadow correction method and device
US9247153B2 (en) Image processing apparatus, method and imaging apparatus
US20170132820A1 (en) Method and system for mitigating color mutation in image fusion
US8154629B2 (en) Noise canceling circuit, noise canceling method, and solid-state imaging device
CN109068025B (en) Lens shadow correction method and system and electronic equipment
US8610801B2 (en) Image processing apparatus including chromatic aberration correcting circuit and image processing method
US9558395B2 (en) Image correction device, image correction method, and imaging device
CN107395991B (en) Image synthesis method, image synthesis device, computer-readable storage medium and computer equipment
JP2012191607A (en) Image processing system, image processing method and program
JP2013198041A (en) Image processing device
JP2013026755A (en) Image processing apparatus, imaging device, image processing method, and image processing program
US8818089B2 (en) Device and method of removing chromatic aberration in image
US20200195857A1 (en) Image capturing device and control method thereof and medium
JP2009302722A (en) Defective pixel processing device and defective pixel processing method
JP5899894B2 (en) Imaging apparatus, image processing apparatus, image processing program, and image processing method
CN106920217B (en) Image correction method and device
US11563898B2 (en) Apparatus and methods for generating high dynamic range media, based on multi-stage compensation of motion
JP5631769B2 (en) Image processing device
CN105704406B (en) A kind of method of bad point removal in image procossing
EP3605450B1 (en) Image processing apparatus, image pickup apparatus, control method of image processing apparatus, and computer-program
JP2013070241A (en) Image processing apparatus, image processing method, and image processing program
KR101428534B1 (en) Apparatus and method for correcting lens distortion

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant