A character-recognition pre-processing apparatus includes extraction means for
extracting an image of a character string to be subjected to character recognition;
setting means for setting the smallest rectangle that surrounds the character string
image extracted; specifying means for specifying the position of each character
within the smallest rectangle set by the setting means; detection means for detecting,
at each character position specified, the shortest distance between a character
region and the lower edge of the smallest rectangle, and the shortest distance
between the character region and the upper edge of the smallest rectangle; and
judgment means for judging whether the character string extracted is in an upright
state or an inverted state, on the basis of variations in the two shortest distances detected.