Patent ID: 7567708

Claim:
An image processing method for detecting a rectangular area from an image, comprising: using an image processing apparatus to perform image processing steps as follows: a binarizing step of binarizing an original image to obtain a binary image; a histogram creation step of creating histograms of numbers of black pixels of the binary image, in each of a horizontal direction and a vertical direction; a rectangle extent detection step of performing a trapezoidal approximation to the histograms so as to detect an extent of a rectangular area in said binary image; and an inclination direction detection step of detecting an inclination direction of said rectangular area in said extent, wherein said rectangle extent detection step includes the steps of: using a hypothesis that said rectangular area is a rectangle; applying a linear approximation by regression analysis to right and left hypotenuses of the trapezoidal approximation so that a shape of the histogram becomes a trapezoid whose right and left hypotenuses are symmetric; comparing precisions of the linear approximation applied to the right and left hypotenuses; and correcting data of one hypotenuse based on data of the other hypotenuse wherein the precision of the linear approximation of said one hypotenuse is better than that of said other hypotenuse.