Patent ID: 7454057

Claim:
An image processing apparatus which inputs an image obtained by sensing an optical image by an imaging system, compensates for an omitted color component, and outputs a color image, the apparatus comprising: a weight setting unit which sets a weight Wk in each direction Sk (k is an integer from 1 to n) of a plurality of directions S 1 , S 2 , . . . , Sn (n is an integer of not less than 1) starting from a pixel of interest in a predetermined neighborhood of the pixel of interest; an average value calculation unit which calculates a weighted average of pixel values Vk of pixels having a specific color component and located on each direction Sk (k is an integer from 1 to n) in the predetermined neighborhood by using the weights W 1 to Wn of the pixel values V 1 to Vn; and a restoration unit which causes the average calculation unit to calculate weighted averages of a plurality of types of color components, and which restores a value of the omitted color component of the pixel of interest on the basis of a weighted average result and a pixel value of the pixel of interest.