Patent ID: 8116568

Claim:
An image processing apparatus for extracting, in accordance with binary image data of a document image, a ruled-line image contained in the document image, the image processing apparatus comprising: a pixel value determination section for determining whether a target pixel of the binary image data is a black pixel or a white pixel; a counting section for counting the number of black pixels connected one after another upstream in a main scanning direction with respect to the target pixel of the binary image data; a ruled-line image data generation section for, when the target pixel of the binary image data is a black pixel and when a value counted for the target pixel is not less than a main-scanning run determination threshold value that has been set in advance, generating ruled-line image data by correcting, to pixel values corresponding to black pixels, pixel values of a predetermined number of pixels connected to the target pixel upstream in the main scanning direction; and a dilation process section for, when eight pixels surrounding a target pixel of the ruled-line image data include a black pixel, performing a dilation process of correcting a pixel value of the target pixel to a pixel value corresponding to a black pixel; and an erosion process section for, when the eight pixel surrounding the target pixel of the ruled-line image data finished with the dilation process include a white pixel, performing an erosion process of correcting the pixel value of the target pixel to a pixel value corresponding to a white pixel.