1. An image processing apparatus comprising: an obtaining unit configured to obtain an image; a first setting unit configured to set, based on a position of a correction target pixel, a first area of the image, the first area including a plurality of pixels on a line of interest that is set so as to pass through the correction target pixel; a second setting unit configured to set a plurality of second areas of the image, each second area based on positions of a plurality of pixels existing on at least one reference lines that are set so as not to pass through the correction target pixel; a correlation computing unit configured to compute amounts of correlation between the respective second areas and the first area; and a correction unit configured to compute a correction value for correcting a value of a pixel corresponding to the correction target pixel by using a value of a pixel on each of the at least one reference lines, the value being determined based on the amounts of correlation, and correct the value of the pixel corresponding to the correction target pixel by using the correction value.