1. An image processing apparatus comprising: an image pickup unit that images an image of a face; a first extraction unit that extracts a first image pattern as a correct solution pattern based on a sample image of the face, the first image pattern being an image pattern of a target part of the face; a second extraction unit that extracts a second image pattern as a counterexample pattern based on the sample image, the second image pattern being an image pattern of the target part in an adjacent area of the correct solution pattern; a learning unit that learns a pattern recognition of the target part based on the first image pattern and the second image pattern; an identification unit that identifies a face area from the image of the face, the face area being an area where the face is shown; and a detection unit that detects a position of the target part from the face area based on the pattern recognition of the target part.