1. An image processing apparatus which performs image processing on image data, the apparatus comprising: a first correction unit configured to correct a pixel value of a target pixel in the image data based on a first similarity between a first target pixel group including the target pixel and a first reference pixel group including a reference pixel; a second correction unit configured to correct the pixel value of the target pixel based on a second similarity between a second target pixel group including the target pixel and a second reference pixel group including a reference pixel; and an output unit configured to obtain corrected image data by using the result of the first correction unit and the result of the second correction unit based on the first similarity or the second similarity, and to output the corrected image data.