1. An image processing apparatus comprising: a dividing unit configured to divide an inputted image into a plurality of areas by clustering, based on a plurality of representative points, a plurality of pixels in the image; a generating unit configured to generate a set of representative points that are close based on positions of the representative points; and a unifying unit configured to unify a plurality of the areas corresponding to the plurality of representative points included in the set based on respective feature amounts.