In pattern matching for detecting a positional difference between tomographic images of an eye to be examined, a target within the eye to be examined which causes a reduction in the similarity even though there is no positional difference, is selectively excluded.