# Patent application title: IMAGE PROCESSING APPARATUS, CONTROL METHOD THEREFOR, AND STORAGE MEDIUM

##
Inventors:
Hiroaki Nashizawa (Tokyo, JP)
Canon Kabushiki Kaisha (Tokyo, JP)

Assignees:
CANON KABUSHIKI KAISHA

IPC8 Class: AH04N964FI

USPC Class:
348239

Class name: Camera, system and detail combined image signal generator and general image signal processing camera and video special effects (e.g., subtitling, fading, or merging)

Publication date: 2013-04-18

Patent application number: 20130093925

## Abstract:

An image processing apparatus that enables a demosaicing process to be
accurately carried out on a color image signal. With respect to a color
mosaic image signal related to each pixel generated by photoelectrical
conversion of an optical image reflecting a subject image, an
interpolation process is carried out in which signals of missing colors
in the each pixel are interpolated using image signals related to pixels
in predetermined directions around the each pixel. The interpolation
process is carried out in each of a plurality of predetermined
directions. Color image signals in the predetermined directions subjected
to the interpolation process are evaluated, and based on an evaluation
result, a color image signal to be outputted as an interpolation process
result is generated. The color image signals in the respective
predetermined directions subjected to the interpolation process are
evaluated with respect to homogeneity and signal intensity.## Claims:

**1.**An image processing apparatus comprising: an interpolation unit adapted to carry out an interpolation process in which, with respect to a color mosaic image signal related to each pixel generated by photoelectrical conversion of an optical image reflecting a subject image, signals of missing colors in the each pixel are interpolated using image signals related to pixels in predetermined directions around the each pixel, wherein said interpolation unit comprises: a direction-by-direction interpolation unit that carries out the interpolation process in each of a plurality of predetermined directions; an evaluation unit that evaluates color image signals in the predetermined directions subjected to the interpolation process by the direction-by-direction interpolation unit; and a generation unit that generates a color image signal to be outputted as an interpolation process result based on a result of the evaluation by the evaluation unit, wherein the evaluation unit evaluates the color image signals in the predetermined directions subjected to the interpolation process with respect to homogeneity and signal intensity, and wherein the evaluation unit evaluates the signal intensity using a G signal, an R-G signal, and a B-G signal.

**2.**An image processing apparatus according to claim 1, wherein the evaluation unit evaluates the homogeneity using dispersion degree.

**3.**An image processing apparatus according to claim 2, wherein the evaluation unit evaluates the dispersion degree using a G signal, an R-G signal, and a B-G signal.

**4.**An image processing apparatus according to claim 1, wherein based on evaluation values of the respective pixels evaluated in the predetermined directions by the evaluation unit, the generation unit calculates a combination ratio of the color image signals in the predetermined directions subjected to the interpolation process, and combines the color image signals in the predetermined directions at the combination ratio, thus generating a color image signal to be outputted as an interpolation process result.

**5.**A control method for an image processing apparatus, comprising: an interpolation step of carrying out an interpolation process in which, with respect to a color mosaic image signal related to each pixel generated by photoelectrical conversion of an optical image reflecting a subject image, signals of missing colors in the each pixel are interpolated using image signals related to pixels in predetermined directions around the each pixel, wherein said interpolation step comprises: a direction-by-direction interpolation step of carrying out the interpolation process in each of a plurality of predetermined directions; an evaluation step of evaluating color image signals in the predetermined directions subjected to the interpolation process in the direction-by-direction interpolation step; and a generation step of generating a color image signal to be outputted as an interpolation process result based on a result of the evaluation in the evaluation step, wherein in the evaluation step, the color image signals in the predetermined directions subjected to the interpolation process are evaluated with respect to homogeneity and signal intensity, and wherein in the evaluation step, the signal intensity is evaluated using a G signal, an R-G signal, and a B-G signal.

**6.**A storage medium storing a program for causing a computer to execute a control method for an image processing apparatus according to claim

**5.**

## Description:

**CROSS**-REFERENCE TO RELATED APPLICATIONS

**[0001]**This application is a divisional of application Ser. No. 12/760,209, filed Apr. 14, 2010, the entire disclosures of which are hereby incorporated by reference.

**BACKGROUND OF THE INVENTION**

**[0002]**1. Field of the Invention

**[0003]**The present invention relates to an image processing apparatus, and in particular to an image processing apparatus and a control method therefor that carry out demosaicing by interpolating missing color signals for each pixel in a color image signal, as well as a computer-readable storage medium storing a program for causing a computer to execute the method.

**[0004]**2. Description of the Related Art

**[0005]**Conventionally, in a color image sensor, color filters in a Bayer pattern as shown in FIG. 19 are used. As the color filters, filters of three primary colors, i.e. red, green, and blue, or three complementary colors, i.e. cyan, magenta, and yellow are used.

**[0006]**In the Bayer pattern, however, only a color signal of one color can be obtained in each pixel, and hence a process is carried out in which color signals of the other two colors missing in each pixel are demosaiced (interpolated). As the demosaicing method, a number of methods have been conventionally known, and bi-linear interpolation and bi-cubic interpolation are known as basic demosaicing methods.

**[0007]**The bi-linear interpolation and the bi-cubic interpolation can obtain favorable interpolation results in, for example, an image including a number of low-frequency components, but causes false color called moire, which does not exist in a real subject, to appear in an image including a number of high-frequency components. The false color results from demosaicing using pixels in a direction other than the direction of an edge which a subject image originally has.

**[0008]**Thus, there has been proposed a demosaicing method using pixels along the direction of an edge which a subject image originally has. This demosaicing method using pixels along the direction of an edge can be broadly divided into two methods. In Japanese Laid-Open Patent Publication (Kokai) No. 2002-300590, there has been proposed a method in which the direction of an edge is determined using neighboring pixels, and interpolation is carried out along the edge without carrying out interpolation in such a direction as to cross the edge.

**[0009]**Also, in Japanese Laid-Open Patent Publication (Kokai) No. 2002-300590, there has been proposed a method in which saturations are calculated using a pixel targeted for interpolation and its neighboring pixels, and a direction in which the saturation is small is adaptively selected so as to improve an accuracy of edge direction determination. On the other hand, in Japanese Laid-Open Patent Publication (Kokai) No. 2008-035470, there has been proposed a method in which interpolation is carried out first on a direction-by-direction basis to generate a plurality of kinds of interpolation results, and then a direction in which an appropriate interpolation result has been obtained is determined and selected.

