This application claims the priority benefit of Taiwan application serial no. 101106068, filed on Feb. 23, 2012. The entirety of the above-mentioned patent application is hereby incorporated by reference herein and made a part of this specification.
1. Field of the Invention
The invention generally relates to an electronic apparatus, and more particularly, to a method and an apparatus for eliminating image chromatic aberration.
2. Description of Related Art
The development of science and technology makes the volumes of the optical components of image-capturing devices increasingly smaller. The image chromatic aberration of an image-capturing device is a chromatic aberration phenomenon produced by light via different image height positions of optical lens. In the prior art, in order to eliminate the chromatic aberration phenomenon, a combination of multiple lenses is used; however, such a conventional scheme requires to revise the optical design of the set of lenses and hence increases the cost of the set of lenses.
Accordingly, a method and an apparatus are disclosed for eliminating chromatic aberration able to effectively eliminate/reduce the image chromatic aberration.
In an aspect, a method for eliminating chromatic aberration is provided, which includes calculating a position weight of a pixel according to the position of the pixel in an image, and correcting the original chrominance of the pixel by using the position weight.
In another aspect, a method for eliminating chromatic aberration is provided, comprising calculating a position weight of a pixel according to relative distance between the pixel and center coordinates of an image, calculating an edge response of the pixel according to a luminance of the image, converting the edge response into a hue range, and converting the chrominance of the pixel into a hue, and correcting original chrominance of the pixel by using the edge response, the hue, the hue range and position weight.
In further another aspect, an apparatus for eliminating chromatic aberration is provided, which includes a position weight calculation unit and a chrominance correction unit. The position weight calculation unit receives the data of the pixel and calculates a position weight of the pixel according to the position of the pixel in an image. The chrominance correction unit is coupled to the position weight calculation unit, in which the chrominance correction unit corrects the original chrominance of the pixel by using the position weight.
Based on the description above, the position weight calculation unit in the embodiment of the invention calculates the position weight of the pixel according to the position of the pixel in the image and the chrominance correction unit uses the position weight to correct the original chrominance of the pixel. In this way, the embodiment of the invention can effectively eliminate/reduce the image chromatic aberration without revising the optical design of the set of lenses.
Other objectives, features and advantages of the present invention will be further understood from the further technological features disclosed by the embodiments of the present invention wherein there are shown and described preferred embodiments of this invention, simply by way of illustration of modes best suited to carry out the invention.
In following embodiments, three characteristics causing the optical chromatic aberration are considered for performing the optical correction. The first characteristic is that the extent of chromatic aberration is roughly positively proportional to the deviated distance of a pixel position from the optical center in the image. The second characteristic is that the chromatic aberration mostly occurs at places where the contrasts of adjacent pixels are dramatically changed, for example, at image detail edges. The third characteristic is that the chromatic aberrations at a positive edge and a negative edge of an image detail edge have different chromatic performances. The following embodiments are related to the eliminating chromatic aberration respectively according to one or more of the three characteristics and moreover make accurate estimation to ensure the image quality not degraded. For example, in an embodiment, only the first characteristic is considered for performing optical correction, while in other embodiments, the first to third characteristics are all considered for performing optical correction. It should be noted that in different embodiments, to eliminate the chromatic aberration, several different combinations of the first to third characteristics can be considered, and the invention is not limited to the following embodiments.
The apparatus for eliminating chromatic aberration 100 can be applied in any image shooting/capturing/processing system. For example, the apparatus for eliminating chromatic aberration 100 can be used in a digital camera or a video camera. The data of an image can be obtained by sampling the image through a set of lenses and an image sensor. The data of the image is provided to the apparatus for eliminating or reducing chromatic aberration 100 through an image processing circuit and/or a transmission circuit. In the embodiment, the data of the image received by the apparatus for eliminating or reducing chromatic aberration 100 includes, but not limited to, a luminance Y, a chroma component Cb and a chroma component Cr. For example, in another embodiment, the data of the image can contain a red data R, a green data G and a blue data B. In further other embodiments, the data of the image can contain saturation data and hue data.
W
R=[(Xi−X0)2+(Yi−Y0)2]/[Xmax−X0)2+(Ymax−Y0)2] Formula 1
It can be seen from Formula 1 that the position weight WR is just the ratio of the distance between the position Xi and Yi of the pixel and the image center (X0, Y0) over the distance between the image height (Xmax, Ymax) and the image center (X0, Y0). In step S210, the position weight calculation unit 110 can use formula 1 to calculates out the position weight WR and then transmit the position weight WR to the chrominance correction unit 150.
The chromatic aberration phenomenon is mainly caused by a set of lenses in an image-capturing device and usually occurs at the surrounding range with higher image heights but farther distances from the lens center (X0, Y0), for example, at places nearby the edge of the circle 300 shown by
The chrominance correction unit 150 can correct the original chrominance of the pixel (i.e., chroma component Cb and chroma component Cr) according to the position weight WR. For example, regardless of what value the position weight WR is, in step S220, Formulas 2 and 3 are used to calculate new chroma component Cb′ and new chroma component Cr′:
Cb′=Cb×W
R
×W
NORMAL Formula 2
Cr′=Cr×W
R
×W
NORMAL Formula 3
WNORMAL herein is a normalized parameter, which can be any real number. In implementations of the embodiment, the value of the normalized parameter WNORMAL can be decided according to real design requirements of products. In another embodiment, for example, regardless of what value the position weight WR is, in step S220, Formulas 4 and 5 are used to calculate new chroma component Cb′ and new chroma component Cr′:
Cb′=Cb×W
NORMAL
÷W
R Formula 4
Cr′=Cr×W
NORMAL
÷W
R Formula 5
The implementation of the embodiment can be others and not limited to the description above. At the time, for example, the chrominance correction unit 150 can first check up the distance between the position (Xi, Yi) of the pixel and the image center (X0, Y0). If the distance between the position (Xi, Yi) of the pixel and the image center (X0, Y0) is greater than a predetermined distance, then, the chrominance correction unit 150 calculates the new chroma component Cb′ and the new chroma component Cr′ by using Formulas 2 and 3 (or Formulas 4 and 5). If the distance between the position (Xi, Yi) of the pixel and the image center (X0, Y0) is less than a predetermined distance, then, the chrominance correction unit 150 does not correct the original chrominance of the pixel, i.e., Cb′=Cb and Cr′=Cr.
In the embodiment, step S220 in
Since the position weight calculation unit 110 in the embodiment calculates out the position weight WR of the pixel according to the position of the pixel in the image and the chrominance correction unit 150 can correct the original chrominance of the pixel (Cb and Cr) by using the position weight WR, so that the embodiment has no need to revise the optical design of the set of lenses to effectively eliminate/reduce the image chromatic aberration.
The edge response unit 120, coupled to the chrominance correction unit 150, can receive the data of the pixel and calculate the edge response of the pixel according to the luminance Y of the image. In the embodiment, the edge response may be a positive detail intensity response IP or a negative detail intensity response IN. The edge response unit 120 can adopt a filter, and preferably for example, a second-order differential filter or a Laplacian filter, to perform a detail intensity calculation on the luminance Y of the image so as to further obtain the positive detail intensity response IP or the negative detail intensity response IN. After that, the positive detail intensity response IP or the negative detail intensity response IN is output to the chrominance correction unit 150, in which the chrominance correction unit 150 further uses the edge response (IP or IN) or the position weight WR to correct the original chrominance of the pixel.
The chrominance correction unit 150 further uses the edge response (IP or IN) and the position weight WR to correct the original chrominance of the pixel. In the embodiment, the chrominance correction unit 150 has defined a position weight threshold WRT, a positive detail intensity response threshold IPT and a negative detail intensity response threshold INT therein. After finishing step S610, the chrominance correction unit 150 conducts sub-step S221 to compare the position weight WR with the position weight threshold WRT. If the position weight WR is less than the position weight threshold WRT, the chrominance correction unit 150 does not correct the original chrominance of the pixel (sub-step S222), i.e., Cb′=Cb and Cr′=Cr. If the position weight WR is greater than the position weight threshold WRT according to the judgement of the chrominance correction unit 150, the chrominance correction unit 150 conducts sub-step S620.
In sub-step S620, the chrominance correction unit 150 compares the positive detail intensity response IP with the positive detail intensity response threshold IPT or compares the absolute value of the negative detail intensity response IN with the negative detail intensity response threshold INT and then decides whether to correct the original chrominance of the pixel according to the comparison result. Preferably, if the edge response of the pixel is the positive detail intensity response IP, the chrominance correction unit 150 compares the positive detail intensity response Ip with the positive detail intensity response threshold IPT; if the edge response of the pixel is the negative detail intensity response IN, the chrominance correction unit 150 compares the absolute value of the negative detail intensity response IN with the negative detail intensity response threshold INT. If the positive detail intensity response IP is less than the positive detail intensity response threshold IPT (or the absolute value of the negative detail intensity response IN is less than the negative detail intensity response threshold INT), the chrominance correction unit 150 does not correct the original chrominance of the pixel (sub-step S222). If the positive detail intensity response IP is greater than the positive detail intensity response threshold IPT (or the absolute value of the negative detail intensity response IN is greater than the negative detail intensity response threshold INT) according to the judgement of the chrominance correction unit 150, the chrominance correction unit 150 conducts sub-step S630.
In sub-step S630, the chrominance correction unit 150 converts the edge response of the pixel into an edge response weight. If the edge response of the pixel is a positive detail intensity response IP, the chrominance correction unit 150 converts the positive detail intensity response IP into a positive detail intensity response weight WIP. If the edge response of the pixel is a negative detail intensity response IN, the chrominance correction unit 150 converts the negative detail intensity response IN into a negative detail intensity response weight WIN. The conversion between the edge response and the edge response weight depends on the real product design. The chrominance correction unit 150 can use the formulas, the conversion curves, the LUT (lookup table) or other ways to convert the edge response of the pixel into the edge response weight.
For example, the conversion can use
Continuing to
If the edge response of the pixel is the positive detail intensity response IP, in sub-step S640, the chrominance correction unit 150 can use Formulas 6 and 7 to calculate the new chroma component Cb′ and the new chroma component Cr′:
Cb′=Cb×(WR+WIP)×WNORMAL Formula 6
Cr′=Cr×(WR+WIP)×WNORMAL Formula 7
WNORMAL herein is a normalized parameter, which can be any real number. All users of the embodiment can decide the value of the normalized parameter WNORMAL according to the real product design. If the edge response of the pixel is the negative detail intensity response IN, in sub-step S640, the chrominance correction unit 150 can use Formulas 8 and 9 to calculate the new chroma component Cb′ and the new chroma component Cr′:
Cb′=Cb×(WR+WIN)×WNORMAL Formula 8
Cr′=Cr×(WR+WIN)×WNORMAL Formula 9
In another embodiment, for example, if the edge response of the pixel is the positive detail intensity response IP, in sub-step S640, the chrominance correction unit 150 can use Formulas 10 and 11 to calculate the new chroma component Cb′ and the new chroma component Cr′:
Cb′=Cb×W
NORMAL÷(WR+WIP) Formula 10
Cr′=Cr×W
NORMAL÷(WR+WIP) Formula 11
If the edge response of the pixel is the negative detail intensity response IN, in sub-step S640, the chrominance correction unit 150 can use Formulas 12 and 13 to calculate the new chroma component Cb′ and the new chroma component Cr′:
Cb′=Cb×W
NORMAL÷(WR+WIN) Formula 12
Cr′=Cr×W
NORMAL÷(WR+WIN) Formula 13
Referring to
H=arctan(Cb/Cr) Formula 14
S=sqrt(Cb2/Cr2) Formula 15
In the above-mentioned formulas, arctan( ) represents arctangent function, while the sqrt( ) represents square root function. The hue calculation unit 140 is coupled to the chrominance converting unit 130 and the chrominance correction unit 150. The hue calculation unit 140 converts the edge response (IP or IN) provided by the edge response unit 120 into a hue range (step S920), followed by transmitting the hue range and the hue H provided by the chrominance converting unit 130 to the chrominance correction unit 150. In the embodiment, the hue calculation unit 140 includes an LUT of hue range, as shown by Table 1:
HP herein represents hue of the chromatic aberration on the positive detail intensity response IP, HN represents hue of the chromatic aberration on the negative detail intensity response IN, ΔHP represents allowed hue difference on the positive detail intensity response IP and ΔHN represents allowed hue difference on the negative detail intensity response IN. The hue calculation unit 140 can find out the corresponding hue range in the LUT of hue range according to the edge response (IP or IN or other values). In the embodiment, the hue range is defined by hue value and hue difference. For example, the hue range is between (hue value+hue difference) and (hue value−hue difference).
The chrominance correction unit 150 defines the position weight threshold WRT, the positive detail intensity response threshold IPT and the negative detail intensity response threshold INT. In sub-step S221, the chrominance correction unit 150 compares the position weight WR with the position weight threshold WRT, and in sub-step S620, the chrominance correction unit 150 compares the positive detail intensity response IP with the positive detail intensity response threshold IPT (or compares an absolute value of the negative detail intensity response IN with the negative detail intensity response threshold INT), and further in sub-step S630, the chrominance correction unit 150 converts the edge response of the pixel into the edge response weight. After sub-step S630, the chrominance correction unit 150 goes to sub-step S930 to check whether the hue H of the pixel falls in the hue range.
Referring to
In other words, when the hue H falls in the hue range, if the position weight WR is greater than the position weight threshold WRT and the edge response (IP or IN) is greater than the response threshold (IPT or INT), in sub-step S940, the chrominance correction unit 150 corrects the original chrominance of the pixel by using a first normalized parameter WNORMAL1, the edge response weight (WIP or WIN) and the position weight WR. The first normalized parameter WNORMAL1 herein can be any real number. In implementations of the embodiment, the value of the first normalized parameter WNORMAL1 can be decided according to the real design requirements of products. If the edge response of the pixel is the positive detail intensity response IP, in sub-step S940, the chrominance correction unit 150 can use Formulas 16 and 17 to calculate the new chroma component Cb′ and the new chroma component Cr′:
Cb′=Cb×W
NORMAL1÷(WR+WIP) Formula 16
Cr′=Cr×W
NORMAL1÷(WR+WIP) Formula 17
If the edge response of the pixel is the negative detail intensity response IN, in sub-step S940, the chrominance correction unit 150 can use Formulas 18 and 19 to calculate the new chroma component Cb′ and the new chroma component Cr′:
Cb′=Cb×W
NORMAL1÷(WR+WIN) Formula 18
Cr′=Cr×W
NORMAL1÷(WR+WIN) Formula 19
When the hue H does not fall in the hue range, if the position weight WR is greater than the position weight threshold WRT and the edge response (IP or IN) is greater than the response threshold (IPT or INT), in sub-step S940, the chrominance correction unit 150 corrects the original chrominance of the pixel by using a second normalized parameter WNORMAL2, the edge response weight (WIP or WIN) and the position weight WR. The second normalized parameter WNORMAL2 herein can be any real number not equal to the first normalized parameter WNORMAL1. In implementations of the embodiment, the value of the second normalized parameter WNORMAL2 can be decided according to the real design requirements of products. If the edge response of the pixel is the positive detail intensity response IP, in sub-step S950, the chrominance correction unit 150 can use Formulas 20 and 21 to calculate the new chroma component Cb′ and the new chroma component Cr′:
Cb′=Cb×W
NORMAL2÷(WR+WIP) Formula 20
Cr′=Cr×W
NORMAL2÷(WRWIP) Formula 21
If the edge response of the pixel is the negative detail intensity response IN, in sub-step S950, the chrominance correction unit 150 can use Formulas 22 and 23 to calculate the new chroma component Cb′ and the new chroma component Cr′:
Cb′=Cb×W
NORMAL2÷(WR+WIN) Formula 22
Cr′=Cr×W
NORMAL2÷(WR+WIN) Formula 23
In summary, the chrominance correction unit 150 of the embodiments can correct the original chrominance (Cb and Cr) of the pixel by using the position weight WR and the edge response weight (WIP or WIN). Thus, the embodiments can effectively eliminate/reduce the image chromatic aberration without revising the optical design of the set of lenses.
It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present invention without departing from the scope or spirit of the invention. In view of the foregoing, it is intended that the present invention cover modifications and variations of this invention provided they fall within the scope of the following claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
101106068 | Feb 2012 | TW | national |