1. An image processing apparatus comprising: an obtaining unit configured to obtain an image; a specifying unit configured to specify at least one pixel on an edge of the image as a tracking starting pixel; a tracking unit configured to set peripheral pixels around the at least one pixel as a tracking range and sequentially track pixels that are similar to the at least one pixel from the tracking range; an estimating unit configured to estimate, as a region of interest, a region other than a region consisting of the pixels tracked by the tracking unit; a first determining unit configured to determine whether or not a degree of coincidence between a pixel value of the at least one pixel and pixel values of the peripheral pixels is not less than a first threshold value; and a second determining unit configured to determine whether or not a difference between a pixel value of the tracking starting pixel specified by the specifying unit and the pixel values of the peripheral pixels is less than a second threshold value; wherein when the first determining unit determines that the degree of coincidence is not less than the first threshold value and the second determining unit determines that the difference is less than the second threshold value, the tracking unit determines that one of the peripheral pixels is similar to the at least one pixel, and tracks said one of the peripheral pixels.