Background of the Invention
1. Field of the Invention
This invention generally relates to optical character reader (OCR) systems and more particularly to an improved video enhancement system for enabling an optical character reader to accurately read OCR print with inconsistent print contrast.
2. Description of the Prior Art
In recent years optical character recognition (OCR) systems have been employed to automatically read and electrically process hand-printed or machine-printed alphanumeric characters on documents for data processing purposes.
An OCR system generally detects a character on a document by detecting the contrast between that character and its background paper. This detection of characters is usually accomplished by optically scanning an illuminated document containing characters to be read in order to produce a matrix of picture elements or pixels representative of the optical image of the document.
Before characters can be identified, the matrix of pixels must be changed into some type of machine-readable form. Generally, these pixels are quantized so that they can be more readily processed by subsequent data processing equipment.
A first type of system quantizes the pixels to two binary levels to derive binary pixel data by establishing a threshold level against which each pixel in the matrix is compared. Those pixels equal to or greater than the threshold level are assigned a binary "1" value representative of a black data bit, while those pixels below the threshold value are assigned a binary "0" value representative of a white data bit. Some systems then apply the black and white pixel data to subsequent data processing equipment to identify the characters on a document. However, many systems subsequently apply the matrix of black and white pixel data to an enhancement circuit to simplify and help to achieve more accurate results in the subsequent character recognition operation. Such enhancement circuits usually perform line-thinning and/or line-filling operations to cause the scanned character to become a skeletal representative of the character, which may be two or three pixels wide, while still retaining the basic geometrical information of the original character. Exemplary line-thinning and/or line-filling enhancement techniques on two-dimensional black/white binary data are shown in U.S. Pat. Nos. 3,737,855; 4,003,024; and 4,162,482.
A second type of system uses two threshold levels to quantize the pixels into three digital levels to develop black, gray and white pixel data to try to compensate for different print contrast signals encountered in OCR reading. The term "print contrast signal" (PCS) relates to the contrast between the printed image and the background paper of a document. A printed image with a high PCS is very dark and is best read with a high threshold setting. On the other hand, a printed image with a low PCS is very light and is best read with a low threshold level. This second type of system which quantizes pixels to three levels applies the resultant three-level pixel data to an enhancement circuit to achieve line-thinning and line-filling operations before converting the three-level pixel data into black and white pixel data.
The above-described first and second types of systems can very accurately read batches of OCR imprinted documents if the PCS is consistent from document to document, from character to character and within each character. Unfortunately, a batch of documents will often contain documents with different PCS. A single document can have OCR print that has been encoded by two or more different printers, so PCS variations can be encountered between characters on the same document. PCS variations within a single character are also often encountered with very poor OCR print quality. Inconsistent PCS from document to document, from character to character, and within a character all result in poor readability using just two or even three levels of quantization before enhancement.
The background art known to applicant at the time of the filing of this application is as follows:
U.S. Pat. No. 3,737,855, Character Video Enhancement System, by A. Cutaia;
U.S. Pat. No. 4,003,024, Two-Dimensional Binary Data Enhancement System, by J. P. Riganati et al;
U.S. Pat. No. 4,162,482, Pre-Processing and Feature Extraction System for Character Recognition, by Chanchang Su; and
U.S. Pat. No. 4,345,314, Dynamic Threshold Device, by R. C. Melamud et al.
Summary of the Invention
Briefly, an improved video enhancement system is disclosed for quantizing and enhancing input two-dimensional pixel data. In a preferred embodiment of the invention an analog-to-digital converter quantizes to one of eight discrete levels each pixel signal in successive scans of pixel signals representative of a scanned character image. A 3-bit pixel signal from the converter indicates the digital amplitude of each pixel signal. Successive scans of quantized 3-bit pixel signals are shifted into an array of shift registers to form a preselected configuration of 3-bit pixel signals, including a 3-bit center pixel signal C, at each SHIFT pulse time. Each center pixel signal C is selectively compared in a first group of four PROMs with the associated two pixel signals left of C, right of C, above C and below C. Each PROM in the first group outputs a 4-bit code as a function of its decision on whether C could be part of a line segment and, if so, on which part of a line segment. The 4-bit codes from the first group of four PROMs are selectively compared in horizontal and vertical axis decision PROMs. Each axis decision PROM outputs a 4-bit code as a function of its decision on whether or not C is on a segment. A final PROM compares the two 4-bit codes from the axis decision PROMs and accordingly decides whether C should be a first or a second binary value.
It is therefore an object of this invention to provide an improved video enhancement system and method therefor.
Another object of this invention is to provide a system and method for enhancing scans of pixel signals by first quantizing those pixel signals to multi-bit levels and then enhancing those quantized multi-bit pixel signals before turning them into binary black and white signals.
A further object of this invention is to provide an improved system and method for accurately reading OCR print with inconsistent print contrast.
Brief Description of the Drawings
These and other objects, features and advantages of the invention, as well as the invention itself, will become more apparent to those skilled in the art in the light of the following detailed description taken in consideration with the accompanying drawings wherein:
FIG. 1 illustrates a schematic block diagram of a preferred embodiment of the invention incorporated into an OCR (optical character recognition) reader system;
FIG. 2 is a schematic block diagram of the timing and control circuit of FIG. 1;
FIG. 3 illustrates waveforms useful in explaining the operation of the timing and control circuit of FIG. 1;
FIG. 4 is a schematic block diagram of the 3-bit analog-to-digital converter of FIG. 1;
FIG. 5 is a schematic block diagram of the pixel data selector of FIG. 1;
FIG. 6 is a schematic block diagram of the enhancement circuit of FIG. 1; and
FIGS. 7 and 8A-8K are data distribution representations useful in explaining the data comparison PROMs of FIG. 6.
Description of the Preferred Embodiment
It should be noted at this time that, throughout this description of the preferred embodiment, the presence of a slash (/) following either a symbol or an acronym represents the logical inversion of that symbol or acronym.
Referring now to the drawings, FIG. 1 illustrates a preferred embodiment of the invention incorporated into an OCR (optical character recognition) reader system. Rollers 11 and 13 feed a document 15 along a path 17 (designated by a dashed line headed by an arrowhead) between a LED (light emitting diode) 19 and a phototransistor or sensor 21 and past a scan position 23.
The LED 19 and sensor 21 are physically mounted along the path 17 of the document 15 at a position approximately 12 millimeters before the scan position 23 and cooperate to detect the leading and trailing edges of the document 15.
As the document 15 moves along the path 17, it breaks the light path between the LED 19 and sensor 21, causing the sensor 21 to generate a high sensor signal. This high sensor signal is compared to a preselected bias level by a comparator 25. Since the presence of a document 15 between the LED 19 and sensor 21 causes the high sensor signal to exceed the bias level, the comparator 25 outputs a high signal.
A leading edge time delay circuit 27 delays the high signal from the comparator 25 by approximately 5 milliseconds. The rising leading edge of the delayed high signal is then used to set a flip flop 29 to develop a DOCUMENT PRESENT signal to commence a line scanning operation (to be explained) on the document 15 as it moves past the scan position 23.
The rising leading edge of the DOCUMENT PRESENT signal was generated by the leading edge of the document 15. However, the DOCUMENT PRESENT signal is not initiated until approximately 5 milliseconds after the document 15 is detected in order to compensate for a 12 millimeter physical displacement of the sensor 21 from the scan position 23.
As the trailing edge of the document 15 passes between the LED 19 and sensor 21, the light path between the LED 19 and sensor 21 is restored. This causes the sensor signal from sensor 21 to fall. As a result, the comparator 25 outputs a low signal which is delayed by a trailing edge time delay 31 for approximately 5 milliseconds to again compensate for the 12 millimeter displacement of the sensor 21 from the scan position 23.
The time delay 31 also inverts the falling trailing edge of the signal from the comparator 25 to develop a rising signal to reset the flip flop 29. This resetting of the flip flop 29 terminates the DOCUMENT PRESENT signal, thereby terminating the line scanning operation on the document 15 since the trailing edge of the document 15 has moved past the scan position 23 at this time.
A line scanning operation is performed on the document 15 as the document 15 passes the scan position 23. As the document 15 is moved along the path 17, it is illuminated at the scan position 23 by light from a light source or lamp 23 passing through a light guide 35. A reflected optical image of characters printed on the document 15 is focused by a lens assembly 37 onto the face of an imaging sensor array 39. The array 39 could comprise any suitable array such as, for example, an array of photodiodes, a photoarray or a charge coupled device array.
For purposes of this description, the array 39 is an electrically-scanned, 64 element, linear photodiode array sold by the Reticon Corporation, Sunnyvale, Calif. and designated as a model RL-64A Solid State Linear Scanner. The array 39 is positioned adjacent to the scan position 23 and is physically oriented perpendicular to the path 17 of the document 15. The array 39 covers a total scan band of approximately 11 millimeters (0.4 inches) in 64 segments of approximately 0.16 millimeters (0.00625 inches) each.
During a line scanning operation a timing and control circuit 41 is enabled by the DOCUMENT PRESENT signal to selectively generate two-phase clocks, designated as PHASE 1 and PHASE 2, a START ARRAY SIGNAL, CLK clocks and SHIFT pulses.
The array 39 is clocked by the PHASE 1 and PHASE 2 clocks at a combined nominal rate of 1.111 MHz (megahertz) for scanning the photodiodes (not shown) in the array 39 from bottom to top. Thus, as the document 15 traverses the scan position 23 of the array 39, the array 39 generates a plurality of vertical scan lines of the 0.4 inch scan band of the document 15. Each scan line of the array 39 develops a serial sequence of 64 discrete analog picture elements or pixel signals related in exact sequence to the respective positions of the photodiodes in the array 39. Considering the relatively high frequency at which the photodiodes in the array 39 are scanned, each sequence of 64 pixels in a scan represents a substantially unskewed slice of the scan band. The START ARRAY signal from the timing and control circuit 41 starts a new scan line approximately two microseconds after the preceding scan line is terminated. As a result, each of the 0.16 millimeter high columns lies substantially adjacent to each other along the length of the scan band.
The amplitude of each pulse from each photodiode in the array 39 is substantially proportional to the arithmetic product of the light falling on the corresponding photodiode and the time the photodiode is exposed to the light. The 64 pulses in each scan line from the array 39 are converted to raw video pulses in video amplifier 43. The raw video pulses from the video amplifier 43 consist of 64 negative-going pulses, having amplitudes between -1.4 V (volts) for black pixel data and -5 V for white pixel data. All 64 raw video pulses represent one vertical scan of the 0.4 inch scan band of the document 15. This scan band is adjustably positioned to where the OCR print is located on the document 15.
The pulses from video amplifier 43 are applied to a unity voltage gain, current amplifier 45 to develop analog VIDEO PULSES. These analog VIDEO PULSES, which represent discrete pixel signals from the array 39, are applied to a low pass filter 47 and a 3-bit analog-to-digital (A/D) converter 49.
In response to the VIDEO PULSES, the low pass filter 47 generates a bias level that is the lowest voltage level of the VIDEO PULSES encountered in the document 15 being scanned. This lowest voltage level represents the white background level of that document 15. The lowest voltage level signal from the filter 47 is applied to an adjustable or variable gain amplifier 51 in order to provide an adjustable LOWEST REFERENCE LEVEL to the analog-to-digital converter 49. This LOWEST REFERENCE LEVEL from the amplifier 51 is utilized by the converter 49 to internally establish 8 levels of quantization.
The converter 49 is enabled by the DOCUMENT PRESENT signal to synchronously digitize each of the VIDEO PULSES at the CLK rate into a 3-bit digital signal representing an associated one of the 8 levels of quantization. This 3-bit digital signal is a 0 (000) for a white or background pixel, a 7 (111) for a very dark or black pixel, and some quantity from 1 (001) through 6 (110) for any one of the six shades of gray pixels between 0 and 7.
Streams of 3-bit digital signals developed by the converter 49 from consecutive line scans of the document 15 are clocked into a pixel data selector 53 by SHIFT pulses. The pixel data selector 53 operates to apply each 3-bit pixel signal as a center pixel signal, as well as selected 3-bit neighboring pixel signals of that center pixel signal, to an enhancement circuit 55 which is also clocked by SHIFT pulses. The enhancement circuit 55 looks at each center pixel signal and its selected neighboring pixel signals and determines as a function of a predetermined enhancement algorithm whether or not the center pixel signal should be outputted as black or white pixel data. The cumulative effect of this enhancement algorithm is to thicken thin character segments and thin thick character segments.
The timing and control circuit 41 will now be explained by referring to the circuit 41 shown in FIG. 2 and its waveforms shown in FIG. 3.
A 1.111 MHz clock generator 57 develops two-phase clocks, CLK and CLK/. Clock CLK is applied to the count input of a counter 59. When no document 15 (FIG. 1) is present in the path 17 (FIG. 1), the DOCUMENT PRESENT signal is low. The DOCUMENT PRESENT signal is applied to a first input of an AND gate 61. This low DOCUMENT PRESENT signal causes AND gate 61 to output a low signal to hold the counter 59 reset to a high STATE 0 (not shown). As a result, the counter 59 outputs low STATE 1, STATE 2 and STATE 66 signals at this time.
The low STATE 66 signal from counter 59 is inverted by inverter 63 to enable a second input of AND gate 61. However, since DOCUMENT PRESENT is low at this time, the resultant low signal from AND gate 61 keeps the counter 59 reset to its high STATE 0.
The low STATE 1 signal from counter 59 is inverted by an inverter 65 to enable a first input of an AND gate 67. However, since DOCUMENT PRESENT is low at this time, the resultant low signal from AND gate 67 holds a flip-flop 69 reset. When held in a reset condition, the flip-flop 69 is prevented from generating PHASE 1 and PHASE 2 clocks at its Q and Q/ outputs, respectively.
The low DOCUMENT PRESENT signal also holds a flip-flop 71 reset and a flip-flop 73 set. While being held reset, the flip-flop 71 is prevented from developing a START ARRAY pulse at its Q output. Similarly, while being held set, the resultant low Q/ output of flip-flop 73 disables an AND gate 75. When disabled the AND gate 73 prevents CLK pulses from passing therethrough as SHIFT pulses.
At time t.sub.0 DOCUMENT PRESENT goes high, indicating that a document 15 (FIG. 1) has been detected. The high DOCUMENT PRESENT signal enables AND gate 67, removes the reset from flip-flop 71 and removes the set from flip-flop 73. In addition, the high DOCUMENT PRESENT signal is passed through enabled AND gate 61 to remove the reset from the counter 59 and enable the counter 59 to start counting CLK pulses.
At time t.sub.1, the rising edge of the first CLK pulse after time t.sub.0 causes the counter 59 to output a high STATE 1 signal. This high STATE 1 signal is inverted by inverter 65. Even though AND gate 67 is now enabled by the high DOCUMENT PRESENT signal, the low output of inverter 65 causes AND gate 67 to output a low signal to hold flip-flop 69 reset during the period of STATE 1 (t.sub.1 -t.sub.2). The high STATE 1 signal is also applied to the data input of flip-flop 71 and also through OR gate 77 to the data input of flip-flop 73.
The rising edge of the first CLK/ pulse after t.sub.1 clocks the high STATE 1 signal out of the flip-flop 71 as the START ARRAY signal to start a new line scan in the array 39 (FIG. 1). The rising edge of the first CLK/ pulse after t.sub.1 also clocks the high STATE 1 signal to the Q output of flip-flop 73, causing the low Q/ output of flip-flop 73 to disable AND gate 75 to prevent the AND gate 75 from outputting a SHIFT pulse during the period (t.sub.1 -t.sub.2) of STATE 1.
At time t.sub.2 the rising edge of a CLK pulse causes the counter 59 to output a high STATE 2 signal. The STATE 1 signal goes low and remains low after time t.sub.2. The low STATE 1 signal is applied to the data input of flip-flop 71 and is also inverted by inverter 65 and passed through enabled AND gate 67 to remove the reset from flip-flop 69.
The rising edge of the first CLK/ pulse after t.sub.2 clocks the low STATE 1 signal out of flip-flop 71 to terminate the START ARRAY pulse.
Note that the Q/ output of flip flop 69 is connected to the data input of flip-flop 69 to determine the next output of that flip-flop. Since the reset was removed from the flip flop 69 at time t.sub.2, the flip-flop 69 will develop a sequence of PHASE 1 and PHASE 2 clock outputs on the rising edges of the subsequent CLK/ pulses. Each of the PHASE 1 and PHASE 2 clocks will have a nominal frequency of 0.555 MHz. The 64 rising transitions of the PHASE 1 and PHASE 2 clocks between times t.sub.2 and t.sub.66 are used to scan the array 39 (FIG. 1) to develop a line scan of pixel data. The pulse developed between time t.sub.66 and time t.sub.67 can be used to initialize or reset the array 39 for the next line scan operation which, as shown in FIG. 3, begins at time t.sub.67.
The high STATE 2 signal is also applied through OR gate 77 to the data input of flip-flop 73. The rising edge of the first CLK/ pulse after t.sub.2 clocks the high STATE 2 signal to the Q output of flip flop 73, causing the low Q/ output of flip-flop 73 to disable the AND gate 75 to prevent the AND gate 75 from outputting a SHIFT pulse during the period (t.sub.2 -t.sub.3) of STATE 2.
At time t.sub.3 the counter 59 changes to a high STATE 3 signal (not shown). At this time both of the STATE 1 and STATE 2 signals are low. As a result, the OR gate 77 applies a low signal to the data input of flip-flop 73. The rising edge of the first CLK/ pulse after time t.sub.3 clocks this low signal from OR gate 77 to the Q output of flip flop 73. The resultant high Q/ output of flip-flop 73 then enables AND gate 75 to pass 64 successive CLK pulses out as 64 SHIFT pulses during the remaining portion of a line scan period. The first two CLK pulses which occur during the line scan period are prevented from passing through AND gate 75 as SHIFT pulses by the consecutive high STATE 1 and STATE 2 signals from the counter 59.
At time t.sub.66, the counter 59 changes to a high STATE 66 signal. However, the leading rising edge of this high STATE 66 signal is inverted by inverter 63 to a falling edge and passed through AND gate 61 to immediately reset the counter 59 to a high STATE 0. This causes the STATE 66 output to go low.
The counter 59 remains in this high STATE 0 condition until time t.sub.67. At time t.sub.67, the rising edge of the next CLK pulse after time t.sub.66 causes the counter 59 to start outputting a new sequence of STATE 1 through STATE 66/0 signals for the next line scan. Note that the AND gate 75 is still enabled by a high Q/ output from flip-flop 75 to output SHIFT pulses until the first rising edge of CLK/ after t.sub.67 clocks the flip-flop 73 to disable the AND gate 75. The operation of each succeeding scan is similar to that described above. When the document 15 (FIG. 1) has been completely scanned, DOCUMENT PRESENT goes low to terminate the above-described scanning operation until another document 15 is to be scanned.
FIG. 4 illustrates the 3-bit analog-to-digital converter (A/D) 49 of FIG. 1. A resistor ladder comprised of serially-connected resistors 81-87 is connected between the LOWEST REFERENCE LEVEL and ground to establish voltage threshold levels 1-7. The LOWEST REFERENCE LEVEL (level 1) is set by the variable gain amplifier 51 of FIG. 1 to an exemplary voltage level of -4.5 V (volts) with background pixels at a -5 V level. As a result, exemplary values for levels 1-7 can be -4.5 V, -4.05 V, -3.6 V, -3.15 V, 2.7 V, -2.25 V. and -1.8 V, respectively.
Levels 1-7 are respectively applied to first inputs of comparators 91-97. Each of the sequence of video pulses from current amplifier 45 (FIG. 1) is applied in parallel to second inputs of the comparators 91-97 for comparison with levels 1-7. The amplitudes of these video pulses range from about -5 V for a white pixel to about -1.4 V for a black pixel.
If the amplitude of an input video pulse crosses or goes below the threshold level applied to a comparator, that comparator will output a low or 0 state signal while the video pulse is below that level. Conversely, if the amplitude of an input video pulse does not cross or go below the threshold level applied to a comparator, that comparator will output a high or 1 state signal. It can therefore be seen that the output from each of the comparators 91-97 is binary in format and quantized on the basis of an associated one of the threshold levels 1-7 applied to that comparator.
The 0 and/or 1 state binary outputs of comparators 91-97 are respectively applied to first inputs of gates 101-107. The DOCUMENT PRESENT signal is applied in parallel to second inputs of gates 101-107. When no DOCUMENT PRESENT SIGNAL is applied, the gates 101-107 inhibit the passage of the digitized video pixel data from the comparators 91-97. When DOCUMENT PRESENT is high, indicating that a document 15 (FIG. 1) is being scanned, the gates 101-107 are enabled to respectively pass the pixel data from the comparators 91-97 to set inputs of flip-flops 111-117.
At the beginning of each one of the input video pulses, all of the flip-flops 111-117 are reset to low or 0 state outputs by the falling edge of CLK/. After one of the flip-flops 111-117 is reset to a 0 state output by CLK/, the following binary state of its associated comparator will determine whether or not that flip-flop will be set. A binary 0 from its associated comparator will set the flip-flop to develop a high or 1 state output, whereas a binary 1 from its associated comparator will cause the flip-flop to remain in its reset condition to develop a low or 0 state output.
The outputs of flip-flops 111-117 are designated as GRAY 1-GRAY 7 and are indicative of the relative amplitude of the video pulse occurring after the falling edge of CLK/. These GRAY 1-GRAY 7 signals are converted into a 3-bit digital code or signal by a 3-bit encoder 119. The three bits of the code at the output of encoder 119 are respectively latched into flip-flops 121-123 by the rising edge of the CLK/ pulse in order to respectively develop LSB (least significant bit), 2SB (second significant bit) and MSB (most significant bit) outputs.
The following TABLE 1 illustrates the various possible values of the GRAY 1-GRAY 7 signal inputs to encoder 119 and the resultant, associated LSB, 2SB and MSB outputs from encoder 119.
In the operation of the 3-bit A/D converter 49 of FIG. 4, a white level pixel signal or video pulse with an amplitude of, for example, -5 V will cross each of the levels 1-7 and cause all of the comparators 91-97 to output binary 0 signals. These seven binary 0 signals will set all of the flip-flops 111-117 to output 1-state GRAY 1-GRAY 7 signals. As shown in TABLE 1, the encoder 119 will interpret these seven 1-state signals (1111111) as a digital 3-bit code 000, indicating a white level video pulse. On the other hand, a black level video pulse with an amplitude of, for example, -1.4 V will not cross any of the levels 1-7 and, therefore, all of the comparators 91-97 will output binary 1 signals. These seven 1 state signals will not set any of the flip-flops 111-117. Therefore, the flip-flops 111-117 will remain in their reset conditions, outputting 0-state GRAY 1-GRAY 7 signals. As shown in TABLE 1, the encoder 119 will interpret these seven 0-state signals (0000000) as a digital 3-bit code 111, indicating a black level video pulse. A gray level video pulse, having an amplitude between 000 (white) and 111 (black), will cross some, but not all, of the levels 1-7. For example, if a video pulse is -2.9 V in amplitude, it will cross levels 5-7 but not levels 1-4. As a result, this -2.9 V video pulse will cause the outputs of flip-flops 115-117 to be set high, with flip-flops 111-114 remaining reset to low outputs. The encoder 119 will interpret the resultant GRAY 1-GRAY 7 signals (0000111) as a digital 3-bit code 4 (100), as shown in TABLE 1. Note in TABLE 1 that there are eight different combinations of GRAY 1-GRAY 7 signals that can be inputted to the encoder 119, since a video pulse can cross none or any number of the levels 1-7.
With each line scan of the document 15, 64 video or pixel data pulses are applied to the A/D converter 49. As mentioned before, the converter 49 quantizes each of the video pulses into eight discrete levels represented by the LSB, 2SB and MSB binary signals. Consequently, each of the LSB, 2SB and MSB outputs of the A/D converter 49 is comprised of a serial binary data bit stream. These three serial binary data bit streams, which collectively form a 3-bit wide sequence of quantized video pulse values, are applied in parallel to the pixel data selector 53 illustrated in FIG. 5.
Basically, pixel data selector 53 formats the three data bit streams in order to selectively apply each 3-bit pixel signal and predetermined neighboring 3-bit pixel signals of that 3-bit pixel signal to the enhancement circuit 55 for subsequent enhancement of the data derived from the scanned document 15.
As shown in FIG. 5, the LSB serial binary data bit stream is applied to an LSB data selection circuit 125, while the 2SB and MSB serial binary data bit streams are respectively applied to 2SB and MSB data selection circuits 127 and 129. Since the data selection circuits 125, 127 and 129 are similar in structure and operation, only the LSB data selection circuit 125 will be discussed in detail.
The LSB serial binary data bit stream, comprised of the LSB data derived from consecutive scans of the document 15, is synchronously shifted through serially connected 1 by 64-bit shift registers 131-134 and 5-bit shift register 135 by the SHIFT pulses. Since, as stated before, the document 15 (FIG. 1) is being vertically scanned by the array 39 (FIG. 1), the shift registers 131-134 store complete columns of data while the shift register 135 stores a partial column of data. More specifically, the LSB data stored in shift register 135 represents the LSB data from the last five video pulses of a first column, while the LSB data stored in shift registers 134, 133, 132 and 131 represents the LSB data of second, third, fourth and fifth columns, respectively. In this manner, a 5 -bit-by-5 bit window or matrix of LSB data is formed comprised of the first five stages of shift registers 131-135. More particularly, the 5 by 5 bit matrix is comprised of column 5 stages A-E of register 131, column 4 stages F-J of register 132, column 3 stages K-N and P of register 133, column 2 stages Q-U of register 134 and column 1 stages V-Z of register 135.
The center LSB of this 5 bit-by-5 bit matrix is taken from the output of stage M and is outputted from the LSB data selection circuit 125 as the row 3, column 3 LSB signal. For purposes of subsequent enhancement, not all of the LSB signals in the matrix are needed. As a result, just the center LSB, the two LSBs to the left of the center LSB, the two LSBs to the right of the center LSB, the two LSBs above the center LSB and the two LSBs below the center LSB are selected from the matrix in the LSB data selection circuit 125 for further processing.
The output of stage S in register 134 and the output of stage X in register 135 are the two LSB signals to the right of the center LSB and are outputted as the row 3, column 2 and row 3, column 1 LSB signals, respectively. The output of stage H in register 132 and the output of stage C in register 131 are the two LSB signals to the left of the center LSB and are outputted as the row 3, column 4 and row 3, column 5 LSB signals, respectively. Similarly, the outputs of stages N and P in register 133 are the two LSB signals below the center LSB and are outputted as the row 2, column 3 and row 1, column 3 LSB signals, respectively. Finally, the outputs of stages L and M in register 133 are the two LSB signals above the center LSB and are outputted as the row 4, column 3 and row 5, column 3 LSB signals, respectively.
Each of the 2SB and MSB data selection circuits 127 and 129 output binary data from locations in shift registers (not shown) similar to the previously specified locations in shift registers 131-135 of LSB data selection circuit 125, but for respective 2SB and MSB binary signals. As shown in FIG. 5, correspondingly positioned LSB, 2SB and MSB bits from the data selection circuits 125, 127 and 129 are combined to simultaneously form a group of nine 3-bit wide pixel signals from columns 1-5 of row 3 and rows 1, 2, 4 and 5 of column 3. This group of 3-bit wide pixel signals is then applied in parallel to the enhancement circuit 55 of FIG. 6. Each subsequent SHIFT pulse causes a new group of nine 3-bit wide pixel signals to be applied to the enhancement circuit 55.
The enhancement circuit 55 looks at each 3-bit center pixel signal and its selected, associated, neighboring 3-bit pixel signals and determines as a function of a predetermined enhancement algorithm whether or not the center pixel signal should be outputted as black or white pixel data.
The enhancement circuit 55 stores the enhancement algorithm in data comparison PROMs 141-144, axis decision PROMs 145 and 146, and B/W (black/white) decision PROM 147. This enhancement algorithm operates on the 3-bit wide pixel data from columns 1-5 of row 3 and from rows 1, 2, 4 and 5 of column 3 to determine a black or white decision in relation to the 3-bit wide center pixel signal from column 3, row 3 during the period of each SHIFT pulse.
The enhancement algorithm operates on the constant strokewidth features of the OCR fonts. Strokewidth for size I OCRA, OCRB, 1428 and 1403 fonts are all nominally 0.014 inches wide. With an optics resolution of 6.25 mils by 5.94 mils per pixel, a scan of an OCR character should produce an image with strokewidths of 2 or 3 pixels wide. When scanning a character this enhancement algorithm simply turns black the 2 or 3 pixels (of a character segment) which have the highest digital level and turns all other pixels white.
As shown in FIG. 6, the 3-bit wide pixel signals from columns 1-5 of row 3 and from rows 1, 2, 4 and 5 of column 3 are selectively applied to the data comparison PROMs 141-144. Each of these PROMs is similar to the others and stores the same data comparison algorithm in 1024 four-bit wide memory locations. As a result of this commonly stored data comparison algorithm, the designations shown in FIG. 7 will be used in the explanation of the data comparison algorithm. It is the center pixel signal C upon which a decision is to be made. This center pixel C from row 3, column 3 is applied to each of the PROMs 141-144. Note that the pixel signals that are located one and two pixel positions away from the center pixel C along either a horizontal or vertical axis are respectively designated as Ax and Ay.
Each of the PROMs 141-144 compares the center pixel C with the two pixels Ax and Ay beside it on one side, as shown in FIGS. 5-7. The PROM 141 compares the center pixel signal C from row 3, column 3 with the two pixel signals to the right (R) of C, which are applied from row 3, columns 2 and 1, respectively. The PROM 142 compares C with the two pixel signals to the left (L) of C, which are applied from row 3, columns 4 and 5, respectively. The PROM 143 compares C with the two pixel signals below (B) C, which are applied from column 3, rows 2 and 1, respectively. Finally, the PROM 144 compares C with the two pixel signals above (A) C, which are applied from column 3, rows 4 and 5, respectively.
Also applied to each of the PROMs 141-144 is an E13B line. When OCR fonts are being optically scanned in FIG. 1, the E13B line is in a low or 0 state. When an E13B font is being optically scanned, the E13B line is in a high or 1 state.
To perform the above stated comparison of C with the associated two Ax and Ay pixel signals beside C on a given side, each of the PROMs 141-144 uses the binary state of the E13B line, the 3-bit C signal and the 3-bit associated Ax and Ay signals as a 10-bit address. In response to its associated 10-bit address, each of the PROMs 141-144 will output a 4-bit hexadecimal code representing 1 of 10 possible conditions. TABLE 2 illustrates the OCR data comparison algorithm that is contained in each of the PROMs 141-144. TABLE 2 shows 10 output PROM codes, the 10 possible conditions that produce those 10 codes, when the 10 conditions occur and an explanation of the conditions.
FIGS. 8A-8K illustrate the various conditions of TABLE 2 that can be found in the preselected C, Ax and Ay locations shown in FIG. 7.
In addition to TABLE 2, TABLE 2A shows a comprehensive list of various E13B, C, Ax and Ay inputs which form hexadecimal addresses to produce associated PROM code outputs for the data comparison PROMs 141-144 during an OCR reading operation.
A different algorithm is stored in each of the data comparison PROMs 141-144 for the optical reading of E13B (MICR or magnetic ink character recognition font). E13B is not a constant strokewidth font. E13B has such a high PCS (print contrast signal) that the lower threshold level pixel signals from the A/D converter 49 and pixel data selector 53 (FIG. 5) can be ignored to make the PROMs 141-144 blind to the majority of borders, pen strokes and scenic backgrounds that often occur on such documents as checks. TABLE 3 shows the algorithm stored in the PROMs 141-144 for reading E13B. This E13B data comparison algorithm is made available to read E13B font when the E13B line to each of the PROMs 141-144 goes high or to a 1 state. TABLE 3 shows only 5 output PROM codes, the 5 possible conditions that produce those 5 codes, when the 5 conditions occur and an explanation of the conditions. TABLE 3A provides a comprehensive list of various E13B, C, Ax and Ay inputs which form hexadecimal addresses to produce associated PROM code outputs for the data comparison PROMs 141-144 during an E13B reading operation.
The second level of PROMs comprises vertical (V) axis decision PROM 146 and horizontal (H) axis decision PROM 145. These PROMs 145 and 146 are similar in structure and operation and store the same axis decision algorithm in 256 four-bit wide memory locations. Axis decision PROM 145 compares the two 4-bit input codes from data comparison PROMs 141 and 142 by using those codes as an 8-bit input hexadecimal address. In response to this address, the PROM 145 outputs a 4-bit code related to a horizontal axis decision. Similarly, axis decision PROM 146 compares the two 4-bit input codes from data comparison PROMs 143 and 144 by using those codes as an 8-bit input hexadecimal address. In response to this address the PROM 146 outputs a 4-bit code related to a vertical axis decision.
The axis decision algorithm stored in each of the PROMs 145 and 146 is shown in TABLE 4. In response to the input codes each of the PROMs 145 and 146 outputs an associated one of the indicated 12 output codes shown in TABLE 4. Note that in TABLE 4 there are no input codes shown for 7, 9 and B. Input codes 7, 9 and B are "don't care" codes which are not programmed in the PROMs 145 and 146. TABLE 5 shows the 12 conditions which cause the axis decision PROMs 145 and 146 to produce the 12 output codes.
The 4-bit input codes from the axis decision PROMs 145 and 146 are then compared in a black/white (B/W) decision PROM 147. The PROM 147, which has 256 by 4-bit memory locations, makes the final decision on whether to turn the center pixel signal C black or white as a function of the 8-bit input address formed from the two 4-bit input codes. The black/white decision algorithm stored in the PROM 147 is shown in TABLE 6. Note that in TABLE 6 there are no input codes shown for 9, C, D and E. These codes are "don't care" codes which are not programmed in the PROM 147.
Flip-flop 149 latches the black or white data from the B/W decision PROM 147. The SHIFT pulse is inverted by an inverter 151 so that data is latched into the flip-flop 149 at the time of the falling edge of a SHIFT pulse. This assures that the black or white data is stable before it is latched. The black data in flip-flop 149 is then sent to finder logic circuitry (not shown) for further data processing.
The invention thus provides a system and method for enhancing multi-level two-dimensional digital data. In a preferred embodiment each signal pulse in successive scans of signal pulses, representative of a scanned character image, is quantized into a multi-bit coded signal having an associated one of a plurality of levels of quantization. Scans of multi-bit coded signals are stored in shift registers to form a preselected configuration of coded signals, including a center signal. Each center signal is selectively compared in a first group of PROMs with each of a plurality of subregions of multi-bit coded signals in the preselected configuration to develop a plurality of comparison codes. The comparison codes are selectively compared in a second group of PROMs to develop horizontal and vertical axis codes. The horizontal and vertical axis codes are then compared in a final PROM to determine whether the multi-bit coded center signal should be turned black or white.
While the salient features of the invention have been illustrated and described, it should be readily apparent to those skilled in the art that many changes and modifications can be made in the system and method of the invention presented without departing from the spirit and true scope of the invention. Accordingly, the present invention should be considered as encompassing all such changes and modifications of the invention that fall within the broad scope of the invention as defined by the appended claims.