Patent attributes
An image processing apparatus inputs an image obtained by sensing an optical image by an image sensing system, compensates an omitted color component, and outputs a color image. A weight setting unit sets a weight Wk in each direction Sk (k is an integer from 1 to n) of a plurality of directions S1, S2, . . . , 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 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 weights W1 to Wn of the pixel values V1 to Vn. An restoration unit causes the average calculation unit to calculate weighted averages of a plurality of types of color components and restores a value of an omitted color component of the pixel of interest on the basis of the weighted average result and the pixel value of the pixel of interest.