**[0010]**In Japanese Laid-Open Patent Publication (Kokai) No. 2008-035470, there has been proposed an interpolation method in which an evaluation value called peripheral similarity indicative of the homogeneity of a pixel targeted for interpolation and its neighboring pixels is introduced for the determination about the appropriateness of an interpolating direction, and a direction in which the homogeneity is high is selected as an edge direction.

**[0011]**However, according to the method disclosed in Japanese Laid-Open Patent Publication (Kokai) No. 2002-300590, although false colors in a gray-scale subject having high-frequency components can be reduced, there is concern that an interpolation error resulting from an erroneous judgment occurs in a case of a subject having high-frequency components whose base is colored.

**[0012]**On the other hand, according to the method disclosed in Japanese Laid-Open Patent Publication (Kokai) No. 2008-035470, there may be a case where a false color with low-frequency components having high homogeneity is selected by mistake.

**SUMMARY OF THE INVENTION**

**[0013]**The present invention provides an image processing apparatus and a control method therefor that enable a demosaicing process to be accurately carried out on a color image signal, as well as a computer-readable storage medium storing a program for implementing the method.

**[0014]**Accordingly, in a first aspect of the present invention, there is provided an image processing apparatus comprising an interpolation unit adapted to carry out an interpolation process in which, with respect to a color mosaic image signal related to each pixel generated by photoelectrical conversion of an optical image reflecting a subject image, signals of missing colors in the each pixel are interpolated using image signals related to pixels in predetermined directions around the each pixel, wherein the interpolation unit comprises a direction-by-direction interpolation unit that carries out the interpolation process in each of a plurality of predetermined directions, an evaluation unit that evaluates color image signals in the predetermined directions subjected to the interpolation process by the direction-by-direction interpolation unit, and a generation unit that generates a color image signal to be outputted as an interpolation process result based on a result of the evaluation by the evaluation unit, wherein the evaluation unit evaluates the color image signals in the predetermined directions subjected to the interpolation process with respect to homogeneity and signal intensity.

**[0015]**Accordingly, in a second aspect of the present invention, there is provided an image processing apparatus comprising an interpolation unit adapted to carry out an interpolation process in which, with respect to a color mosaic image signal related to each pixel generated by photoelectrical conversion of an optical image reflecting a subject image, signals of missing colors in the each pixel are interpolated using image signals related to pixels in predetermined directions around the each pixel, wherein the interpolation unit comprises a direction-by-direction interpolation unit that carries out the interpolation process in each of a plurality of predetermined directions, an evaluation unit that evaluates color image signals in the predetermined directions subjected to the interpolation process by the direction-by-direction interpolation unit, and a generation unit that generates a color image signal to be outputted as an interpolation process result based on a result of the evaluation by the evaluation unit, wherein before carrying out the interpolation process on the color mosaic image signal related to the each pixel generated by the photoelectrical conversion, the interpolation unit carries out a predetermined preliminary process on the color mosaic image signal, and the evaluation unit evaluates the color image signals in the respective predetermined directions subjected to the preliminary process and the interpolation process with respect to homogeneity and signal intensity.

**[0016]**Accordingly, in a third aspect of the present invention, there is provided a control method for an image processing apparatus, comprising an interpolation step of carrying out an interpolation process in which, with respect to a color mosaic image signal related to each pixel generated by photoelectrical conversion of an optical image reflecting a subject image, signals of missing colors in the each pixel are interpolated using image signals related to pixels in predetermined directions around the each pixel, wherein the interpolation step comprises a direction-by-direction interpolation step of carrying out the interpolation process in each of a plurality of predetermined directions, an evaluation step of evaluating color image signals in the predetermined directions subjected to the interpolation process in the direction-by-direction interpolation step, and a generation step of generating a color image signal to be outputted as an interpolation process result based on a result of the evaluation in the evaluation step, wherein in the evaluation step, the color image signals in the predetermined directions subjected to the interpolation process are evaluated with respect to homogeneity and signal intensity.

**[0017]**Accordingly, in a fourth aspect of the present invention, there is provided a control method for an image processing apparatus, comprising an interpolation step of carrying out an interpolation process in which, with respect to a color mosaic image signal related to each pixel generated by photoelectrical conversion of an optical image reflecting a subject image, signals of missing colors in the each pixel are interpolated using image signals related to pixels in predetermined directions around the each pixel, wherein the interpolation step comprises a direction-by-direction interpolation step of carrying out the interpolation process in each of a plurality of predetermined directions, an evaluation step of evaluating color image signals in the predetermined directions subjected to the interpolation process in the direction-by-direction interpolation step, and a generation unit step of generating a color image signal to be outputted as an interpolation process result based on a result of the evaluation in the evaluation step, wherein in the interpolation step, a predetermined preliminary process is carried out on the color mosaic image signal before the interpolation process is carried out on the color mosaic image signal related to the each pixel generated by the photoelectrical conversion, and in the evaluation step, the color image signals in the respective predetermined directions subjected to the preliminary process and the interpolation process are evaluated with respect to homogeneity and signal intensity.

**[0018]**Accordingly, in a fifth aspect of the present invention, there is provided a storage medium storing a program for causing a computer to execute a control method for an image processing apparatus.

**[0019]**Accordingly, in a sixth aspect of the present invention, there is provided a storage medium storing a program for causing a computer to execute a control method for an image processing apparatus.

**[0020]**According to the present invention, in the demosaicing process on a color mosaic image signal, homogeneity is used as evaluation criteria information for selecting a direction of a better interpolation result from interpolation results obtained by direction-by-direction interpolation.

**[0021]**For this reason, according to the present invention, an interpolation result (interpolating direction) crossing an edge of a subject is not selected, but a highly correlated interpolating direction, that is, an interpolating direction along an edge of a subject is selected.

**[0022]**Moreover, because evaluation is carried out with consideration given to signal intensity as well as homogeneity, a direction in which homogeneity is high but that is undesirable, for example, a direction in which a false color including low-frequency components exists can be prevented from being selected.

**[0023]**Further features of the present invention will become apparent from the following description of exemplary embodiments (with reference to the attached drawings).

**BRIEF DESCRIPTION OF THE DRAWINGS**

**[0024]**FIG. 1 is a block diagram schematically showing an arrangement of an image pickup apparatus according to first and second embodiments of the present invention.

**[0025]**FIG. 2 is a block diagram schematically showing an arrangement of a demosaicing unit of the image pickup apparatus according to the first embodiment of the present invention.

**[0026]**FIG. 3 is a block diagram schematically showing an arrangement of a V-direction interpolation unit and an H-direction interpolation unit (direction-by-direction interpolation units) of the demosaicing unit shown in FIG. 2.

**[0027]**FIG. 4 is a block diagram schematically showing a pixel arrangement of a Bayer pattern useful in explaining a direction-by-direction interpolation process.

