This disclosure relates to an image processing apparatus or an image
processing method, and takes as its technical problem the fact that
conventionally it is difficult to perform a process of carving out a
rectangle with high precision in a noisy environment.Therefore, as to an
image made by binarizing an original image, histograms of the numbers of
horizontal and vertical black pixels thereof are created and trapezoidal
approximation is performed on the histograms so as to detect vertex
coordinates indicating an extent of a rectangular area in the binary
image. An inclination direction of the rectangular area in the extent is
detected so that the rectangular area can be detected from the binary
image with high precision.