1. An image processing apparatus, comprising: an obtaining unit configured to obtain a plurality of pairs of a feature point in the first image and a feature point in the second image, wherein the pair of feature points are selected such that local feature amounts of the images at the feature points are similar; a setting unit configured to set an evaluation for each of the pairs, the evaluation being set based on at least one of the number of feature points in the first image where local feature amounts are similar to a local feature amount at one of the pair or the number of feature points in the second image where local feature amounts are similar to a local feature amount at one of the pair, in such a manner that the smaller the number of feature points, the higher the evaluation; and a determination unit configured to determine a similarity between the first image and the second image using a RANSAC method, wherein the determination unit is further configured to use a pair having a high evaluation with priority in derivation of a function for transforming coordinates of a feature point in the second image into coordinates of a corresponding feature point in the first image using the RANSAC method.