APPARATUS AND METHODS FOR IMAGE SCANNING OF VARIABLE SIZED DOCUMENTS HAVING VARIABLE ORIENTATIONS

Abstract: An apparatus and method for image scanning of variable sized documents having variable orientations are disclosed. A bit map image of a document is aligned based on a rotational indicator from a data set representative of the bit map image, and a document type is determined based on a document type indicator from the data set. A document can include up to 16 data areas each of which may include mark-sense data (52), image data (54), character data (55), and bar code data (56), depending on the document type. Data is extracted from the aligned bit map image data based on a predefined document mask associated with the document type. The apparatus includes a scanner (100) having a thermal doucment brand head (108) for printing information onto a document, and a host processor (132) coupled to the scanner. The scanner calibrates its photosensor elements (110) by scanning a calibration plaque having a known reflectivity, and determining a calibration intensity value for each element.

Description: APPARATUS AND METHODS FOR IMAGE SCANNING OF VARIABLE SIZED DOCUMENTS HAVING VARIABLE ORIENTATIONS Related Applications This application claims priority from provisional U.S. patent application serial number 60/140,507, filed June 22, 1999, the contents of which are hereby incorporated by reference. Field of the Invention This invention relates to scanning devices. More particularly, the invention relates to a scanner that automatically transports, scans, and transmits mark-sense, character, bar-code, and image data from documents of varying sizes, regardless of their orientation. Background of the Invention Forms for recording handwritten marks for entry of data into a data processing system generally have a plurality of discrete areas arranged in a pattern delineated by background printing on the form. The user indicates a choice by placing a mark in one of a series of areas presented for choice. Each of the areas is typically defined by a box, oval, pair of spaced lines, etc., and the form normally has a field for a number of such choices. Forms of this type are used, for example, to encode a lottery player's choice of numbers for a wager, using a form reader, or scanner, that is in data communication with a host processing system, such as a lottery agent terminal and/or central lottery computer. Upon validation of a player's entry, the lottery agent terminal prints an entry ticket showing the player's entry, along with a serial number or other unique identification. The unique identification can include printed alphanumeric characters, bar code data, optical character recognition (OCR) characters, and or darkened blocks in a geometric pattern representing numeric data. If the player presents a printed ticket as a winning ticket, the lottery agent enters data from the ticket into the terminal for verification by the lottery central computer over the data communication link. These data can be read automatically in the same manner as a handwritten entry form, using an appropriate scanner. In many cases, validation of winning tickets was performed manually, although there were significant accounting and ticket handling burdens for the selling agents and the systems were prone to clerical errors. In addition, there were potential problems with illegal activities including cashing of altered tickets, theft of paid tickets from the selling establishments, the cashing of stolen tickets, etc. Accordingly, computerized cashing apparatus was developed so that tickets could be validated by a central computer. In this scheme, each ticket selling establishment has a remote computer terminal connected to the central computer. In addition to the regular information described above, a computer-readable code was printed on the lottery tickets, which code identified each ticket uniquely to the computer. Usually, this code was in a mark- sense format, and scanners with discrete sensor locations were contained within the remote terminal and used to read the mark-sense code. The information in the code was then forwarded to the central computer for validation. The scanners used in these systems typically scan the tickets and forward the raw data to the host computer. Usually mark-sense data is sent, although signature, character, or bar-code data might be sent in more advanced systems. The host computer then processes the raw data, and presents the information in a readable format to the user via the host terminal. Scanning systems such as those described above typically require that the user insert the ticket or other document to be scanned into the scanner in a "proper" orientation. In this way, the scanning system can locate certain data on the document that has been received to identify the document type, and to extract meaningful data therefrom. Form scanning would be less time consuming and less distracting to the user, however, if the user did not have to "properly" orient the form prior to insertion. Consequently, it would be advantageous to such users if a scanning system were provided that allowed the user to insert the document into the scanning system in any orientation. Thus, there is a need in the art for an optical scanning system that accurately processes documents that include combinations of mark-sense data, image data, character (OCR) data, and bar-code (BCR) data, regardless of the orientation of the document as it is inserted into the scanner, and regardless of the multiplicity and location of the combinations of mark-sense, image, OCR, and BCR data fields on the form. Summary of the Invention The present invention satisfies these needs in the art by providing apparatus and methods for image scanning of variable sized documents having variable orientations. A method for processing a scanned image of a document includes receiving a data set representative of a bit map image of a scanned document. Preferably, the bit map image is produced by a scanner. First, the bit map image is aligned based on a rotational indicator obtained from the data set. Aligning the bit map image can include determining a location of the rotational indicator on the document, and defining an origin on the document based on the location of the alignment indicator. Similarly, a document type can be determined based on a document type indicator obtained from the data set. A document can include up to 16 data areas, each of which includes mark- sense data, image data, character data, and bar code data, depending on the document type. Data is extracted from the aligned bit map image based on a predefined document mask associated with the document type. Apparatus for scanning a document includes a scanner and a host processor coupled to the scanner. The scanner receives a document having at least one data area, scans the document to generate a bit map image of the document, and forwards a data set representative of the bit map image of the document to the host processor. The host processor receives the data set, aligns the bit map image based on a rotational indicator obtained from the data set, determines a document type based on a document type indicator obtained from the data set, and processes the data area based on the document type. A slip editor can be provided to allow a user to generate a document mask that defines a slip to be scanned. The scanner can include a photosensor array having a plurality of light sensitive elements, and can be calibrated by the following method. First, a calibration plaque having a known reflectivity is scanned, and a calibration intensity value for each light sensitive element is determined. The calibration intensity value represents the intensity of light received by the light sensitive element while the calibration plaque is being scanned. A sensitivity threshold is then defined for each light sensitive element to have a value based on the calibration intensity value determined for the light sensitive element. The scanner can also include a thermal document brand head that is connected to the host processor. The host processor can then download print information, such as bitmap data, to the thermal brand head for printing onto a document in the scanner. Brief Description of the Drawings The foregoing summary, as well as the following detailed description of the preferred embodiments, is better understood when read in conjunction with the appended drawings. For the purpose of illustrating the invention, there is shown in the drawings an embodiment that is presently preferred, it being understood, however, that the invention is not limited to the specific methods and instrumentalities disclosed. Figure 1 is an isometric view of a preferred embodiment of a scanner according to the present invention. Figures 2A and 2B are side views of the scanner of Figure 1 in open and closed positions, respectively. Figures 3A and 3B are isometric and cross-sectional views, respectively, of a preferred embodiment of a contact-sensor module for use with a scanner according to the present invention. Figure 4 is a block diagram of a system for calibration and image scanning according to the present invention. Figures 5 depicts a typical selection slip that can be used with a scanner according to the present invention. Figures 6, 7, and 8 depict documents that can be identified via a document identification system according to the present invention Figures 9A-9D depict variable size documents having image areas that can be scanned using the apparatus and methods of to the present invention. Detailed Description of Preferred Embodiments GENERAL DESCRIPTION Figure 1 is an isometric view of a preferred embodiment of a scanner 100 according to the present invention, while Figures 2 A and 2B are side views of the scanner of Figure 1 in open and closed positions, respectively. A scanner 100 according to the present invention transports and scans variable sized documents at any orientation, and transmits mark-sense, character, bar-code, and image data extracted from the document to a host processor that interfaces with the scanner. According to the invention, scanner 100 scans documents 50 to capture signatures and other images at high scan rates (e.g., 200 dots per inch (dpi) for higher resolution, or 100 dpi for quicker transactions, under user command). OMR-type slips, for example, can be scanned for mark-sense data at 100 dpi, while signatures, for example, can be scanned at 200 dpi for greater resolution. Preferably, scanner 100 is micro-controlled, and operates in conjunction with predefined data masks such that all pertinent data fields can be scanned rapidly. The data masks can be downloaded from the host processor via a highspeed parallel interface to minimize data transmission time. Preferably, the host processor is a personal computer (PC), having a microprocessor (such as a Pentium), on which a user application program and scanner operating software are loaded and can be executed. In a preferred embodiment, scanner 100 is modular and designed to fit as an OEM subassembly into a variety of terminal enclosures. Scanner 100 can be equipped with a hinged, spring-loaded top plate 102 to facilitate cleaning and paper jam removal. Scanner 100 can transport and scan documents ranging from A4 or letter-size (i.e., 8.5 x 11 inches), down to documents measuring 3.25 inches wide x 3.25 inches long. Although scanner 100 can utilize an edge-guiding input throat 104 to minimize document skew for narrower forms (such as for 3.25 inch forms, for example), such a throat is unnecessary in a scanner according to the invention since smaller forms can be fed in any orientation. Scanner 100 also includes a feed-through type document transport mechanism 106 with an auto-pick feature. Auto-pick allows a document to be transported and scanned automatically whenever a form is presented at the input. "Pick-on-Command" is basically a lock-out feature that prevents the scanner from accepting a form, except when specifically commanded from the host (e.g. , when busy, or when a proper ED or entry code is required to enter documents into the system). Scanner 100 is equipped with a local controller (i. e. , micro-controller (MCU)) board 112. Controller board 112 is mounted in base 101 of scanner 100, and is electrically connected to scan head 110, preferably via a ribbon cable. In a preferred embodiment, scan head 110, which is described in greater detail below, is a linear photodiode sensor array that utilizes 1728 pixels at 200 dpi. Scanning is done reflectively, with an array of LEDs that provide document illumination at a wavelength of 660 nanometers (nm). Preferably, scan head 110 is insensitive to external lighting and EMI interference. In a preferred embodiment, controller board 112 includes a local controller, such as an 80C196, 16-bit processor system that digitizes the output of scan head 110, for transmission to the host processor. Controller board 112 includes the connectors and driver circuitry for the required interface into the host processor. This includes the flow of information (both incoming commands and outgoing data) over the high-speed, bi-directional parallel port. In addition, the local controller also handles document transport and thermal branding of forms (bet slips and receipts) under command of the host processor. These functions are described in greater detail below. Documents are transported through scanner 100 via a belt-driven roller system 106, powered by a step motor 107 that can be attached to a pulley 105. Step motor 107 can transport a document with 0.005 inch step increments at 10 inches per second. Thus, images of documents are captured at 200 dpi, both across and along the document, since the scan module sensors are also mounted on 0.005 inch centers. Scanner 100 can scan standard selection slips with or without clock marks. In a preferred embodiment, the transport speed while scanning is approximately 10 ips at 100 dpi, or 6.5 ips at 200 dpi. Its non-scanning (i.e., slew) transport speed is also approximately 10 ips. The typical transport time for an 8" long selection slip is, therefore, about 0.8 seconds at 100 dpi. Similarly, the transport time for an 11" long page is about 1.1 seconds at 100 dpi. Scanner 100 also preferably includes front document sensors 109 and rear document sensors (not shown) to determine document position. Front document sensors 109 are reflective sensors that sense a form being inserted into the scanner throat. Similarly, the rear document sensors sense a form leaving the scanner. When front sensors 109 detect the insertion of a document into the mechanism's paper inlet, the control processor turns on the step motor to transport the document through the scanner. The control processor also turns on the scan head's light source, and commences line scanning of the form when it reaches the scan line. Documents are scanned at 100 or 200 dpi, based on user command, and image data is transmitted via the high-speed parallel port to the host processor. Processing of the data to extract mark-sense and image data relative to stored data masks takes place in the host processor. At the conclusion of scanning, the back edge of the form is sensed by the rear paper sensors and scanning ceases. Forms are then normally exited out of the rear of the mechanism, and the light source is turned off. Scanner 100 can also include an optional thermal document brand head 108 that can be used to print (i.e., brand) information on forms. The host downloads print information via the high-speed parallel port. Preferably, information for brand head 108 is controlled by scanner operating software in the host processor, while printing is controlled by the local controller. Preferably, brand head 108 is located at the rear of the scanner mechanism. A solenoid actuator lowers the brand head into contact with the form during printing. For the branding operation, all information from the host is passed to the scanner operating software as bitmap data. Preferably, all text and images are formatted by the user application software and passed to the scanner operating software. The image is set up as a row/column structure, where a row is defined as one print line having 64 dots, and the columns are defined as the number of rows that make up the print area. The brander image file is a standard "WINDOWS" .bmp file. The format of such a file includes a "File Header," followed by a "Bitmap Header," a "Color Palette," and the image data to be branded. Once the data is passed to the scanner operating software in the PC, it can be reformatted and sent to the scanner mechanism for branding on the document. The bitmap image data includes a plurality of 64 bit (8 byte) rows, by a plurality of X columns. In other words, each print line is a row, and a number, X, rows make up the entire printed image. The most significant bit (MSB) of the first byte of each row is the leftmost dot on the print head, and the least significant bit (LSB) of the eighth byte is the rightmost dot on the print head. If a print dot is to be turned on, then the appropriate bit is set to a value of 1 ; otherwise, the bit is cleared to a value of 0. The number of columns, which represents the maximum print area at the end of the document, can be limited based on the scan density (e.g., 125 columns for 100 dpi; 250 columns for 200 dpi). SCAN HEAD Preferably, scanner 100 includes a commercially available contact-sensor module as its scan head. Figures 3 A and 3B are isometric and cross-sectional views, respectively, of a preferred embodiment of a contact-sensor module 120 for use with scanner 100. Contact sensor module 120 includes a photodiode linear array 122, illuminated by a solid state LED light source 124. It also contains a gradient-index focusing lens 126 that focuses the image from the surface of a document 50 onto the photosensors of linear array 122. The focus point of gradient index lens 126 is located at the surface of array cover glass 128, such that a line image of the surface of document 50 on cover glass 128 is focused onto photosensor array 122. Light source 124 (located within contact sensor module 120, to a side of photosensor array 122) illuminates document 50, and eliminates any shadow effects of document folds and creases (which can be misinterpreted as data marks). A more detailed description of apparatus and methods for eliminating shadow effects is provided in co-pending U.S. patent application serial number 09/300,989, the contents of which are hereby incorporated by reference. The scan head components are housed in a housing 130, which can be a rectangular channel that is mounted across the width of the paper path of the mechanism. Housing 130 contains photosensor array 122, which, preferably, has 60 LED chips mounted in a linear array, and gradient index lens 126, which extends the length of the paper width that focuses the line image onto each of 1728 photosensors mounted in a straight line on 0.005 inch centers. CALIBRATION Preferably, scanner 100 uses a microprocessor adjustable threshold whereby it automatically determines the black/white (mark/space) switching level for the pixels of photosensor array 122. The threshold level for each pixel is adjusted by the local controller, over the length of the array in 0.00492 inch (8 dots per mm) increments. In this manner, the local controller adjusts the switching threshold for the entire array to compensate for non- uniformity of illumination, as well as for any local variations in array sensitivity. This procedure is accomplished through a calibration process that is performed to compensate both for non-uniformity of illumination, as well as for any local variations in photosensor sensitivity. During calibration, a standard color plaque (preferably, PDI Part No. 194-6891-1) is used to set the threshold values of all pixels. The calibration plaque has a specific reflective characteristic at pre-determined light wavelengths. The preferred calibration plaque has been selected for its reflective characteristics, and it should be understood that substitution of a different plaque, or one with a different color or reflectivity, can change the sensitivity of the reader in an undesirable or unpredictable manner. Once the unit is calibrated, the threshold switching values for each pixel are stored in nonvolatile (e.g., flash) memory for use in subsequent document scanning. To initiate scanner calibration, the host processor sends a calibration command to the scanner. On receipt of the calibration command, the scanner waits for a calibration document to be inserted into the paper inlet (throat). When a calibration document is inserted and covers the front sensors, the scanner delays for 1.5 seconds to allow the document to seat against the transport rollers. The document is then transported beneath the scan line. The scanner scans the calibration document, and then advances the document approximately 1/3 inch. The scanner scans and advances the calibration document a total of three times. Calibration calculations are performed on the three scans, to average the switching level for each pixel (based on the reflectivity of the calibration document). When completed, the document is ejected out the back of the scanner. If calibration is "good," a "#10" byte is returned to the user application program, and the new calibration values are saved for subsequent scans. If the calibration fails, then an error code is returned. Additional details of the calibration process are provided in co-pending U.S. patent application serial number 09/300,989. Figure 4 is a block diagram of a system for calibration and image scanning according to the present invention. Controller 131 receives and decodes all commands from host processor 132 through a parallel port 134. Preferably, parallel port 134 is a high-speed, parallel, bidirectional ECP printer port. A preferred embodiment of host processor 132 is a personal computer (PC) that utilizes a Windows Operating System with a scanner command module (e.g., Pentium processor) running at 133 MHz minimum clock rate, and includes at least 16 MB of random access memory (RAM), and an ECP bi-directional parallel port. The scanner command module receives commands from the user application program. These commands are described in Appendix A. Preferably, scanner 100 interfaces with host processor 132 through two interface connectors which are defined as follows: Jl, the main data transfer interface, is a high-speed, parallel, bidirectional interface, and J5 is the power input connector from the PC to the scanner module. The pin connections for a preferred embodiment are provided in Appendix B. The thermal print head and the motor are driven directly by the scanner module under command from the host. A decoded calibration command, when received from host processor 132, is relayed to scan control logic 136, which handles the calibration procedure. Scan control logic 136 places scanner 100 in a mode to process raw image data directly from A/D converter 138. Each 8-bit digital data byte (per pixel, from A/D converter 138) represents the output of that pixel for the reflectivity of the calibration plaque, which, in turn, represents the black/white switching point (i.e., the gray switching level) of that pixel. This 8-bit pixel data is passed through a multiplexer 140 and FIFO 142 onto a data bus 144, to threshold memory 146, for storage. The process is repeated for three line scans of the calibration plaque. Controller 131 then averages the three scans (for each pixel) to determine an average switching threshold for that pixel. This value is stored in threshold memory 146 to be made available for bitonal (i.e., black/white) image scanning of subsequent documents. It should be understood that scanner sensitivity can be adjusted by using alternative calibration plaques that can be printed with inks having different reflectance percentages. In addition, controller 131 can also affect scanner sensitivity by virtue of the way it combines multiple pixels into data bits. In combining two pixels into a single bit, controller 131 can specify that both pixels must be dark to consider the output bit dark, or that the resultant bit be dark if only one of the two pixels is dark. Both the pixel size and memory requirements are affected using this technique. In addition, this combinational method also affects the scanner threshold. Scanning a mark with the requirement that both contiguous pixels exceed the dark threshold requires a somewhat darker mark than determining that only 1 of the 2 pixels exceeds the threshold. Controller 131, therefore, affects the sensitivity of scanner 100 by biasing scanner 100 in favor of either faint or bold marks. SCANNING DOCUMENTS As described above, threshold values (black/white switching values) for each pixel are stored in threshold memory 146 on local controller board 112. Local controller (CPU) 130 can reference these values, even after scanner 100 has been turned on after a period of non-use. After a calibration procedure, subsequent documents are scanned for black/white pixel content using the stored threshold switching values as reference. Document scanning can be understood by referring to the block diagram of Figure 4. As a document to be scanned is transported beneath scan head 110, light incident on its surface is absorbed by dark marks and reflected by the lighter spaces between marks. Photosensor array 122 includes 1728 light sensitive elements, or pixels, arrayed in a line. Each pixel is focused onto an adjacent 0.005" area of the document's surface (200 dpi). All 1728 pixels of the array (across the 8V_ inch scan width) are scanned for each sample (0.005 inch movement) of the document. These light amplitude samples, representing a "picture slice" of the document, are sequentially clocked (at 2 MHZ) through A/D converter 138. The A/D output produces an 8-bit byte per pixel. Each byte defines the signal amplitude of the pixel, representing the reflectivity of the document at that focused pixel area. The output of A/D converter 138 is coupled to an 8-bit comparator 148, which compares this pixel value against the corresponding 8-bit pixel threshold value stored in threshold memory 146. The output of comparator 148 is a single black/white bit (per pixel). The black/white bit has a value based on whether the scanned value is below or above the stored threshold value (e.g., the bit value is set to 1 if the scanned value exceeds the stored threshold value). The resulting comparator bits are grouped into 8-bit bytes in a shift register 150, and then fed through FIFO 142 onto data bus 144. Controller 131 then formats the data, in accordance with predefined protocol requirements described in Appendix C, and transmits the formatted data to host processor 132 via hi-speed parallel port 134. A full line scan at 200 dpi (1728 bits per line scan) occupies 216 bytes of memory. Therefore, an 11 inch long document can produce more than 3.8 million pixel samples (bits). Typically, to process and send this amount of data (even at high transmission rates) takes several seconds. For more rapid data processing, and for requirements permitting lower resolution, scanner 100 can combine multiple pixels into single black/white decisions or bits. The number of pixels/bit can be set by host command, and depends on whether mark- sense or signature data is required. For mark-sense data, scanner 100 preferably combines 2 or 4 pixels into a single black/white bit, yielding resolutions of 0.010 or 0.020 inches. For image scanning (signature capture), scanner 100 preferably uses 1 or 2 pixels per bit (0.005" resolution at 200 dpi, or 0.010" resolution at 100 dpi) for greater detail. The resolution can be set by external command at 200, 100, or 50 dpi. Image capture at reduced resolutions occupies commensurately less memory, and requires less data transmission time. Scanner 100 can also utilize image compression algorithms, to further reduce transmission time. DATA PROCESSING Data transmitted from scanner 100 to host processor 132 is configured as a bitmap image, under predefined system protocol. All data processing is done in host processor 132 through specific software function calls, which, as part of the scanner software package, can be loaded into and resident in host processor 132 as scanner operating software. Preferably, host processor 132 operates in a "WINDOWS" environment. The scanner operating software, resident in host 132, comprises a library of functions, known as a dynamic link library (DLL). The DLL is available to the user application, and handles both communication and data processing. This software receives several different types of data from the scanner hardware module. It can be plain text messages that deal with the scanner's current status (e.g., dpi selected, calibration status, etc.), or bitmap data. Data processing on host 132 is flexible, and can be easily specified using a separate program that is compatible with scanner 100. This program generates an .sdf file (i. e. , a file in "simple document format") that includes all of the parameters and masks needed to scan a particular form. Preferably, each .sdf file can include up to 64 form definitions, and each form has a unique ID in the .sdf file. That LD is then printed on the form to process itself. The parameters of a form in the .sdf file can include its dimensions (e.g., length, width), the number of areas to decode (e.g., up to 16), and the type and location of each area on the form (e.g., image area, mark-sense area, no clock area, bar-code area). The parameters of this .sdf file are available to the scanner's data processing software, residing in host processor 132, to decode each form in a unique way. IMAGE/SIGNATURE SCANNING Scanner 100 scans each form presented as either a 100 or 200 dpi image (determined by host command). The data are then transmitted via parallel port 134 to host processor 132 as a compressed bitmap image at the commanded density. If a particular area of the document has been identified as an image area, then the data is retained as an image, to be made available to the applications software in host processor 132 via a function call. The applications software can then present the image to the user via a human-machine interface (HMI). If the area has been identified as an alternative data area (mark-sense, BCR, or OCR), the image data is decoded by the scanner software in host processor 132, and the decoded data is made available to the applications software for presentation to the user. MARK-SENSE DATA SCANNING Mark-sense forms are used extensively for selection slips in lottery applications, for test scoring, voting, and menu selection processes. Scanner 100 scans mark- sense documents in the same manner as any other form. That is, a bitmap image of the form (i. e. , a bitonal image at 200 or 100 dpi) is transmitted over parallel port 134 to host processor 132. Scanner operating software in host processor 132 then determines the type of form being read (by utilization of the mark-sense ID code on the form). The software then determines the number and type of the various data areas on the form, by matching the ID code to a previously generated .sdf parameter file located in memory in host processor 132. The parameter file identifies the size and location of data areas on the form, as well as specifics of these data areas (such as data box grid, box size, spacing, location, etc.). In this manner, the data processing software in host processor 132 can determine the number and location of marks (i. e. , row/column data) in the data field, and present the data to the host application via function calls. The scanner software in host processor 132 also uses a weighting technique to determine the percentage of dark to white pixels contained in a data box. The scanner software determines whether the box is marked based on the percentage of black to white bits contained in the data box. The percentage used in this determination is based on a sensitivity parameter that is set in the .sdf file. As a result, the scanner can make use of algorithms to weight dark pixels in the center of the box more heavily than dark pixels on the box's periphery, and to weight contiguous dark pixels more heavily than isolated ones (i.e., noise). At the conclusion of scanning a ticket for valid data, the scanner's decoding software "knows" the location of all marked data boxes on the form. The row and column locations of the marked data boxes are then made available through function calls to host processor 132. In addition, scanner 100 has the image of the mark in memory, such that lookup tables can be used to differentiate between different kinds of marks (X vs. O, Y vs. N, + vs. -, etc.). Preferably, scanner 100 defaults to reading selection slips (/. e. , bet tickets and receipt coupons) with timing marks (see Figure 5). In this mode, scanner 100 reports data for only marked data boxes. Scanner 100 specifies the number of data locations marked, transmitting two bytes for each marked box. These bytes define the row/column coordinates in which the data mark was detected. BCR AND OCR SCANNING The scanner software, which resides in host processor 132, also incorporates libraries for both bar code recognition (BCR) and optical character recognition (OCR) applications. These library software functions are called by the scanner software whenever the ID document identifies an area that includes pre-specified bar-code or printed character data. All major types of 1 -D bar-codes are decoded, as well as PDF417 (2-D). Scanner 100 can also decode various OCR fonts. This includes various machine-print fonts, as well as OCR-A, OCR-B, and MICR (E13B). The scanner software will search the bitmap image for the specified areas, decode the bar-code data, or the OCR font, convert the data to its equivalent ASCII string, and make the ASCII data available to the host application for presentation to the user. DESKEWTNG AND IMAGE ROTATION Scanner 100 can transport and scan documents of various sizes. This includes documents as small as 3.25 inches x 3.25 inches, up to full-page (8.50 inches x 11.0 inches, or A4) documents. According to the present invention, the smaller forms can be inserted into the mechanism in any orientation, and at any angle. Based on the standard location of the LD marks, scanner 100, via scanner software that is resident in the host PC, can de-skew and reorient the image of the form, such that it is presented in the proper orientation in the bitmap image (to be presented to the user via the host processor's HMI). Mark-sense (row/column) information can also be properly decoded relative to the reference corner of the mark-sense area. This is also the case for bar-code and OCR data, which is presented as a decoded ASCII string. A method according to the present invention for deskewing an image of a document will now be described. The inventive method has been developed to address several problems resultant from the fact that the bitmap image will not, in general, be perfectly rectangular. For example, a page might be missing any or all of its four comers due to folds; the document itself may not be rectangular in shape; a page might be torn or creased at any point on any edge; dirt in the scanner might generate noise; etc. To deskew the image, it is desirable to determine the location of the top left corner of the page, as well as the orientation of the page. In general, the process includes building an envelope of the image of the document from the bitmap, removing any irregularities that might exist in the envelope, determining the smallest rectangle that will circumscribe the envelope, adjusting the size and position of the rectangle to best fit the original bitmap image, and then determining a skew angle of the document relative to the bitmap. Preferably, the process begins with finding the left and right edges of the page, although it should be understood that the same technique could be used to find the top and bottom of the page. First, an integer variable, pixelsinline, is defined to represent the number of pixels in a single scan line. Preferably, pixelsinline is initialized to a value of 10. For each scan line in the bitmap, the left edge is defined as the first of a sequence of pixelsinline consecutive white pixels, and the right edge is defined as the last pixel of the last sequence of pixelsinline consecutive white pixels. (For purposes of this description, it is assumed that the page is white on a black background.) Thus, this process results in two lists of numbers. For each line number, the left edge and the right edge can range from 0 to the last pixel in the scan line. It should be understood that the either the left edge or the right edge or both could also be invalid (since it is possible that a line will have no left edge, no right edge, or neither). The second step includes reviewing the valid edge points so that only those points defining an envelope of the document are kept. Through the use of triangularization techniques, each point is analyzed to determine whether it is a point on the envelope, or whether it is an "interior" point (i. e. , a point in the interior of the envelope). Interior points are discarded. Thus, this process results in a list of points that define the contour of the page. The third step is to determine the smallest rectangle into which the envelope can be inscribed (this assumes that the document is a rectangle, although it should be understood that the algorithm can be generalized to any shape document). The intersection of this rectangle with the original bitmap is then computed. This results in a rectangle that best fits the document in the original bitmap coordinates (i.e., the final rectangle should not have any edge smaller or larger than the edges of the overall document image). This accounts for irregularities such as, for example, a fold that extends beyond an edge of the document. At this point, it is straightforward to determine the location of the top left corner of the page and to compute the skew angle. A translation and rotation of the bitmap then are performed to orient the document relative to the top left corner of the bitmap. OVERVIEW OF TYPICAL DOCUMENTS Figure 5 shows an exemplary document 50, such as a lottery selection form that can be scanned using the apparatus and methods of the present invention. Document 50 can include a mark sense data field 52, an image data field 54, a character data field 55, and a bar code data field 56. Although document 50 as shown includes one of each type of data field 52, 54, 55, 56, document 50 can include up to 16 such data fields in any combination. Mark sense data field 52 includes a plurality of data boxes 53, typically aligned in row-column format. As shown, mark sense data field 52 has twelve data rows across the width (i.e., the narrow dimension) of document 50, although the standard (i.e., default) selection form has 14 data rows on 5.0 mm (0.197") centers, or 12 data rows on 0.25 inch centers, across the width (i.e., the narrow dimension) of the slip. Typically, 12-row forms have data rows on 6.35 mm (0.25") centers. Mark sense data field 52 also has 25 data columns along the length (i.e., the long dimension) of document 50. Typically, lottery forms have a clock mark 58 associated with each data column. In older lottery readers, these clock marks were used to synchronize and determine the data box limits for each column. In an aspect of the present invention, clock marks are no longer necessary because of the scanner's deskewing and re-orientation capabilities, its use of data masks, and its stepping and scanning accuracy. As these older forms are still in use in some jurisdictions, a scanner according to the invention also preferably accommodates them. Image data field 54 can include an image such as, for example, a signature. Typically, image data field 54 has a long dimension and a narrow dimension, where the long dimension of image data field 54 can be perpendicular to the long dimension of document 50 as shown, or parallel thereto. Character data filed 55 includes printed character data that can be interpreted by well known optical character recognition (OCR) techniques. Bar code data field 56 can include either a one-dimensional bar code symbol as shown, or a two-dimensional bar code symbol, that can be interpreted by well known bar code recognition (BCR) techniques. Either OCR or BCR data fields can have their long dimensions either parallel or perpendicular to the long dimension of the form. A scanner according to the present invention can scan and read standard letter-size (i.e., 8.5" x 11.0") pages interchangeably with A4 (i.e., 210 mm x 297 mm) size pages. The scanner can also scan smaller documents (e.g. , A5 and A6), on down to 3.25" wide slips. Preferably, the scanner scans documents in reflective mode. Thus, to optimize performance, certain paper stocks, printing inks, and dimensional specifications are preferred. For example, it is preferred that all paper stock have a minimum reflectance of 80% as measured using a Moore Model 082 tester, or equivalent thereof, with a barium sulfate plaque as standard for 100% reflectance. Measurements should be taken in the near infra-red region. Preferred paper stock dimensions for selection slips are no less than about 82.55 mm +/- 0.12 mm (3.25" +/- 0.005") in width, and can range from 82.55 mm (3.25") to 228.6 mm (9.0") in length. Full pages documents are preferably no more than 215.9 mm +/- 0.12 mm in width, and no more than 297.0 mm +/- 0.12 mm (11.7" +/- .005") in length. Preferably, all paper stock has a nominal thickness of about 0.114 mm (0.0045"), with a minimum thickness of about 0.100 mm (0.0039"), and a maximum thickness of about 0.200 mm (0.0079"). Preferably, background printing on a form has a print contrast signal (PCS) of less than 0.10, referenced to an unprinted section of the form. PCS is a measure of the difference in reflectance between a mark and the paper on which it is printed. Specifically, PCS = (Rp - Rm) / Rp, where Rp is the paper reflectance, and Rm is the mark reflectance. Preferred PCS values specified herein are obtained using the Moore Model 082 tester equipped with a visible light filter operating in the bandpass range of 600-700 nanometers. A list of preferred background printing colors/inks is provided in Appendix D. The scanner processes selection slips with clock marks as a default. Clock marks can be located at either the right or left edge of the slip (along the slip's length/long dimension). Data marks located either between clocks, or concuπent with clock marks (i.e., on-clock mode) can also be processed. Clock marks can be printed using black, green, or blue inks. Preferably, clock marks should provide a PCS value of greater than 0.65, have sharp edges, be of uniform intensity, and be free of ink smudges and specks in areas between clock marks. In overprinting clock mark patterns (i.e., black clock marks coupled with red data boxes), the lengthwise registration of the clock mark pattern should be maintained within +/- 0.00791 (0.2 mm) relative to the data box position. As the data box areas of the form are preferably scanned using red light, data box outlines should be printed with background (i.e., reflective) ink. Data box outlines and corresponding background numbers are used to indicate the placement of hand marked data. Standard (i.e., default) data box dimensions are given in Appendix E. Hand marking can be done with any medium that is sufficiently dark and non- reflective (using red light). Marks should be clear, legible, and exhibit a minimum PCS of 0.65. It should be understood that a standard #2 pencil gives reflectance readings of about 3% (i.e., PCS > 0.90), and is ideal for marking forms because of both availability and ease with which mistakes can be corrected. Most blue, black, and green ball point pens and markers also meet necessary reflectance requirements and can be used to mark the tickets. A list of pens and pencils, which are preferred for use in marking tickets, is found in Appendix F, and is useful to indicate the scope of writing instruments which may be used. When marking tickets, it is unnecessary to scrub over a mark, to make it appear big and dark. The clarity and positioning of the mark is more important than the apparent intensity. For example, if a mark is placed outside a marking area, it should be completely erased and placed in the proper location, rather than widening the mark until it extends into the proper area. The scanner uses high resolution image optics so that marks can be made in a variety of shapes and sizes, provided that the lines do not extend between data boxes, exhibit a PCS value of greater than 0.65, and have a stroke width greater than 0.012" (0.305mm). A single stroke, for example, can be positioned anywhere within the data box, with an axis parallel to the long axis of the data box. Dots, circles, or X's can be positioned anywhere within the data box. Mark sensitivity can be set in a parameter file as the diameter of the smallest circle to be read by the scanner. This sensitivity can be made to comply with certain rules for mark sizes. For example, a single stroke can be required to have a length greater than 2/3 the length of the box, with its axis parallel to the long axis of data box, or a length greater than 2/3 the diagonal length of the box, with its axis diagonal across selection box. A filled circle (or dot) can be required to have an area greater than 1/4 of the selection box area, while a hollow circle can be made to have a diameter greater than 3/4 of the selection box width for example. It can be required that the selection box be fully shaded. An 'X' can be permitted, for example, with each arm of the 'X' being no greater than the diagonal length of the selection box and aligned towards the box comers. Preferably, the scanner also processes pre-printed forms printed with ink or by thermal methods. Pre-printed forms should have data marks which adhere to the same reflectance, PCS, dimensional, and spacing requirements as selection slips. Pre-printed forms (e.g., receipts) must be aligned on the same row-centers as selection slips. According to one aspect of the invention, control software residing in a host processor that interfaces with the scanner can be customized to handle unique forms and requirements. DOCUMENT IDENTIFICATION SYSTEM Figure 6 provides a reference for the following description of a document identification system according to the present invention. This concept creates a unique mark, called the ID clock/rotation indicator 62. ID clock/rotation indicator 62 is used both for determining the orientation at which a document is scanned into the reader, and also as the clock mark for LD marks 58. The minimum size document that can be scanned (i.e., 3.25 inches by 3.25 inches) is based on the necessary size of ED marks 58 and ED clock 62. A first purpose of ED clock/rotation indicator 62 is to define the lower right- hand corner of document 50. Indicator 62 is used to determine the orientation of document 50 as it is fed into scanner 100. Once the orientation is determined, the document image is de- skewed and rotated so the (0,0) coordinate, or origin, is positioned as shown in Figure 6. The origin is, by definition, the upper left-hand comer of document 50 as it is fed into scanner 100. Preferably, rotation indicator 62 is the only mark in the comer of document 50. This area is outlined around rotation indicator 62 in the lower right comer of the documents shown in Figure 6. To facilitate the scanner's identification of rotation indicator 62, it is preferred that all other corners of document 50 be blank. These areas are also outlined in Figure 6. Another use of ED clock/rotation indicator 62 is to decode the document ID, defined by ID marks 58, 10 of which are pictured in Figure 6. Preferably, ID marks 58 are on the same centerline as ID clock 62, and conform to specifications for 5mm mark sense data. As shown in Figure 6, ID marks 58 represent a 10-bit binary code, with the mark closest to ID clock 62 being the least significant bit 58L. The most significant bit 58M (i.e., the mark farthest from the ID clock) is always set. That most significant bit 58M is set indicates that document 50 has an ID code associated with it. If there are no ID marks 58 on document 50, or if there is no ID clock/rotation indicator 62, then document 50 is considered to have an ED code of zero. With an ID code of zero, the scanner reverts to the default document parameters. This results in a total of 511 unique document ID codes, starting with 200H (512) and ending with 3FFH (1023). The document ED is used to locate the document parameters in a file created for decoding mark-sense and image data on the document. Preferably, two files are used for this purpose. The first file includes the name and location of the parameter file to be used to decode the data areas on the document. The second file includes certain parameters that define and describe the document (e.g., length, width, etc.). A full description of file parameters is provided in Appendix G. After all of the areas on the document are decoded and/or imaged the information will be passed on to the user application program via a predefined message structure. Mark-sense data, for example, is reported in row and column format. Additional message information can include, for example, the type of ticket data, the document ID (which will be sent before any document data), and the "area number" (which defines a particular area to which the data corresponds). For each document processed, the following typical message is returned: <Type of Data>/<Document ID LSB>/<Document ID MSB>/<Area Number>/<Optional byte(s) for number of columns>/<Optional byte(s) for number of rows>/<Data for Area 1 > <Type of Data>/<Document ID LSB>/<Document ID MSB>/<Area Number>/< ptional byte(s) for number of columns>/<Oρtional byte(s) for number of rows>/<Data for Area 2> where: <Type of Data> = 'T' for Ticket, 'R' for Receipt (Row/Col data), 'S' for Image, 'B' for Bar Code, "O" for OCR, T for Invalid, or 'U' for decoded receipt (ASCII string); -Optional byte(s) for number of columns/rows> = 2 bytes if <Type of Data> = 'T' or 'R'; <Data for Area n> = starts with <Number of results LSB>/<Number of results MSB>, if <Type of Data>= * T' or 'R'; <Data for Area n> = starts with line length (2 bytes), number of lines (2 bytes), if <Type of Data> = 'S'; and <Data for Area n> = starts with <textlength LSB>/<textlength MSB>, if <Type of Data> = 'O' or 'B\ It is preferred that documents to be scanned conform to the above parameters. In the event that a nonconforming document is scanned, the document ID and area number parameters in the message will be sent as zeros. If no ID/Rotation mark is found, the reader will use an ID value of 0, and use any parameters that have been stored in the parameter file for ID = 0. The user, therefore, will readily be able to define a default document format. In the event that the parameter file is missing, the reader can use hard-coded default parameters. One type of area on a variable size document using a document identification system according to the present invention is a mark-sense area, which does not use clock marks (also called timing marks) (see Figure 9A). Clock marks are normally used to define the data rows and columns on a document. With no clock marks, there are a number of parameters, which must be defined in order to locate and decode the mark sense boxes in these areas. Individual areas can have different grid and data box parameters, as long as the grid remains the same within any one area. With reference to Figure 7, the coordinates (XI , Y 1 ) and (X2, Y2) define the total "mark-sense area," which is shown by a grid area. A plurality of data boxes are contained in the mark sense area and, preferably, are on the defined grid. The minimum size of this mark-sense area would be a single mark-sense box of minimum size. The maximum size could be the entire document minus the blank comer areas and the ID area discussed above with reference to Figure 6. The mark-sense grid defines the placement of data boxes within the mark- sense area. All the boxes within a single mark-sense area should be on the same grid and be of the same size. The following are the descriptions of the grid parameters: 'a' value = blank area (not visible to scanner). This is the space from the edge of the outside data boxes to the boundary of the mark-sense area. This dimension also indicates the location of the data boxes positioned in the four comers of the mark-sense area. The minimum value for this parameter is 0.2 in. (5.08mm). 'x' value = horizontal data box grid center lines. The data boxes are centered on this spacing throughout the mark-sense area. The minimum value for this parameter is 0.197 in. (5.00mm). 'y' value = vertical data box grid center lines. The data boxes are centered on this spacing throughout the mark-sense area. The minimum value for this parameter is 0. 197 in. (5.00mm). The data boxes, in the mark-sense area are the only locations where hand marked or preprinted marks should be made. Marks made too far outside of a box boundary may be interpreted as an incorrect mark location. 'Bx' value = horizontal data box dimension. All data boxes in the mark-sense area have a width defined by this value. The minimum value for this parameter is 0.0985 in. (2.50mm). 'By' value = vertical data box dimension. All data boxes in the mark-sense area have a height defined by this value. The minimum value for this parameter is 0.0985 in. (2.50mm). 'b' value = horizontal blank space between data boxes dimension. All data boxes in the mark-sense area must be separated by this minimum value. The minimum value for this parameter is 0.0985 in. (2.50mm). 'c' value = vertical blank space between data boxes dimension. All data boxes in the mark-sense area must be separated by this minimum value. The minimum value for this parameter is 0.0985 in. (2.50mm). 'Fx', and 'Fy' values = Location of the center of the data box closest to coordinate (0,0) of the document. This is also the intersection of the first horizontal and vertical grid lines in the mark-sense area. Figure 8 shows an example of a 5 inch by 7 inch document having one mark- sense area without clock marks defined as follows: XI = 1.5 inches; X2 = 3.5 inches; Yl = 2.0 inches; Y2 = 4.0 inches; x = 0.4375 inch; y = 0.275 inch; Bx = 0. 1875 inch; By= 0.125 inch; Fx= 1.844 inches; Fy= 2.31 inches a = 0.25 inch; b= 0.25 inch; c= 0.15 inch A second type of mark-sense area on a variable size document using a document identification system according to the present invention does use clocks. The clock marks are normally used to define the columns, consisting of data rows, on a document. The clock marks are said to be either "on" clock or "between" clock. This indicates that the data boxes are either coincident with the clocks (as shown in Figure 9B) or are located between the clocks (as shown in Figure 9D). This type of area uses the same data box and grid parameters described above. The clock mark data rows are either parallel (Figure 9B) or perpendicular (Figure 9D) to the document ID marks. The document mark-sense areas with clock marks uses all the same parameters as those areas without clock marks. The image areas on a variable size document also use the inventive document identification system. An image area can be defined using two coordinates (XI , Yl) and (X2, Y2) as shown in Figure 9C . These coordinates define the upper left-hand and lower right-hand rectangular comers of the image to be returned. SLIP EDITOR A scanner according to the present invention can also include a slip editor program that allows a user to easily define a new ticket to be scanned. Preferably, the slip editor is a multi-document application (i.e., several files can be opened simultaneously) that runs in a "WINDOWS" environment. The slip editor is used to generate and edit .sdf parameter files. Each .sdf file can include up to 64 different slips, and each slip can include up to 16 data areas. Each data area includes one of four predefined data types: bar-code, image, mark-sense (clocks), and mark-sense (no clocks). When the document editor is run, a window appears which includes two windowpanes. One of the windowpanes displays a tree, which allows the user to browse through the slips that have previously been generated. The other windowpane displays the information for the slip currently being processed. In a preferred embodiment, a slip editor according to the invention includes five menu items that the user can select. A File menu allows the user to open, close, or save a file, or to exit the program. An Edit menu allows the user to create or delete a slip, or to create or delete an area. A View menu provides or suppresses a view of the toolbar. A Window menu allows the user to organize the different windows on the screen. A Help menu provides version information and online help. To create a new slip, the user provides information on a General Info screen, a Slip Area Info screen, and a Build screen. At the General Info screen, the user enters the slip name, slip ED, slip width, and slip length. The slip name is a freestyle string. The slip ID represents an ED code that has been marked or pre-printed on the ticket, entered as a decimal integer. Preferably, the slip ED ranges from 512 to 1023, with a default slip ID of 0. Assuming that the rotation mark is located on the bottom right of the ticket, slip width is defined as the horizontal dimension of the ticket. Preferably, slip width ranges from 3.25 inches to 8.5 inches, with a slip width of 0 representing a variable slip width. Again, assuming that the rotation mark is located on the bottom right of the ticket, slip length is the vertical dimension of the ticket. Preferably, slip length ranges from 3.25 to 11 inches, with a slip length of 0 representing a variable slip length. At the Slip Area Info screen, the user can enter parameters that define the data areas on the slip. For each area, the user can enter the data type included in that area, as well as the location of the area on the slip. The location is specified by top (i.e., the distance from the top edge of the ticket to the top of the area), bottom (i.e., the distance from the top edge of the ticket to the bottom of the area), left (i.e., the horizontal distance from the left edge of the ticket to the left edge of the area), and right (i.e., the horizontal distance form the left edge of the ticket to the right edge of the area). The Build screen depends on the type of area defined in the Slip Area Info screen. OMR type, for example, is defined as a customer specific OMR type (e.g., 14 data rows on 5 mm spacing with 9 columns of data). No data field is necessary for an image area. A Build screen for mark-sense data can include the following parameters: row spacing (i.e., the horizontal distance between the centers of two data boxes), data box width (i.e., the horizontal dimension of the data box), left channel (i.e., the horizontal width of the left channel, which starts at the left edge of the area), right channel (i.e., the horizontal width of the right channel, which starts at the right edge of the area), number of rows (i.e., the number of boxes, not counting the left or right channels, on a horizontal line), first box (i.e., the horizontal distance from the left edge of the area to the center of the first data box), field sensitivity (i.e., the diameter of the smallest mark to be detected). A Build screen for mark- sense data with clocks can also include clock placement (i.e., right clock or left clock), and clock control (i.e., on clock or between clock). For consistency, as various slip parameters are entered, the slip editor checks their validity. For example, an area must be large enough to include the number of rows, subject to the row spacing parameters. If these requirements are not met, the slip editor can display a warning message and list all parameters that do not pass the necessary constraints. Thus, there have been described apparatus and methods for scanning and image processing of variable sized documents having variable orientations. Those skilled in the art will appreciate that numerous changes and modifications may be made to the preferred embodiments of the invention and that such changes and modifications may be made without departing from the spirit of the invention. It is therefore intended that the appended claims cover all such equivalent variations as fall within the true spirit and scope of the invention. APPENDIX A COMMAND COMMUNICATIONS The scanner command module (e.g., Pentium) receives commands from the user application program. In a preferred embodiment, these commands are sent via DLLEntry functions (see Appendix C). The command data is processed and, if needed, passed to a device driver, which transmits data over the bidirectional parallel interface, and receives its response over the same interface, from the local microcontroller in the scanner. The following command types are implemented in a preferred embodiment: Tvpe Command Function resetcmd '0' Reset scanner. ejectRearCmd '3' Eject document to rear of scanner. ejectFrontCmd '4' Eject document to front of scanner. (used only in jam condition). ledsOnCmd '5' Turn array- light source ON. ledsOffCmd '6' Turn array- light source OFF. enablecmd '8' Enable scanner to feed document. disablecmd '9' Disable scanner from feeding document scanSliplOO 'A' Process Slips at 100 dpi. (default) scanSlip200 'B' Process Slips at 200 dpi. calibratecmd 'C Enter scanner Calibration mode. teststring 'D' Test communications with scanner (returns test string). dataOnClkCmd 'G' Use On-clock timing to scan slips. dataBtwClkCmd Η' Use between clock timing to scan slips. retumlDCmd T Returns scanner peripheral communications ID. leftClkCmd 'J' Use left side clock to scan slips. rightClkCmd 'K' Use right side clock to scan slips. loadcmd 'L' Load new scanner firmware. stepSpeedCmd 'M' Set scanner motor step rate (for branding). normalCmd 'N' Set software to default (normal mode), (turns off diagnostic commands 'R'). statusCmd 'Q' Return scanner status. createBMPFile 'R' Diagnostic mode which creates Image file of scanned slip. sigScan200 'S' Scan image at 200 dpi. slipCmd Sets scanner for slip mode (at current dpi). versionCmd 'V Return scanner software version. BranderTest 'a' Brander test mode. Standard Protocol for all Transmissions From Device Driver to Scanner Microcontroller via Parallel Port All transmissions will begin with an STX (02H) character. Following the STX character the command character is transmitted. Following the command, an ETX (03H) character sigmfies the end the command stream. Following the ETX character, a (check digit), which is the Exclusive OR of all the bytes in the transmission (including STX and ETX), will be sent. The check digit is only used with communication from the scanner software in the host processor to the scanner hardware module, not from the user application program. Command Format The following format is used to transmit commands from the Device Driver to the scanner: STX / <Command Character> / ETX. Command Descriptions This section defines individual commands that can be sent from the host to the scanner, and specifies the transmission format for each command, and the response to each command. Reset Command (ASCII 0) (DLL, Scanner - No response) The transmission format of the reset command sent to the scanner hardware module is STX / 0 / ETX. The reset command will initialize the scanner to default/power-up conditions. Eject at Rear Command (ASCII 3) (Scanner - No response) The transmission format of the eject at rear command sent to the scanner is STX / 3 / ETX. This command will cause the scanner's motor to run in the forward direction (clearing a document from the scanner) with a max run time of approximately 4 sees. Eject at Front Command (ASCII 4) (Scanner - No response) The transmission format of the eject at front command sent to the scanner is STX I I ETX. This command will cause the scanner's motor to run in the reverse direction (clearing a document from the scanner) with a max run time of approximately 4 sees. This command is used only for paper jam clearing. LEDS ON / OFF Commands (ASCII 5 / ASCII 6) (Scanner - No response) The following is the format of the commands sent to the scanner to toggle the read station array light source on and off: STX / 5 / ETX toggles light source LEDs ON; STX / 6 / ETX Toggles light source LEDs OFF. Enable Command (ASCII 8) (Scanner - No response) The transmission format of the enable command sent to the scanner is STX / 8 / ETX. This command will enable the scanner to process documents. Disable Command (ASCII 9) (Scanner - No response) The transmission format of the disable command sent to the scanner is STX 1 9 1 ETX. This command will disable the scanner from processing documents. Set Scanner to 100 dpi Command (ASCII A) (Scanner - No response) This command sets the scanner in the mode to scan documents at 100 dpi. This command has the following transmission format: STX / A / ETX. Set Scanner to 200 dpi Command (ASCII B) (Scanner - No response) This command sets the scanner in the mode to scan documents at 200 dpi. This command has the following format: STX / B / ETX. Calibrate Command (ASCII C) (Scanner - Response) The transmission format of the calibrate command sent to the scanner is STX / C / ETX. This command, when used in conjunction with the scanner's calibration plaque, will allow the unit to automatically calibrate its scan head (black/white) threshold levels. Return Test String Command (ASCII D) (Scanner-Response) The transmission format of the Return Test String command sent to the scanner is STX I D I ETX. This command will place the scanner in the mode to automatically return a test string to the terminal. The return format is STX / "Test ECP Default String" / ETX. Scanner Peripheral ID String (ASCII I) (Scanner - Response) The I command returns the parallel communications ED string which has the following format: Manufacturer: Cirrus Logic; Command Set: None; Model: CL-CD1283; Comment: Peripheral Dynamics Scanner; Active Command Set: None; The transmission format for this command is STX 1 1 1 ETX; the return format is STX / <ED STRINO / ETX. Load Command (ASCII L) (Scanner - Response) This command conditions the scanner to accept a new set of firmware from the host. The transmission format is STX / L / ETX. Step Speed Command (ASCII M) (Used for Branding) Normal (default) scan rate for Pagescan is .005" per scan. Speed of the unit during scanning is, therefore, 2000 steps per second (default step rate). The Step Speed command, sent to the scanner will set the scanner document transport step rate in accordance with the binary number contained in the 2 bytes following the command (Byte 1 is MSB; Byte 2 is LSB). The transmission format is STX / M / <Speed Byte 1> / <Speed Byte 2> / ETX. Normal Command (ASCII N) (Scanner - No response) This command sets the scanner to default (normal) mode. It also turns-off the diagnostic ('R') command. In normal mode, the scanner makes use of the document parameters defined in the '.sdf file to decode the slip data. The transmission format is STX / N / ETX. Status Command (ASCII Q) (Scanner - Response) The transmission format of the status command sent to the scanner is STX / Q / ETX. The status command will cause the scanner to return two bytes of status information to the host. The Response Format is ACK / STX / Q / <Status Byte 1> <Status Byte 2>/ ETX, where the format of Status Byte 1 is: Bit 0 - Scanner Enabled = 1 Bit 1 - Front Left Sensor Covered =1 Bit 2 - Front Center Sensor Covered = 1 Bit 3 - Front Right Sensor Covered = 1 Bit 4 - Rear Left Sensor Covered = 1 Bit 5 - Rear Center Sensor Covered = 1 Bit 6 - Rear Right Sensor Covered = 1 Bit 7 - Always Set to 1 and the format of Status Byte 2 is: Bit 0 - Scanner Ready = 1 Bit 1 - Xmit Aborted (Com Error) = 1 Bit 2 - Ticket Jam = 1 Bit 3 - Scan Array Error = 1 Bit 4 - In Diagnostic Mode = 1 Bit 5 - Doc in Scanner = 1 Bit 6 - Calibration of unit needed = 1 Bit 7 - Always Set to 1. Create Image File Command (ASCII R) (Scanner - No response) This command sets the scanner to diagnostic mode, in which it creates an Image file of the next slip scanned. The transmission format is STX / R / ETX. Scan Image Command (ASCII S) (Used by DLL, Scanner-No response) A scan image command places the scanner in a mode where it is prepared to capture an image of the entire document inserted into the scanner. This command places the scanner in 200 dpi scan mode. The transmission format of the scan image command is STX / S / ETX. Slip Mode Command (ASCII T) (Used by DLL, Scanner-No response) The Slip-mode command places the scanner in a mode where it is prepared to capture data from a mark-sense slip inserted into the scanner. Data is passed to the application as row / column data at the current setting for dpi image density. The transmission format is STX / T / ETX. Version Command (ASCII V) (Scanner - Response required) The transmission format of the software version command sent to the scanner is STX / V / ETX. This command will cause the scanner to return eight bytes representing the scanner software version number. The response format is STX / V / <Scanner Software Version Number> ETX, where the Software Version Number Byte Format is: Bytes 7-4 -> Product ID Bytes 3-2 -> Major Version Bytes 1-0 -> Minor Version Brander Test Command (ASCII a) (Scanner - No response) The transmission format for the brander test command sent to the scanner is STX / a / ETX. This command will activate the brander to print a bitmap test image stored on disk in the PC. COMMUNICATIONS FROM SCANNER TO HOST The following specifies the protocol used for all transmissions of data and messages from the scanner hardware module to the host data processing or command interfaces. Standard Protocol for all Transmissions From Scanner Hardware Module All transmissions will begin with an STX (02H) character. Following the STX character will be the data/message being transmitted. Following the data/message will be an ETX character (03H). Image Data Transmission from Hardware Module All data transmitted from the scanner hardware module will be in the form of raw image data. Data processing, if required, will take place within the data processing module of the Pentium software. The following data format is sent from scanner hardware to the host data processing module for image capture data. Image Data Transmission Format (Scanner hardware to PC) All image data will start with an STX character. Following the STX character, image data is sent (Up to a maximum of όOOKbytes of image data). 1 = Black; 0 = White Scan Image Data Format The data block will start with ASCII character S, as above, to indicate that the data to follow is image data. Following the ASCII character S, the image data bytes continue. Each byte of image data contains 8 bits (8 bits of a particular row) of data with each bit having the same format as above (i.e. , 1 = Black; 0 = White). Following the image data are 4 bytes which specify the number of image bytes just sent. The format of the block is STX / 5 / <Max 600K bytes of image data> / <4 bytes (to specify total of image bytes sent)> / ETX. Image Data Format (DLL to User Application) Image data is passed to the User Application via the DLLENTRY function GetScanMessage (char* Msg, int* Length) (see Appendix C). Slip Data with Timing Marks Data from selection (bet) slips is transmitted by the scanner module to the Pentium data processing module as image data via the high-speed parallel data buss. Data is processed within the Pentium; stored in row/column format, and made available via function call to the Host program (T>ZZ,ENrR7GetScanMessage (...)) (see Appendix C). Each data block will start with ASCII character T (54H), to indicate that the data to follow is slip data from a slip with timing marks. Following the ASCII character T is the number of data locations in this block of data. The value received by the host will actually be the number of data locations offset by 32 to avoid the portion of the ASCII table where all the control codes reside (STX=2, ETX=3, ...). Therefore, the host application must subtract 32 from the received value to determine the actual number of data locations. Next are the data locations found to be marked in two byte column/row format. The position of column 0 and row 0 are relative to the point at which the selection slip is to be inserted. Byte 1 - The column in which the marked data location was found. The scanner can handle a maximum of 80 columns (within the constraints of the minimum column to column spacing - see Appendix E). The value received by the host will actually be the column number offset by 32 to avoid the portion of the ASCII table where all the control codes reside. Therefore, the host application must subtract 32 from the received value to determine the actual column number, Byte 2 - The row in which the marked data location was found. The scanner expects the number of data rows defined as the default in the .sdf file (e.g., 14). The value received by the host will actually be the row number offset by 32 to avoid the portion of the ASCII table where all the control codes reside. Therefore, the host application must subtract 32 from the received value to determine the actual row number. Format of Block STX T / <number of data locations (Offset by 32)> / <Marked Data locations (2 bytes / location)>/ETX Slip with Optical Character Recognition (OCR) Data Text information from an OCR area of a form is transmitted from the scanner module as a bitmap image, to the scanner PC data processing module, via the high-speed parallel data bus. OCR data is processed (i.e., decoded) within the scanner PC software, and stored as an ASCII text string. This ASCII string is made available to the host application via a host function call to the scanner software (£>Z,Z,£'N R7GetScanMessage(...)) (see Appendix C). An ASCII preamble character 'O' (for OCR) identifies the message type as being type OCR. Following scanning of the form, after the OCR routines are run, a sub- message will be returned to the application for each OCR area on the form: Example Sub-message: <Type of Data>/<Document ID LSB>/<Document ID MSB>/<Area Νumber>/<textlength LSB>/<textlength MSB>/<char l>/<char 2>/.../<char n> where: <Type of Data> = ' O ' for OCR; n = textlength. Slip with Bar Code Recognition (BCR) Data Text information from a Bar code (BCR) area of a form is transmitted from the scanner module as a bitmap image, to the scanner PC data processing module, via the high-speed parallel data bus. BCR data is processed (i.e., decoded) within the scanner PC software, and stored as an ASCII alphanumeric data string. This ASCII string is made available to the host application via a host function call to the scanner software LEN RFGetScanMessage (...)) (See Appendix C). An ASCII preamble character 'B' (for BCR) identifies the message type as being type BCR. Following scanning of the form, after the BCR routines are run, a sub- message will be returned to the application for each BCR area on the form: Example Sub-message: <Type of Data>/<Document ID LSB>/<Document ID MSB>/<Area Νumber>/<textlengfh LSB>/<textlength MSB>/<char l>/<char 2>/.../<char n> where: <Type of Data> = 'B ' for BCR; n = textlength. Status Information Message The following is the format of the status information message sent to the host. The status information message is sent in response to a Status Command (Q), received from the host. ASCII character Q (5 IH) Status Byte I Status Byte 2 Transmission Format STX / Q / <Status Byte I> / <Status Byte 2> / ETX Unsolicited Messages The following events can cause unsolicited status information messages: OMS document jam; calibration required. Unsolicited messages are identified by the transmission of the ASCII '#' (23H) character. The following is the format of any Unsolicited Message sent to the host: Transmission Format STX / 23H / <Type of Message Byte> / <Message Number Byte> / ETX Where: <Type of Message Byte> = '0' Scarmer Status Type ' 1 ' - Calibration Type '2' - Scandll Type '3-9 - Future Use <Type of Message Byte> = '0' If Scanner Status Type: '0' - Scanner OK ' 1 ' - Scanner Document Jam '2' - Scanner Calibration Needed '3' - Communications Eπor '4' - Scanner Pixel Array Eπor <Type of Message Byte> =' 1 ' If Scanner Calibration Type: '0' - Calibration OK ' 1 ' - Short Calibration Document 5 '2' - Calibration Document Removed '3' - No Scanning Signal from Array '4' - No end of Scanning Signal from Array ' 5 ' - Naπow Calibration Document ' 6 ' - Hardware Eπor/FIFO 10 '7' - Wrong Calibration Document (Normally Black/White Threshold Document) <Type of Message Byte> = '2' If Scandll Type: ' 1 ' Data transmission Eπor, loss of data from Scanner 15 '2' File C:\Slip.txt not found '3' File <path>\<filename>.sdf not found '4' Brander image not valid '5' Brander .bmp file not found APPENDIX B PREFERRED CONNECTOR PIN ASSIGNMENTS 1 - Data Interface: Pin# Signal Function 1 Hostclk Active low clock signal (from Host) 2 Data O Parallel port data line (LSB) 3 Data l 4 Data 2 5 Data 3 6 Data 4 7 Data 5 8 Data 6 9 Data 7 Parallel port data line (MSB) 10 Periphclk Active low peripheral clock 11 Periphack Active high peripheral busy 12 Nackreverse Acknowledge Data request 13 Xflag Extensibility Flag 14 Hostack Active high host busy signal 15 Nperiphrequest Active low data available signal 16 Nreversereq Active low init signal 17 IEEE 1284 Active Active high 1284 active input 18-25 Gnd Signal Ground J5 - Power Input lines: Pin # Siεnal Function 1,2,9,10 Gnd Power/Signal Ground 3,4 +5VDC Logic Voltage 5 +12VDC Array Voltage 6 -5VDC Array Voltage 7,8 +24VDC Motor Voltage APPENDIX C SOFTWARE PROTOCOL This appendix specifies the software protocol for the interface to the scanner PC software (DLL). A large portion of the scanner software resides in the host Pentium. This includes all data processing algorithms, as well as scanner command and driver software. All local controls for transporting and scanning forms are embedded in the scanner's local 80C 196 firmware. Communications between the user application and the scanner software are accomplished via a number of exported functions to the scanner DLL. Data and commands are passed to and from the user application program through library function calls. These calls also provide access to the scanner functions. The data processing module of the scanner receives raw (scanned) data from the local microprocessor, via a parallel port driver. The raw data is processed, and the results are passed to the user application program, either by host software polling or by a Windows event. The following defines the function prototype for obtaining processed data, and passing this data from the scanner data processing module to the user application. DEFINITIONS: #ifdef EXPORTING #defme DLLENTRY extern "C"~declspec(dllexport) #else #defme DLLENTRY -declsρec(dllimρort) #endif FUNCTIONS: DLLENTRY int WINAPI SendScanMessage(char* Msg, int Length); Purpose: To send a message to the Scanner. Parameters: MSG : a pointer to a message to send out to the Scanner interface. Length : the length of the Scanner Message. DLLENTRY int WINAPI Initialize (long piHandle); Purpose: To initialize the Scanner board. This function should be called first. Parameters: PiHandle : a Handle to a windows event. Additional Notes: The application will create a Windows event. In Visual C++ the call is MyEvent = CreateEvent (0, FALSE, FALSE, NULL); The application should then create a thread to wait for the event to occur. Void MyThread (void) { while (true) { WaitForSingleEvent (MyEvent, INFINITE); Call GetScanMessage Process the message. } } DLLENTRY int WINAPI ResetScanner (void); Purpose: To Reset the Scanner Parameters: None. Additional Notes: This command can take 5-8 seconds to execute. DLLENTR Y int WINAPI GetScanMessage (char* Msg, int* Length); Purpose: To get a message from the Scanner. Parameters: Msg : a pointer to a message to get from the Scanner interface. Length : the length of the Scanner Message Additional Notes: Memory is allocated by the application, DLLENTRY int WINAPI GetS can Version (unsigned*Major, unsigned* Minor)', Purpose: To retrieve the DLL's version numbers. Parameters: Major : a pointer to the major version number. Minor : an unsigned pointer to the minor version number. Additional Notes: Memory is allocated by the application. DLLENTRY int WINAPI BurnScanFirmware (char* FileName, int Length); Purpose: To update the Scanner's firmware. Parameters: FileName : The name of the file to bum. The full path is to be given. Length : The length of the file name passed. Additional Notes: Memory for the file name is allocated by the application. APPENDIX D PREFERRED COLORS AND INK FORMULATIONS FOR BACKGROUND PRINTING The following listing is the result of extensive testing done with PDI's scanners in conjunction with industry standard PANTONE color charts. The recommended colors are acceptable for printing non-readable background information and data boxes within the data fields of forms and tickets. 1. The following basic Pantone colors are recommended: A. Yellow (acceptable, but normally too light without the addition of other color tones). B. Orange C. Warm Red D. Red E. Rubine Red (lighter shades) F. Rhodamine Red (very light shades) G. Magenta 2. In addition, combinations of Rubine Red, Rhodamine Red, and Purple, in conjunction with white or another basic color listed above, will result in acceptable reflectance ranges for background printing. Specifically, the following combinations are recommended (Numbers listed are Pantone color chart numbers): A. (Orange tones): #123 (Mustard), #130 (Dark Mustard), #137 (Burnt-Orange), #144 (Pumpkin), #151 (Light Pumpkin), #157 (Medium Pumpkin), #158 (Dark Pumpkin), #163 (Light Orange), #164 (Medium Orange), #165 (Dark Orange), #171 (Light Tangerine), #172 (Tangerine), #177 (Coral) #178 (Dark Coral) B. (Salmon/Tan tones): #468 (Light Tan) #475 (Light Peach), #486 (Salmon), #487 (Light Salmon) (Pink/Rose/Cranberry tones): #184 (Cherry), #185 (Fire Engine Red), #190 (Bubble Gum Pink), #191(ReddishPink), # 192(DarkReddishPink), #198 (Cranberry), #199 (Strawberry Red), #204 (Light Fuchsia), #205 (Medium Fuchsia), #206 (Dark Fuchsia), #211 (Pink), #212 (Medium Pink), #213 (Watermelon), #218 (Dark Pink) #219 (Dusty Rose), #224 (Light Rose), #225 (Rose), #226 (Dark Rose), #232 (Pinkish Rose) D. (Light Purple/Light Violet tones): #244 (Light Purple), #251 (Light Violet) (Yellow-Green tones): #372 (Light. Lime-Green), #386 (Lime-Green), #393 (Very light Yellow-Green), #394 (Light Yellow-Green), #395 (Yellow-Green) (Fluorescent Colors): #803 (Fluorescent Yellow), #804 (Fluorescent Orange), #805 (Fluorescent Red), #806 (Fluorescent Pink) APPENDIX E PREFERRED DATA BOX DIMENSIONS DATA-BETWEEN CLOCK FORMAT DIM A DATA BOX OR PRINTED DATA MARK HEIGHT Min: 0.125 inches 3.2 mm Max: 0.170inches 4.3mm - For 12 Data-Row Format or 0.150inches 3.8mm - For 14 Data-Row Format DIM B DATA BOX OR PRINTED DATA MARK WEDTH Min: 0.05 inches 1.3 mm (0.4 times Dim A) Max: 0.58 times Dim A DIM C CLOCK MARK HEIGHT 0.125 +/- 0.010 inches (3.05 +/- 0.25 mm) (from edge of form) DIM D CLOCK MARK WIDTH Min: 0.040 inches 1.0 mm Max: 0.25 inches 6.35 mm DIM E DISTANCE FROM EDGE OF FORM TO CLOCK MARK (First or Last Clock Mark) Min: 0.400 inches 10.0 mm DIM F COLUMN SPACENG (Clock-To-Clock Centeriine Distance) Min: 0.120 inches 3.0 mm Note: Cannot be less than (DIM D + DIM B + 0.036 inches (0.9 mm)) DATA-ON-CLOCK FORMAT (CENTER SAMPLE CLOCK) DIM G DATA BOX OR PRINTED DATA MARK HEIGHT Min: 0.125 inches 3.2 mm Max: 0.170 inches 4.3 mm - For 12 Data-Row Format or 0.150 inches 3.8 mm - For 14 Data-Row Format DIM H DATA BOX OR PRINTED DATA MARK WIDTH Min: 0.05 inches 1.3 mm (0.4 times Dim G) Max: 0.58 times Dim G DIM I CLOCK MARK HEIGHT 0.125 +/- 0.010 inches (3.05 +/- 0.25 mm) (from edge of form) DIM J CLOCK MARK WEDTH Same as Data Box Width (Dim H + 0.036 in (0-9 mm)) DIM K DISTANCE FROM EDGE OF FORM TO CLOCK MARK (First or Last Clock Mark) Min: 0.400 inches 10.0 mm DIM L COLUMN SPACENG (Clock-To-Clock Centeriine Distance) Min: 0.120 inches 3.0 mm Max: Any DIM N BLANK SPACE SEPARATING SUCCESSIVE CLOCK MARKS Min: 0.060 inches 1.5 mm APPENDIX F PREFERRED MARKING IMPLEMENTS Various commercially available marking implements have been tested at PDI to determine their acceptability and readability when used with PDI's Visible Spectrum scanners. Forty-seven various pens and pencils were chosen, based on the following criteria: A. A prior indication of mixed results regarding scanning success using older technology (with either PDI or competitive scanners). B. Writing implements reported as problem markers by several State Lotteries. C. Some common writing instruments used throughout the U.S. and Canada. D. Background colors (primarily red and yellow tones) were excluded, based on their usage as background colors Of the forty-seven writing tools tested, only one failed (as noted below). The remaining implements achieved 100% read reliability, regardless of the type of mark made, or its size. The following is a list of the type of writing instruments tested: Reference No. Color Mfg. Brand Name Description 1. Black Uniball Faber-Castel.1 Ballpoint medium 2. Black Zebra Felt-tip medium 3. Black Scripto Easy Roller Ballpoint fine 4. Black Paper Mate (Write Bros.) Ballpoint fine 5. Black Spectra Ballpoint fine 6. Black Magic Marker - Liquid Crayon Felt-tip medium. 7. Black Flair Felt-tip medium 8. Black Wearever Laundry Ballpoint fine 9. Blue Uniball Faber - Castell Ballpoint fine 10. Blue Magic Marker - Liquid Crayon Felt-tip medium 11. Blue Scripto Easy Roller Ballpoint 12. Blue Flair Felt-tip 13. Blue Magic Marker Super Hard Felt-tip very fine 14. Blue Paper Mate (Write Bros.) Ballpoint 15. Blue Magic Marker - Liquid Crayon Felt-tip 16. Blue Blue White Pen Ballpoint 17. Blue Flair Felt-tip 18. Blue Flash 32 Felt-tip 19. Blue Flash Felt-tip 20. Blue Buffalo Artist #10 Felt-tip large 21. Blue Bic Office Marker Felt-tip 22. Black Berol Eagle Marker 8835 Felt-tip large 23. Black Flash Felt-tip 24. Black Flash 32 Felt-tip fine 25. Blue Superiter Felt-tip 26. Blue Bic Biro Ballpoint fine 27. Blue Berol Roller Liner 5900 Ballpoint 28. Black Bic Biro Ballpoint medium 29. Blue Wonderiter Ballpoint 30. Black Pinpoint Faber - Castell Ballpoint 31. Blue Bic Auditors Ballpoint fine 32. Black Bic Ballpoint 33. Black Paper Mate Accu-Point Ballpoint 34. Green Superiter Felt-tip 35. Blue Dixon 393T Pencil 36. Green Magic Marker - Liquid Crayon Felt-tip 37. Black Pilot SC-LTF Ballpoint 38. Green Berol Felt-tip 39. Green Color Brite 4128 Pencil 40.* Tan Buffalo Artist #13 Felt-tip large 41. Brown Buffalo Artist 46 Felt-tip large 42. Brown Magic Marker - Liquid Crayon Felt-tip large 43. Brown Pentel Color Pen S360-106 Felt-tip large 44. Green Pentel Color Pen S360-134 Felt-tip large 45. Purple Pentel Color Pen S360-120 Felt-tip large 46. Purple Magic Marker - Liquid Crayon Felt-tip large 47. Purple Pentel Color Pen S360-131 Felt-tip large "(failed to read) APPENDIX G Parameter Descriptions Size of the document: Minimum size is 3.25in. x 3.25in.; Maximum size is 8.5in. x 1 lin.; or 210mm. x 297mm. (A4 size Doc.) A document can have up to 16 areas. Each area is one of 4 predefined types: Areas without clock marks (see figure 1); Areas with clock marks (see figure 2); Bar Code Area; Image Area. Each area has specific parameters that are defined in the Document Parameter File C:\slip.sdfi Parameter Structures The following is the "CH structure of the "Document Parameter File" defined above: typedef struct SingleMark{ // general structure of a single slip S lipHeaderTypeS lipHeader; SingleMarkTypeMarks [a-max-num-of mark-areas]; } SingleSlipType; typedef struct { // general information on a slip SlipIdTypeSlipld; //ED Clock Rotation printed on ticket Char SlipName [30]; //slip name float SlipWidth; //slip width in inches float SlipLength; //slip length in inches bool SlipActive; UTNT NumberOfMarks; //number of marks on ticket } SlipHeaderType, typedef struct { MarkHeaderType MarkHeader; Union { MSClocksType Clock; MSNoClocksType NoClock; BarCodeType BarCode; DensityType Density. }UU; } SingleMarkType; typedef struct { bool MarkActive; float Top; //top of mark from top of ticket, in inches float Bottom; / bottom of mark from top of ticket, in inches float Left; //left of mark from left of ticket, in inches float Right; //right of mark from left of ticket, in inches int AreaType; //mark type: BarCodeArea = 0, Density Area 1, //clockArea = 2, NoClockArea = 3; } MarkHeaderType, typedef struct { // information if area is clock type float ClockSpacing; //vertical spacing between clocks, in inches float RowSpacing; //horizontal spacing, in inches float DataBoxLength; //vertical data box length, in inches float DataBox Width; //horizontal data box width, in inches float FirstBoxX; //left of area to first data box center, in inches float FirstBoxY; //top of area to first data box center, in inches bool RightClock; //true if RightClock, false if LeftClock bool OnClock; //true if OnClock, false if BetweenClock float LeftChannel; //left channel width (for left clocks), in inches float RightChannel; //right channel width (for fight clocks), in inches int NbrColumns; //nb of horizontal columns int NbrRows; //nb of vertical rows, not counting left and fight channels float Sensitivity; //diameter of smallest mark to detect, in inches } MSClocksType; typedef struct { //information if area is image type } DensityType; typedef struct{ //information if area is barcode type int BarCode; }BarCodeType; typedef struct{ //information if area is no clocks type float Column Spacing; //vertical column spacing, in inches float RowSpacing; //horizontal row spacing, 'in inches float DataBoxLength; //vertical data box length, in inches float DataBox Width; //horizontal data box width, in inches float FirstBoxX; //left of area to first data box center, in inches float FirstBoxY; //top of area to first data box center, in inches int NbrColumns; // nb of horizontal columns int NbrRows; //nb of vertical rows float Sensitivity; //diameter of smallest mark to detect, in inches } MSNoClocksType

Claims: WE CLAIM: 1. A method for processing a scanned image of a document, comprising: receiving a data set representative of a bit map image of a scanned document; aligning said bit map image based on a rotational indicator obtained from said data set; determining a document type based on a document type indicator obtained from said data set; and processing a data area of said document based on said document type. 2. The method of claim 1 , wherein said bit map image is produced by a scanner. 3. The method of claim 1, wherein said processing of said data area comprises extracting data from said aligned bit map image based on a predefined document mask associated with said document type. 4. The method of claim 1 , wherein said data area includes data from the group consisting of mark-sense data, image data, character data, and bar code data. 5. The method of claim 1 , further comprising: processing up to 16 data areas, wherein each said data area includes data from the group consisting of mark-sense data, image data, character data, and bar code data. 6. The method of claim 1 , wherein said aligning of said bit map image includes determining a location of said rotational indicator on said document, and defining an origin on said document based on the location of said rotational indicator. 7. The method of claim 6, wherein processing said data area includes locating said data area on said document relative to said origin. 8. The method of claim 7, further comprising: storing a set of coordinates that define the location of the data area on the document relative to the origin; and identifying the data area based on the set of coordinates. 9. The method of claim 1 , wherein said document has a width in the range of about 3.25 inches to about 8.50 inches, and a length in the range of about 3.25 inches to about 300 millimeters. 10. Apparatus for scanning a document, comprising: a scanner and a host processor coupled to the scanner, wherein the scanner receives a document having at least one data area, scans the document to generate a bit map image of the document, and forwards a data set representative of the bit map image of the document to the host processor; and wherein the host processor receives the data set, aligns the bit map image based on a rotational indicator obtained from the data set, determines a document type based on a document type indicator obtained from the data set, and processes the data area based on the document type. 11. Apparatus according to claim 10, wherein the scanner comprises a photosensor aπay having a plurality of light sensitive elements, and wherein the scanner can be calibrated by a method comprising: scanning a calibration plaque having a known reflectivity; determining a calibration intensity value for each light sensitive element that represents the intensity of light received by the light sensitive element while the calibration plaque is being scanned; and defining a sensitivity threshold for each light sensitive element to have a value based on the calibration intensity value determined for the light sensitive element. 12. Apparatus according to claim 10, wherein the scanner comprises a thermal document brand head that is connected to the host processor, wherein the host processor downloads print information to the thermal brand head for printing onto a document in the scanner. 13. Apparatus according to claim 12, wherein the print information includes bitmap data. 14. Apparatus according to claim 10, further comprising: a slip editor that allows a user to generate a mask that defines a slip to be scanned. 15. Apparatus according to claim 14, wherein each slip can include up to 16 data areas, and each data area includes data from the group consisting of mark-sense data, image data, character data, and bar code data.

Inventors: GARCZYNSKI JOHN S, HAHN JEFFREY, HYER LAWRENCE, MCDEVITT BERNARD, WILCOX STEVEN, GARCZYNSKI, JOHN, S., HAHN, JEFFREY, HYER, LAWRENCE, MCDEVITT, BERNARD, WILCOX, STEVEN
Applicants: PERIPHERAL DYNAMICS, PERIPHERAL DYNAMICS, INC.
Application year: 2000
Main classification: G06K
IPC codes: H04N1