1. An image processing apparatus that performs image processing on image data, the apparatus comprising: a first correction unit configured (i) to correct a pixel value of a target pixel in the image data based on a first similarity determined by comparing pixels included in a first target pixel group including the target pixel with pixels included in a first reference pixel group including a reference pixel, and (ii) to produce a first corrected pixel value of the target pixel; a second correction unit configured (i) to correct the pixel value of the target pixel based on a second similarity determined by comparing pixels included in a second target pixel group including the target pixel with pixels included in a second reference pixel group including a reference pixel, and (ii) to produce a second corrected pixel value of the target pixel; and an output unit configured to obtain corrected image data by using the first corrected pixel value from the first correction unit and the second corrected pixel value of the second correction unit based on one of (i) the first similarity and (ii) the second similarity, and to output the corrected image data, wherein a number of pixels included in the first target pixel group and a number of pixels included in the second target pixel group are different from each other, wherein the number of pixels included in the first target pixel group and the number of pixels included in the first reference pixel group are the same, and wherein the number of pixels included in the second target pixel group and the number of pixels included in the second reference pixel group are the same.