**[0028]**FIG. 5 is a flowchart showing an evaluation value calculating process for a demosaicing process according to the first embodiment of the present invention.

**[0029]**FIG. 6 is a view showing a 3-by 3-pixel region useful in explaining the evaluation value calculating process for the demosaicing process according to the first embodiment of the present invention.

**[0030]**FIGS. 7A and 7B are views showing filter coefficients of an LPF used in calculating evaluation values for the demosaicing process.

**[0031]**FIG. 8 is a flowchart showing a direction-selection/image-generation process in the demosaicing process.

**[0032]**FIG. 9 is a block diagram schematically showing an arrangement of a demosaicing unit according to the second embodiment of the present invention.

**[0033]**FIG. 10 is a flowchart showing an evaluation value calculating process for a demosaicing process according to the second embodiment of the present invention.

**[0034]**FIGS. 11A and 11B are views showing a 3-by 3-pixel region useful in explaining the evaluation value calculating process for the demosaicing process according to the second embodiment of the present invention.

**[0035]**FIG. 12 is a conceptual diagram useful in explaining a dispersion degree as an evaluation value for the demosaicing process according to the second embodiment of the present invention.

**[0036]**FIG. 13 is a block diagram schematically showing an arrangement of an image pickup apparatus according to a third embodiment of the present invention.

**[0037]**FIG. 14 is a block diagram schematically showing an arrangement of a preliminary processing unit for a demosaicing process according to the third embodiment of the present invention.

**[0038]**FIG. 15 is a conceptual diagram useful in explaining a principle on which chromatic aberration of magnification occurs.

**[0039]**FIG. 16 is a conceptual diagram useful in explaining a principle on which axial chromatic aberration occurs.

**[0040]**FIG. 17 is a block diagram schematically showing an arrangement of an image pickup apparatus according to a fourth embodiment of the present invention.

**[0041]**FIGS. 18A and 18B are diagrams useful in explaining a demosaicing process carried out by the image pickup apparatus according to the fourth embodiment of the present invention.

**[0042]**FIG. 19 is a diagram schematically showing a pixel arrangement of a Bayer pattern.

**DESCRIPTION OF THE EMBODIMENTS**

**[0043]**The present invention will now be described in detail with reference to the drawings showing embodiments thereof.

**[0044]**FIG. 1 is a block diagram schematically showing an arrangement of an image processing apparatus according to a first embodiment of the present invention. The image processing apparatus according to the present embodiment has a function of effectively reducing false colors in Bayer image data taken by a color image pickup device 102.

**[0045]**Specifically, an optical image (subject image) reflecting a subject forms an image on the color image pickup device 102 via a taking lens 101, and is photoelectrically converted.

**[0046]**The color image pickup device 102 is configured as a single-chip color image pickup device having common primary-color filters. The primary-color filters are comprised of color filters of three primary colors R (red), G (green), and B (blue) having transmission dominant wavelength bands close to 650 nm, 550 nm, and 450 nm, respectively, and generates color planes corresponding to the respective bands of the three primary colors.

**[0047]**In the single-chip color image pickup device, these color filters are spatially arrayed on a pixel-by-pixel basis as shown in FIG. 19, and in each pixel, only light intensity in each single color plane can be obtained. Thus, a color mosaic image signal, that is, an image signal in which two colors among the three primary colors are missing in each pixel is outputted from the color image pickup device 102. An A/D conversion unit 103 converts the color mosaic image signal outputted as an analog voltage from the color image pickup device 102 into color digital image data.

**[0048]**A white balance unit 104 carries out a white balance process. Specifically, the white balance unit 104 multiplies the colors R, G, and B by gains so that the colors R, G, and B in an area that should be white can be isochromatic. By carrying out the white balance process prior to a demosaicing process, a higher saturation than the saturation of a false color can be prevented from being obtained by calculation due to color cast or the like when saturation is calculated by a demosaicing unit 105.

**[0049]**The demosaicing unit 105 interpolates color mosaic image data of missing two colors among the three primary colors in each pixel, thus generating a color image with color image data of full colors R, G, and B being present in all the pixels.

**[0050]**The color image data of each pixel is subjected to a matrix conversion process by a matrix conversion unit 106, and a gamma correction process by a gamma conversion unit 107. As a result, basic color image data is generated.

**[0051]**Then, a color adjustment unit 108 carries out various kinds of processes on the basic color image data so as to make an image look better. For example, the color adjustment unit 108 carries out various kinds of color adjustment processes such as noise reduction, saturation enhancement, hue correction, and edge enhancement. A compression unit 109 compresses the adjusted color image data using JPEG or the like to reduce the recording data size.

**[0052]**The processes carried out by the above devices from the color image pickup device 102 to the compression unit 109 are controlled by a control unit 111 via a bus 113. In providing the control, the control unit 111 uses a memory 112 as a need arises. The digital image data compressed by the compression unit 109 is recorded in a recording medium such as a flash memory by a recording unit 110 under the control of the control unit 111.

**[0053]**Next, a description will be given of the demosaicing process carried out by the demosaicing unit 105. The demosaicing unit 105 carries out interpolation in predetermined directions on a target pixel using its neighboring pixels first, and then selects a direction, thus generating a color image signal of the three primary colors R, G, and B as an interpolation process result for each pixel.

**[0054]**Specifically, a V-direction interpolation unit 202 and an H-direction interpolation unit 203 interpolate image data of missing colors in a V (vertical) direction and an H (horizontal) direction, respectively, to Bayer image data 201 of each pixel inputted to the demosaicing unit 105, and as a result, R, G and B image data in the V direction and the H direction is generated for each pixel.

**[0055]**Next, regarding the R, G and B image data of each pixel after the interpolation process in the vertical direction and the horizontal direction, a homogeneity calculation unit 204 and a homogeneity calculation unit 206 calculate homogeneity with respect to each pixel, and an intensity calculation unit 205 and an intensity calculation unit 206 calculate signal intensity with respect to each pixel.

**[0056]**Then, an evaluation value calculation unit 208 calculates final evaluation values separately in the vertical direction and the horizontal direction with respect to each pixel with consideration given to both homogeneity and signal intensity. A direction-selection/image-formation unit 209 compares the final evaluation value in the vertical direction and the final evaluation value in the horizontal direction with each other, and selects the vertical direction or the horizontal direction in which the evaluation value is greater. Then, the direction-selection/image-formation unit 209 generates final interpolation image data based on the R, G and B image data after the interpolation process in the selected direction, and outputs the final interpolation image data as post-interpolation RGB image data 210, that is, demosaiced data.

