Patent ID: 7864984

Claim:
A method for calculating a position, in a second direction, of a line along a first direction in an image, based on image data of the image constituted by a plurality of pixels arranged in a matrix form in the first direction and in the second direction, the method comprising: obtaining pixel data of each of a plurality of pixels arranged in the first direction; calculating an extent of unevenness of each tone value indicating the pixel data of each of the plurality of pixels arranged in the first direction; setting a threshold value according to the extent of unevenness; setting a range based on the threshold value; detecting a defective pixel in which the tone value indicating the pixel data is out of the range; calculating a representative value indicating a tone value of a pixel row, based on the pixel data of the pixels other than the defective pixel of the plurality of pixels constituting the pixel row; and calculating a position, in the second direction, of the line, based on the representative value of each pixel row.