Patent ID: 8587702

Claim:
An image processing apparatus comprising: an image pickup device that is equipped with a plurality of image creating pixels that create pixel values for creating images and equipped with a plurality of pairs of phase difference detection pixels of a first type and a second type that create pixel values for making an in-focus state judgment through phase difference detection; a detection unit that detects a first edge in a first distribution data formed by the pixel values of the image creating pixels among pixel values included in image data created by the image pickup device and detects a second edge in a second distribution data and a third edge in a third distribution data, wherein the second distribution data and the third distribution data are formed by the pixel values of the phase difference detection pixels of the first type and the second type, respectively; and a compensation unit that, in a case where a defective pixel is among the phase difference detection pixels of the first type, calculates a distance between the detected third edge regarding the pixel values of phase difference detection pixels of the second type and the detected first edge regarding the pixel values of the image creating pixels, and compensates for a pixel value of the defective pixel on the basis of the calculated distance and the pixel values of the phase difference detection pixels of the second type.