1. An image processing apparatus comprising: an image acquiring unit configured to acquire a first image, which is an image including an eye of a person; an image generating unit configured to generate a second image, which is a binary image representing an edge of the first image; a classifying unit configured to classify, on the basis of presence or absence of the edge, pixels included in the second image; and a pupil-region generating unit configured to generate a pupil region, which is a region corresponding to a pupil of the person in the first image, on the basis of a result of the classification, wherein when pixels having a same value are present separately in a plurality of blocks in the second image, the classifying unit performs the classification of the pixels further on the basis of areas of the blocks or luminance values of pixels in the first image corresponding to the blocks.