The present invention generally relates to a method, apparatus, and device (or integrated circuits) for recognizing and displaying written characters, and, in particular, for local adaptive enhancement of contrast between foreground characters and background character-bearing media, such as envelopes.
Optical character recognition systems are well known. A system with the capability for recognizing handwritten characters is shown and disclosed in U.S. Pat. No. 5,058,182. Such systems generally employ an optical scanner for providing a gray scale image of the obverse side of an envelope containing a return address block and a destination address block. Such a system transforms the image of an envelope into a plurality of pixels, each of which is assigneed a gray level intensity depending upon whether it is background (usually white) or contains foreground (e.g. black, or dark) indicative of a character.
The system quickly separates foreground from background information by establishing a threshold. In a typical character recognition system the gray scale will have 256 levels. A pixel including a character or foreground will have a level at one end of the scale (e.g. at or near zero); white background will have a level at the other end, e.g. 255. So, a threshold level of, for example, 100, can be used to create a binary bit map of the gray scale bit map image. In this way, any pixel with a gray scale value below a certain value is deemed representative of character information and is assigned one binary value, e.g. a "0" (or 1). Pixels with gray level value above the threshold are assigned the other binary value, "1" (or 0) indicative of a white or background area. After the gray scale bit mapped image is so converted into a binary bit mapped image, the information in the binary bit map is further processed in order to recognize characters. After the characters are recognized and interpreted by the system, the envelopes are sorted to one or more collection points for ultimate delivery to addressees. As such, mail may be automatically sorted without the need for human optical inspection and manual handling.
While such systems work well with envelopes made of relatively light colored material and having address characters of relatively dark printing, systems have experienced problems in reliably detecting thresholds where the contrast between the envelope paper and the address characters is less distinct.
A typical problem encountered is termed background degradation. Background degradation occurs where the envelope is of a relatively dark color, for example, red, blue or green. Such dark colored envelopes are frequently used during holiday times and on a variety of greeting cards. Another problem experienced is foreground degradation. Foreground degradation occurs when the printed character has faint foreground strokes, for example, in dot matrix printouts having an outdated ink ribbon. Also, the last page of a set of copies such as carbon copies can produce foreground pixels with relatively high gray levels. When the image is degraded, dark backgrounds processed through the optical scanner are assigned lower than desired gray scale values and foreground features may receive higher than desire gray scale values. As the gray scale values approach each other, the system is less reliable in determining the threshold value, and hence in distinguishing between foreground and background pixels.