**[0057]**Referring next to FIG. 3, a description will be given of the direction-by-direction interpolation process carried out by the V-direction interpolation unit 202 and the H-direction interpolation unit 203. As shown in FIG. 3, the V-direction interpolation unit 202 has a V-direction G interpolation unit 202a and a V-direction RB interpolation unit 202b, and the H-direction interpolation unit 203 has an H-direction G interpolation unit 203a and an H-direction RB interpolation unit 203b.

**[0058]**In the V-direction interpolation unit 202, the V-direction G interpolation unit 202a interpolates a G signal (data) of a high frequency band first, and then the V-direction RB interpolation unit 202b interpolates R and B data. Likewise, in the H-direction interpolation unit 203, the H-direction G interpolation unit 203a interpolates G data of a high frequency band first, and then the H-direction RB interpolation unit 203b interpolates R and B data.

**[0059]**Referring next to FIG. 4, a concrete description will be given of the interpolation method. In a case where a G color is to be interpolated, when a target pixel is a pixel related to a G-color filter, G data of the pixel is outputted as it is (mathematical formula 1). In a case where a G color is to be interpolated for a pixel related to an R-color filter and a pixel related to a B-color filter, interpolation data is calculated using a mathematical formula 2 for the V direction and using a mathematical formula 3 for the H direction. It should be noted that G33, G43, and G44 in the mathematical formulas 1, 2, and 3 correspond to pixel symbols shown for the convenience of explanation in FIG. 4.

**{ G 34 = G 34 G 43 = G 43 [ Mathematical formula 1 ] { G 33 = ( - R 13 + 2 G 23 + 2 R 33 + 2 G 43 - R 53 ) 4 G 44 = ( - B 24 + 2 G 34 + 2 R 33 + 2 G 43 - R 53 ) 4 [ Mathematical formula 2 ] { G 33 = ( - R 31 + 2 G 32 + 2 R 33 + 2 G 34 - R 35 ) 4 G 44 = ( - B 42 + 2 G 43 + 2 B 44 + 2 G 45 - B 36 ) 4 [ Mathematical formula 3 ] ##EQU00001##**

**[0060]**In a case where an R color is to be interpolated, when a target pixel is a pixel related to an R color filter, R data of the pixel is outputted as it is (mathematical formula 4). In a case where an R color is to be interpolated for a pixel related to a G-color filter, interpolation data is calculated using a mathematical formula 5. In a case where an R color is to be interpolated for a pixel related to a B-color filter, interpolation data is calculated using a mathematical formula 6. For the interpolation of an R color, the same Mathematical formula is used in the V direction and the H direction.

**[0061]**A B color is interpolated in a manner similar to that in the interpolation of an R color. Specifically, a mathematical formula in which R in the mathematical formulas 4 to 6 is replaced with B is used.

**{R33=R33 [Mathematical formula 4]**

**{ R 34 = ( ( R 33 - G 33 ) + ( R 35 - G 35 ) ) 2 + G 34 R 43 = ( ( R 33 - G 33 ) + ( R 53 - G 53 ) ) 2 + G 43 [ Mathematical formula 5 ] ##EQU00002## {R44=((R33-G33)+(R35-G35)+(R53-G53)+(R55-G55)/4+G44 [Mathematical formula 6]**

**[0062]**Referring next to a flowchart of FIG. 5, a description will be given of an evaluation value calculation process.

**[0063]**The evaluation value calculation unit 208 in FIG. 2 converts V-direction RGB image data 202c in FIG. 3 obtained by interpolating missing colors in each pixel into color signals (values) of a uniform color space so that homogeneity and signal intensity can be easily calculated (S501). In the present embodiment, a L*a*b* color space using three-dimensional orthogonal coordinates is used as the uniform color space.

**[0064]**In converting the V-direction RGB image data 202c into L*a*b* values, first, the evaluation value calculation unit 208 converts the V-direction RGB image data 202c into values of an XYZ color system, which are tristimulus values of an object using mathematical formulas 7 to 9 below. To that end, an RGB color space must be set to be a certain type of RGB color space, and in the present embodiment, it is assumed that an RGB color space is set to be an sRGB color space, and a white color point is set at D65.

**R**'

_{s}RGB=R'

_{8}bit/255

**G**'

_{s}RGB=G'

_{8}bit/255

**B**'

_{s}RGB=B'

_{8}bit/255 [Mathematical formula 7]

**R**'

_{s}RGB,G'

_{s}RGB,B'

_{SRGB}≦0.04045

**R**

_{s}RGB=R'

_{s}RGB/12.92

**G**

_{s}RGB=G'

_{s}RGB/12.92

**B**

_{s}RGB=B'

_{s}RGB/12.92

**R**'

_{s}RGB,G'

_{s}RGB,B'

_{s}RGB>0.04045

**R**

_{s}RGB=[(R'

_{s}RGB+0.055)/1.055]

^{2}.4

**G**

_{s}RGB=[(G'

_{s}RGB+0.055)/1.055]

^{2}.4

**B**

_{s}RGB=[(B'

_{s}RGB+0.055)/1.055]

^{2}.4 [Mathematical formula 8]

**[ X D 65 Y D 65 Z D 65 ] = [ 0.4124 0.3576 0.1805 0.2126 0.7152 0.0702 0.0193 0.1192 0.9505 ] [ R sRGB G sRGB B sRGB ] [ Mathematical formula 9 ] ##EQU00003##**

**[0065]**Next, the evaluation value calculation unit 208 converts the tristimulus values of the object (the values of the XYZ color system) into L*a*b* values using the following mathematical formula 10.

**L***=116(Y/Y

_{n})

^{1}/3-16

**a***=500{(Y/Y

_{n})

^{1}/3-(Y/Y

_{n})

^{1}/3}

**b***=200{(Y/Y

_{n})

^{1}/3-(Z/Z

_{n})

^{1}/3} [Mathematical formula 10]

**[0066]**Here, Xn, Yn, and Zn are tristimulus values of a perfect reflecting diffuser, and it is stipulated that Yn=100. Also, an L* value (luminance value), an a* value (green-red chromaticity value), and a b* value (blue-yellow chromaticity value) are limited in terms of values X, Y, and Z that can be applied thereto. Actually, however, there exist colors other than predetermined colors, and in this case, the evaluation value calculation unit 208 obtains L*a*b* values using the following correction formula (mathematical formula 11).

[Mathematical Formula 11]

**[0067]**It should be noted that the function f in the mathematical formula 11 is expressed by the following mathematical formula 12.

**f**(X/X

_{n})=(X/X

_{n})

^{1}/3 X/X

_{n}>0.008856

**f**(X/X

_{n})=7.787(X/X

_{n})+16/116 X/X

_{n}≦0.008856

**[0068]**The function f (Y/Yn) and the function f (Z/Zn) are also expressed similarly to the function f (X/Xn) in the mathematical formula 12.

**[0069]**Next, the evaluation value calculation unit 208 calculates homogeneity (S502). In the present embodiment, the dispersion degree is used as a measure of homogeneity. The dispersion degree is calculated using 3-by 3-pixels centering on a target pixel (v22) as shown in FIG. 6. Although in the present embodiment, 3-by 3-pixels are used, 5-by 5-pixels, 7-by 7-pixels or the like may be used. Also, a color-difference dispersion parameter calculated by the following mathematical formula 13 is used as a dispersion parameter.

**ΔE**

_{ab}= {square root over ((L

_{1}-L

_{2})

^{2}+(a

_{1}-a

_{2})

^{2}+(b

_{1}-b

_{2})

^{2})- }{square root over ((L

_{1}-L

_{2})

^{2}+(a

_{1}-a

_{2})

^{2}+(b

_{1}-b

_{2})

^{2})- }{square root over ((L

_{1}-L

_{2})

^{2}+(a

_{1}-a

_{2})

^{2}+(b

_{1}-b

_{2})

^{2})- }[Mathematical formula 13]

**[0070]**Although in the present embodiment, ΔEab is used as the color-difference dispersion parameter, ΔE94, ΔE2000, or the like may be used. Concrete methods of calculating ΔE94 and ΔE2000 are well known, and therefore, description thereof is omitted here.

**[0071]**When the color-difference dispersion parameter calculated using the mathematical formula 13 is used, the dispersion degree σ

_{v2}2

^{2}is calculated using the following mathematical formula 14.

**σ v 22 2 = 1 n - 1 i = 1 n ( Δ E ab _ - Δ E ab i ) 2 [ Mathematical formula 14 ] ##EQU00004##**

**[0072]**It should be noted that i in the mathematical formula 14 represents pixel values of pixels v11 to v33 shown in FIGS. 6, and n=9 (3×3=9 pixels).

**[0073]**Next, the evaluation value calculation unit 208 calculates signal intensity (S503). In the present embodiment, saturation is used as a measure of signal intensity. As is the case with the dispersion degree, saturation is calculated using the 3-by 3-pixels centering on the target pixel. A saturation calculation mathematical formula is expressed by the following mathematical formula 15.

**C**= {square root over ((a

_{1}-a

_{2})

^{2}+(b

_{1}-b

_{2})

^{2})}{square root over ((a

_{1}-a

_{2})

^{2}+(b

_{1}-b

_{2})

^{2})} [Mathematical formula 15]

**[0074]**Thus, an evaluation value based on the saturation in the pixel v22 is an average of total nine pixels consisting of the target pixel and the neighboring eight pixels, and is expressed by the following mathematical formula 16.

**C v**22 = 1 n i = 1 n ( C i ) [ Mathematical formula 16 ] ##EQU00005##

**[0075]**The evaluation value calculation unit 208 carries out the processes in the steps S501 to S503 described above with respect to all the pixels of a V image (V-direction RGB data 202c in FIG. 3). Also, the evaluation value calculation unit 208 carries out processes similar to the processes in the steps S501 to S503 described above with respect to all the pixels of an H image (H-direction RGB data 203c in FIG. 3) (S504 to S506).

**[0076]**Upon completing the above processes, the evaluation value calculation unit 208 calculates final evaluation values (S507). In calculating the final evaluation values, first, the evaluation value calculation unit 208 calculates evaluation values based on the degrees of dispersion using the following mathematical formula 17.

**C var h**= σ h 2 σ h 2 + σ v 2 C var v = σ v 2 σ h 2 + σ v 2 [ Mathematical formula 17 ] ##EQU00006##

**[0077]**Here, Cvar

_{h}and Cvar

_{v}represent evaluation values based on the degrees of dispersion. Next, the evaluation value calculation unit 208 calculates evaluation values based on saturations using the following mathematical formula 18.

**Cchroma h**= chroma h chroma h + chroma v Cchroma v = chroma v chroma h + chroma v [ Mathematical formula 18 ] ##EQU00007##

**[0078]**Here, Cchroma

_{h}and Cchroma

_{v}represent evaluation values based on saturations. Next, the evaluation value calculation unit 208 calculates final evaluation values C

_{h}and C

_{v}based on saturations using the following mathematical formula 19.

**C**

_{h}=αCvar

_{h}+(α-1)Cchroma

_{h}

**C**

_{v}=αCvar

_{v}+(α-1)Cchroma

_{v}[Mathematical formula 19]

**[0079]**Here, α is a weighting coefficient, which determines how the dispersion degree and the saturation are balanced in consideration. In the present embodiment, it is assumed that α=0.5.

**[0080]**As a result of the above processes, the evaluation value C

_{h}or C

_{v}is calculated with respect to each pixel, and accordingly, a two-dimensional plane of evaluation values is generated (S507).

**[0081]**Incidentally, final interpolation values are determined by evaluation values, and hence when evaluation values of neighboring pixels vary greatly, this may result in degradation of image quality such as tone jump.

**[0082]**Thus, the evaluation value calculation unit 208 makes the generated evaluation value plane pass through a low-pass filter (hereinafter referred to as the "LPF") (S508). Regarding a filter coefficient of the LPF, either a filter length of three pixels [1, 2, 1] or a filter length of five pixels [1, 4, 6, 4, 1] may be used, and in either case, it is preferred that the evaluation value plane is filtered both vertically and horizontally.

**[0083]**When the evaluation values are thus calculated by the evaluation value calculation unit 208, the direction-selection/image-formation unit 209 selects one of the vertical and horizontal directions based on the evaluation values, and carries out the above filtering process on interpolation data in the selected direction. As a result, the direction-selection/image-formation unit 209 generates final RGB interpolation image data in which R, G, and B color components exist in all the pixels, and outputs the same as post-interpolation RGB image data 210 (demosaiced data).

**[0084]**Referring next to FIG. 8, a concrete description will be given of a direction-selection and interpolation image-generation method.

**[0085]**With respect to each pixel, the direction-selection/image-formation unit 209 compares the evaluation value C

_{h}related to the interpolation in the H direction and the evaluation value C

_{v}related to the interpolation in the V direction with each other, and determines whether or not the evaluation value C

_{h}<the evaluation value C

_{v}(S801). When, as a result, the evaluation value C

_{h}<the evaluation value C

_{v}, the direction-selection/image-formation unit 209 selects R, G, B interpolation data related to the interpolation in the H direction, carries out the above filtering process on the R, G, B interpolation data, and outputs the same as post-interpolation RGB image data 210 (S802).

**[0086]**On the other hand, when the evaluation value C

_{h}≧the evaluation value C

_{v}, the direction-selection/image-formation unit 209 selects R, G, B interpolation data related to the interpolation in the V direction, carries out the above filtering process on the R, G, B interpolation data, and outputs the same as post-interpolation RGB image data 210 (S803)

**[0087]**As described above, in the first embodiment, the degree of color difference dispersion is used as homogeneity as a parameter for calculating evaluation values for selecting a direction to be actually used (interpolation result) from interpolation results obtained by direction-by-direction interpolation. For this reason, an interpolation result in such a direction as to cross an edge of a subject is not selected, but an interpolation result in a highly correlated direction, that is, along an edge of a subject is selected.

**[0088]**Moreover, because saturation as intensity as well as homogeneity is used as a parameter for calculating evaluation values, the possibility that a direction in which homogeneity is good but that is undesirable, for example, a direction in which a false color including low-frequency components exists is selected can be decreased.

**[0089]**In the first embodiment, a direction to be actually used (interpolation result) is adaptively selected from interpolation results obtained by carrying out interpolation in the vertical (V) and horizontal (H) directions separately. On the other hand, in a second embodiment, interpolation is carried out in a plurality of directions, not in one limited direction, and interpolation images in the respective directions are combined according to a ratio of obtained evaluation values (ratio of directions).

**[0090]**A detailed description will now be given of the second embodiment of the present invention.

**[0091]**Arrangements of signal units of an image pickup apparatus according to the second embodiment are substantially the same as those of the first embodiment described with reference to FIG. 1, and therefore, description thereof is omitted, but the second embodiment differs from the first embodiment in an arrangement of the demosaicing unit 105.

**[0092]**FIG. 9 is a block diagram showing in detail the arrangement of the demosaicing unit 105 according to the second embodiment.

**[0093]**In the first embodiment, the two patterns of the H direction and the V direction are prepared for the direction-by-direction interpolation. However, depending on a form of a subject, it may be preferred that interpolation is carried out in directions other than those two directions.

**[0094]**Thus, a basic interpolation unit 211 carries out interpolation in a plurality of directions. In this case, there are some possible interpolation methods, and in the present embodiment, a method described hereafter is used.

**[0095]**As is the case with the V-direction interpolation unit 202 and the H-direction interpolation unit 202, the basic interpolation unit 211 carries out interpolation of R/B after interpolation of G.

**[0096]**Referring to FIG. 4, in interpolation of G, the basic interpolation unit 211 outputs pixel values related to G-color filters as it is as expressed in the mathematical formula 1, and interpolates G values at positions of pixels related to an R-color filter and a B-color filter using the following mathematical formula.

**{ G 33 = ( G 23 + G 32 + G 34 + G 43 ) 4 G 44 = ( G 34 + G 43 + G 45 + G 54 ) 4 [ Mathematical formula 20 ] ##EQU00008##**

**[0097]**The basic interpolation unit 211 interpolates R and B using the mathematical formulas 4 to 6.

**[0098]**Further, in addition to the interpolation in the H direction and the V direction, interpolation is carried out in a plurality of directions, that is, diagonal directions. As a result, natural interpolation results can be obtained for diagonal edges. A DP (diagonal positive) direction of which gradient is positive and a DN (diagonal negative) direction of which gradient is negative are prepared as diagonal directions. A DP-direction interpolation unit 213 and a DN-direction interpolation unit 212 carry out interpolation in the DP direction and the DN direction, respectively.

**[0099]**The G interpolation by the DP-direction interpolation unit 213 and the DN-direction interpolation unit 212 uses G interpolation results obtained by the basic interpolation unit 211. Regarding a method for R interpolation, R interpolation values at R pixel positions are calculated using the mathematical formula 4, and R interpolation values at G pixel positions are calculated using the mathematical formula 5.

**[0100]**R interpolation values at B pixel positions are calculated using the following mathematical formula.

**[ Mathematical formula 21 ] { R 44 P = ( R 35 + R 53 ) / 2 + ( - G 35 + 2 G 44 - G 53 ) / 2 R 44 N = ( R 33 + R 55 ) / 2 + ( - G 33 + 2 G 44 - G 55 ) / 2 ##EQU00009##**

**[0101]**B interpolation at B pixel positions is carried out in a manner similar to that in the R interpolation, and R is replaced with B in the mathematical formulas 4, 5 and 21.

**[0102]**Here, although the present embodiment has been described assuming that the diagonal angle is 0° in the horizontal direction, 45° in the DP direction, and 135° in the DN direction, the present invention is not limited to this, but an arbitrary diagonal angle may be used. For example, diagonal angles may be more finely divided so as to additionally carry out interpolation in a direction of 22.5°.

**[0103]**Post-interpolation RGB images are obtained as a result of the interpolation in the V direction, the H direction, unspecified directions (base), the DP direction, and the DN direction in the above described process. The evaluation value calculation unit 208 calculates evaluation values with respect to these post-interpolation RGB images.

**[0104]**FIG. 10 is a flowchart showing an evaluation value calculating process according to the second embodiment. Although in FIG. 10, there is shown only the evaluation value calculating process for V images, the same evaluation value calculating process as that in FIG. 10 is carried out for images in the H direction, unspecified directions (base), the DP direction, and the DN direction as well.

**[0105]**In the first embodiment, a L*a*b* uniform color space is used to calculate the degree of color difference dispersion as homogeneity. However, a large amount of calculation is required for conversion into L*a*b* values. For this reason, in the second embodiment, homogeneity and intensity are calculated in a G, R-G, B-G color space in which a G signal is used as it is in place of L*, R-G is used in place of a* and b*, and B-G is a color difference signal (S1001 and S1002).

**[0106]**Moreover, in a homogeneity calculating process in the S1001, the dispersion degree is used as a measure of homogeneity as is the case with the first embodiment, but in the homogeneity calculating process in the S1002, the dispersion degree is calculated in a different way than in the first embodiment. In this case, ΔEab is used as a color difference dispersion parameter. On the other hand, in the second embodiment, G, R-G, and B-G are used, the dispersion degree is calculated in relation to these dispersion parameters, and the largest dispersion degree is selected from them.

**[0107]**Moreover, in the first embodiment, the dispersion degree is calculated using a total of nine pixels consisting of a target pixel and its neighboring eight pixels. On the other hand, in the second embodiment, as shown in FIG. 11A, in a case of the H direction, a total of three pixels consisting of a target pixel and its two neighboring pixels in the H direction are used, and the degrees of dispersion σ

_{h1}

^{2}, σ

_{h1}

^{2}, σ

_{h2}

^{2}, and σ

_{h3}

^{2}are calculated using h12, h22, and h32 as respective target pixels. Similarly, in the second embodiment, as shown in FIG. 11B, in a case of the V direction, a total of three pixels consisting of a target pixel and its neighboring two pixels in the V direction are used, and the degrees of dispersion σ

_{v1}

^{2}, σ

_{v2}

^{2}, and σ

_{v3}

^{2}are calculated using v21, v22, and v23 as respective target pixels.

**[0108]**Then, the evaluation value calculation unit 208 obtains the largest dispersion degree among the degrees of dispersion σ

_{h1}

^{2}, σ

_{h2}

^{2}, and σ

_{h3}

^{2}, or σ

_{v1}

^{2}, σ

_{v2}

^{2}, and σ

_{v3}

^{2}as the dispersion values which are evaluation values (see FIG. 12).

**[0109]**In a case of the DP direction, the dispersion values are obtained using a total of three pixels consisting of a target pixel and its neighboring two pixels on the upper right and lower left of the target pixel, and in a case of the DN direction, the dispersion values are obtained using a total of three pixels consisting of a target pixel and its neighboring two pixels on the upper left and lower right of the target pixel. In a case of unspecified directions, the dispersion values are obtained using a total of nine pixels consisting of a target pixel and its neighboring eight pixels.

**[0110]**Then, the evaluation value calculation unit 208 calculates intensity (S1003). As is the case with the first embodiment, saturation is used as a measure of intensity, but in the second embodiment, intensity is calculated in a different way than in the first embodiment.

**[0111]**Specifically, in the first embodiment, the evaluation value calculation unit 208 obtains the average of saturations of a total of nine pixels consisting of a target pixel and its neighboring eight pixels as an evaluation value of intensity, but in the second embodiment, with respect to the H direction and the V direction, the evaluation value calculation unit 208 obtains the largest value among saturations of the above respective target pixels as an evaluation value of intensity.

**[0112]**The evaluation value calculation unit 208 carries out the processes in the S1001 to the S1003 with respect to all the pixels of images related to the V direction, the H direction, unspecified directions, the DN direction, and the DP direction.

**[0113]**Upon completing the processes in the S1001 to the S1003, the evaluation value calculation unit 208 calculates final evaluation values (S1004). In this case, first, the evaluation value calculation unit 208 calculates evaluation values based on the degrees of dispersion using the following mathematical formula 22.

**C var h**= σ h 2 σ h 2 + σ v 2 + σ base 2 + σ dn 2 + σ dp 2 C var v = σ v 2 σ h 2 + σ v 2 + σ base 2 + σ dn 2 + σ dp 2 C var base = σ base 2 σ h 2 + σ v 2 + σ base 2 + σ dn 2 + σ dp 2 C var dn = σ dn 2 σ h 2 + σ v 2 + σ base 2 + σ dn 2 + σ dp 2 C var dp = σ dp 2 σ h 2 + σ v 2 + σ base 2 + σ dn 2 + σ dp 2 [ Mathematical formula 22 ] ##EQU00010##

**[0114]**Here, Cvar

_{h}, Cvar

_{v}, Cvar

_{base}, Cvar

_{dn}, and Cvar

_{dp}represent evaluation values based on the degrees of dispersion. Then, the evaluation value calculation unit 208 calculates evaluation values based on saturations using the following mathematical formula 23.

**Cchroma h**= chroma h chroma h + chroma v + chroma base + chroma dn + chroma dp Cchroma v = chroma v chroma h + chroma v + chroma base + chroma dn + chroma dp Cchroma base = chroma base chroma h + chroma v + chroma base + chroma dn + chroma dp Cchroma dn = chroma dn chroma h + chroma v + chroma base + chroma dn + chrome dp Cchroma dp = chroma dp chroma h + chroma v + chroma base + chroma dn + chroma dp [ Mathematical formula 23 ] ##EQU00011##

**[0115]**Here, Cchroma

_{h}, Cchroma

_{v}, Cchroma

_{base}, Cchroma

_{dn}, and Cchroma

_{dp}represent evaluation values based on saturations. Then, the evaluation value calculation unit 208 calculates final evaluation values C

_{h}, C

_{v}, C

_{base}, C

_{cn}, and C

_{dp}using the following mathematical formula 24.

**C**

_{h}=αCvar

_{h}+(α-1)Cchroma

_{h}

**C**

_{v}=αCvar

_{v}+(α-1)Cchroma

_{v}

**C**

_{base}=αCvar

_{base}+(α-1)Cchroma

_{base}

**C**

_{dn}=αCvar

_{dn}+(α-1)Cchroma

_{dn}

**C**

_{dp}=αCvar

_{dp}+(α-1)Cchroma

_{dp}[Mathematical formula 24]

**[0116]**Here, α is a weighting coefficient, which determines how the dispersion degree and the saturation are balanced in consideration. In the present embodiment, it is assumed that α=0.5.

**[0117]**As a result of the above processes, the evaluation values C

_{h}, C

_{v}, C

_{base}, C

_{dh}, and C

_{dp}are calculated with respect to each pixel, and accordingly, a two-dimensional plane of the evaluation values is generated. Also, as is the case with the first embodiment, the evaluation value calculation unit 208 makes the evaluation value plane pass through the LPF (S1005).

**[0118]**When the evaluation values are thus calculated by the evaluation value calculation unit 208, an image generation unit 220 combines the interpolation images according to the ratio of the evaluation values. The combination ratio is calculated according to the following mathematical formula 25.

**Cratio h**= 1 c h 1 c h + 1 c v + 1 c base + 1 c dn + 1 c dp Cratio v = 1 c v 1 c h + 1 c v + 1 c base + 1 c dn + 1 c dp Cratio base = 1 c base 1 c h + 1 c v + 1 c base + 1 c dn + 1 c dp Cratio dn = 1 c dn 1 c h + 1 c v + 1 c base + 1 c dn + 1 c dp Cratio dp = 1 c dp 1 c h + 1 c v + 1 c base + 1 c dn + 1 c dp [ Mathematical formula 25 ] ##EQU00012##

**[0119]**As a result, final interpolation values are obtained according to the following mathematical formula 26.

**[ Mathematical formula 26 ] ##EQU00013## { R = c h R h + c v R v + c base R base + c dn R dn + c dp R dp G = c h G h + c v G v + c base G base + c dn G dn + c dp G dp B = c h B h + c v B v + c base B base + c dn B dn + c dp B dp ##EQU00013.2##**

**[0120]**By carrying out the above processes on all the pixels, post-interpolation RGB image data 210 is outputted from the image generation unit 220.

**[0121]**As described above, in the second embodiment, a direction to be actually used (interpolation result) is not adaptively selected from results obtained by direction-by-direction interpolation as in the first embodiment, but final interpolation images are generated according to combination ratios. Thus, in the second embodiment, even when different directions are selected for neighboring pixels, values of the neighboring pixels do not differ greatly, and hence an image that is visually natural can be obtained.

**[0122]**It should be noted that in the generation of interpolation images according to combination ratios as described above, when the percentage of correct directions is not higher as compared with other directions, combination with images in other directions may have an adversary effect. Thus, in the second embodiment, the percentage of correct directions is increased by using the method in which the largest values are selected in the dispersion degree and saturation calculating process as described above.

**[0123]**As shown in FIG. 13, a third embodiment differs from the first and second embodiments in that there is provided a preliminary processing unit 114, and a predetermined preliminary process including a white balance process are carried out before the demosaicing process is carried out by the demosaicing unit 105. The preliminary process is carried out so as to enhance the reliability of the demosaicing unit 105 when it calculates the degrees of dispersion and saturations.

**[0124]**As shown in FIG. 14, the preliminary processing unit 114 has a scratch correction unit 1401 and a magnification chromatic aberration correction unit 1402 as well as the same white-balance unit 104 as that in the first embodiment.

**[0125]**A scratch correction process carried out by the scratch correction unit 1401 is significant in terms of the following. Specifically, the image pickup device 102 may have a scratched defective pixel, which is produced in the manufacturing process or produced due to variations in characteristics of internal analog circuits.

**[0126]**When the image pickup device 102 has a scratched defective pixel, signal charge other than from signal charge corresponding to an actual subject image is accumulated in the scratched defective pixel and outputted as an image signal that looks like a scratch.

**[0127]**When a scratched defective pixel is a target pixel, the reliabilities of the dispersion degree and saturations calculated by the demosaicing unit 105 degrade, and there is concern that incorrect directions are selected.

**[0128]**Thus, the scratch correction unit 1401 of the preliminary processing unit 114 carries out a scratch correction process. As a method for this scratch correction process, a variety of methods may be used such as a method in which a position of a scratched defective pixel is recorded in memory in advance, and when a scratch is to be corrected for, the scratched pixel is replaced with a pixel value related to the nearest pixel in the same color.

**[0129]**The magnification chromatic aberration correction unit 1402 is significant in terms of the following. In a color imaging system, a color that does not exist naturally is produced as blur (chromatic aberration) around a bright area on an image due to chromatic aberration of imaging optical system. The chromatic aberration is broadly divided into lateral chromatic aberration (chromatic aberration of magnification) and longitudinal chromatic aberration (axial chromatic aberration). The chromatic aberration of magnification is a phenomenon in which images are formed at different positions along a focal plane according to wavelengths as shown in FIG. 15. The axial chromatic aberration is a phenomenon in which images are formed at different positions along an optical axis according to wavelengths as shown in FIG. 16.

**[0130]**In general, blurring width of chromatic aberration of magnification is significantly smaller as compared with axial chromatic aberration, and depending on shooting conditions such as aperture value, focal length, and subject distance, extremely thin blurs may appear in different ways according to interpolating directions.

**[0131]**In such a case, there is concern that in the evaluation value calculation process based on saturation by the demosaicing unit 105, chromatic aberration of magnification has an adversary effect. Thus, the magnification chromatic aberration correction unit 1402 carries out a magnification chromatic aberration correction process before the demosaicing process is carried out.

**[0132]**As a method for the magnification chromatic aberration correction process, for example, there are possible methods such as geometric transformation in which planes of respective R, G, and B colors are differently distorted. Regarding the degree of distortion, data for use in correcting for chromatic aberration of magnification according to lens type, aperture value, focal length, subject distance, and so on is recorded in memory in advance, and the data is read out for correcting at the time of preliminary processing. In addition, a variety of methods such as a method in which the departure of R and B planes from a G plane in an image is analyzed and corrected for may be used.

**[0133]**Because as described above, by carrying out the scratch correction process, the white balance process, and the magnification chromatic aberration correction process before the demosaicing process is carried out, the reliabilities of evaluation values calculated by the demosaicing unit 105 can be enhanced, and the accuracy of interpolation can be improved.

**[0134]**As shown in FIG. 17, a fourth embodiment differs from the first and second embodiments in FIG. 1 in that a postprocessing unit 115 is additionally provided in a stage next to the demosaicing unit 105. As shown in FIGS. 18A and 18B, the demosaicing unit 105 has white balance units 104a to 104e and magnification chromatic aberration correction units 1402a to 1402e associated with the interpolation units 202, 203, and 211 to 213 for the respective directions.

**[0135]**The demosaicing unit 105 according to the fourth embodiment carries out the same white balance process and magnification chromatic aberration correction process as those in the third embodiment as preliminary processes before evaluation values are calculated.

**[0136]**However, with respect to the post-interpolation RGB image data 210 in individual directions inputted to the image generation unit 220, the demosaicing unit 105 according to the fourth embodiment does not carry out the white balance process and the magnification chromatic aberration correction process as the preliminary processes. Namely, in the fourth embodiment, the white balance process and the magnification chromatic aberration correction process on post-interpolation RGB image data 210 in individual directions are carried out by the postprocessing unit 115.

**[0137]**As a result, demosaicing that generally involves a large amount of calculation does not have to be carried out each time, and hence image processing can be speeded up. It should be noted that the scratch correction process is preferably carried out before the demosaicing process is carried out because the scratch correction process has to be carried out only once.

**Other Embodiments**

**[0138]**Aspects of the present invention can also be realized by a computer of a system or apparatus (or devices such as a CPU or MPU) that reads out and executes a program recorded on a memory device to perform the functions of the above-described embodiment(s), and by a method, the steps of which are performed by a computer of a system or apparatus by, for example, reading out and executing a program recorded on a memory device to perform the functions of the above-described embodiment(s). For this purpose, the program is provided to the computer for example via a network or from a recording medium of various types serving as the memory device (e.g., computer-readable medium).

**[0139]**While the present invention has been described with reference to exemplary embodiments, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.

**[0140]**This application claims the benefit of Japanese Patent Application No. 2009-101859 filed Apr. 20, 2009, which is hereby incorporated by reference herein in its entirety.

User Contributions:

Comment about this patent or add new information about this topic: