Patent Publication Number: US-6912325-B2

Title: Real time electronic registration of scanned documents

Description:
FIELD OF THE INVENTION 
   This invention relates generally to document scanners, and more particularly to a device and a method for correcting a skewed image of a skewed document to be scanned when fed through an automatic document feeder. 
   BACKGROUND OF THE INVENTION 
   Documents scanned using an Automatic Document Feeder (“ADF”) may be mis-registered or skewed, which result in a skewed image. A document may be skewed by a shift in in-track and/or cross-track directions, or by an angular rotation. To correct the skewed image, some mechanical techniques have been proposed. However, these mechanical methods tend to be unreliable. This problem may be partially solved by using de-skew software algorithms that have been proposed to correct only angular rotations errors. These methods, however, may cause reduced productivity, because the whole image of the document has to be captured, stored in memory, and then retrieved for correction. These prior methods operate on post-rendered binary images that may result in poor image quality, because they do not use the full bit-depth image captured by the scanner. 
   There is, therefore, a need for a method and system for real-time skew correction that operates during scan operation and prior to rendering the entire image, which does not reduce productivity and image quality. 
   BRIEF SUMMARY 
   The present invention is defined by the following claims, and nothing in this section should be taken as a limitation on those claims. By way of introduction, a method for providing skew correction information for a skewed image of a skewed document includes determining skew information, a corner location for the skewed image, and a dimension of the skewed image to determine skew correction information for the skewed image prior to scanning the skewed document. The method also determines the rotation angle and the rotation direction for the skewed image. The method then transforms the corner location for the skewed document into a rotated location, where the skewed image will be corrected. 
   According to another embodiment of the present invention, a method for providing skew correction information for a skewed image of a skewed document in a scanner includes reading a first sensor data indicating first skew information about the skewed document when the first sensor is struck by the skewed document, reading a second sensor data indicating second skew information about the skewed document when the second sensor is struck by the skewed document, reading a third sensor data indicating third skew information about the document when the second sensor is struck by the skewed document, and then determining skew correction information for the skewed image, using the first, second, and third skew information, prior to scanning the skewed document. 
   According to yet another embodiment of the present invention, a system for correcting a skewed image of a skewed document in a scanner includes a plurality of skew sensors located in a straight line perpendicular to the document flow direction of the scanner, at least one lateral sensor located along the document flow direction, means for reading the skew sensors and the lateral sensor, means for determining skew correction information for the skewed image prior to scanning the skewed document, and means for correcting the skewed image during real-time scanning of the skewed document. The system also includes encoder counters providing data indicating relative position and orientation of the skewed image. The system further includes means for determining a corner position for the skewed document in a rotated location and means for rotating the skewed image such that the skewed image is registered without being skewed. 
   The present invention is defined by the following claims, and nothing in this section should be taken as a limitation on those claims. 

   
     BRIEF DESCRIPTION OF SEVERAL VIEWS OF THE DRAWINGS 
     The present invention is illustrated by way of example and not limitation in the accompanying figures. In the figures, like reference numbers indicate identical or functionally similar elements. Additionally, the left-most digit(s) of a reference number identifies the figure in which the reference number first appears. 
       FIG. 1  shows a presentation of two skewed images and their skew angle conventions; 
       FIG. 2  shows a presentation of a skewed document; 
       FIG. 3  shows a presentation of a skewed image of the skewed document of  FIG. 2 ; 
       FIG. 4  shows a presentation of a cross-track sensor; 
       FIG. 5  shows a presentation of a skewed image and the equations for the lead edge and the top edge of the skewed image; 
       FIG. 6  shows a presentation of common paper sizes and the corresponding image widths; 
       FIG. 7  shows a presentation of skew correction parameters; 
     FIGS.  8 ( a ) and  8 ( b ) show presentations of intermediate parameters required for calculation of skew correction parameters of  FIG. 7 ; and 
       FIG. 9  shows a presentation of calculation of corner position coordinates. 
   

   DETAILED DESCRIPTION OF PRESENTLY PREFERRED EMBODIMENTS 
   The presently preferred embodiments of the invention are now described in reference to the drawings. Referring now to the drawings,  FIG. 1  shows two skewed images and the corresponding skew angle conventions. The term “skew” used here includes angular rotation, shift in the in-track direction (parallel to the scanner paper motion), and/or lateral shift in the cross-track direction (perpendicular to the scanner paper motion). Part (a) shows a document  102  being fed into a scanner along the scanner paper feed path  104 . However, this document is skewed in a counterclockwise direction as being fed into the scanner. Consequently, the scanner would produce an image of the skewed document, which would also be skewed. Part (b) shows the captured image  106  of the skewed document  102 , which would be skewed by a skew angle θ  108 , if not corrected. The angle convention adopted in the presently preferred embodiment is assigning negative sign to a skew angle in counterclockwise direction and assigning positive sign to a skew angle in clockwise direction. Therefore, the skew angle θ  108  in part (b) is considered a negative skew angle. Part (C) shows a document  112  being fed into a scanner along the scanner paper feed path  104 . However, this document is skewed in clockwise direction. Part (d) shows the captured image  116  of the skewed document  112 , which would be skewed by a skew angle θ  118 , if not corrected. Therefore, the skew angle in part (d) a positive skew angle. 
   According to the presently preferred embodiments, a skewed image may be corrected in real-time, during scan operation, and before the document image is completely rendered. This method has the advantages of reducing productivity loss of the scanner and improving the image quality over prior skew correction methods, because this method does not require capturing and rendering the whole image, storing the image in memory, and retrieving the image for skew correction. Accordingly, the document being scanned may be examined for skew effect prior to capturing its image, and if it is skewed, its skewed image may be corrected in real-time as the document is being scanned. 
   According to the presently preferred embodiment, at least two skew sensors ( 122  and  124 ) are placed in a straight line perpendicular to the unskewed document flow direction  104  of a scanner. Each sensor includes at least one encoder counter that may be read when struck by a skewed document to determine the relative time that each sensor is struck by the skewed document.  FIG. 1  shows two skew sensors, a rear skew sensor  122  and a front skew sensor  124 . Depending on which direction a document is skewed, one of these two sensors is struck first by the skewed document. This information may be used to determine the skew direction. For example, part (a) of  FIG. 1  shows the front skew sensor  124  being struck first by the document  102 , indicating the counterclockwise skew direction of the document  102 . On the other hand, part (c) of  FIG. 1  shows the rear skew sensor  122  being struck first by the document  112 , indicating the clockwise skew direction of the document  112   
   To correct a skewed image, the skewed image may be rotated by the skew angle of the skewed document, in the same direction that the document is skewed. The skew angle and direction of skew of a document may be determined using the encoder counts read from the two sensors  122  and  124 . The scanner includes a processing unit, which may be interrupted, when each one of these two sensors is struck by a skewed document, to record the respective encoder count. The skew angle may be determined based on the difference in encoder counts of the two skew sensors, the distance between the two skew sensors, and the speed of document being fed into the scanner. From the encoder counts of the two skew sensors, the time difference between the two sensors that are struck with the skewed document may be determined. Knowing the speed of the document being fed into the scanner and the sensors time difference, the distance traveled by the document in the scanner may be determined. Based on the distance traveled by the document and the distance between the two sensors, the skew angle of the skewed document may be determined, as explained in more detail below. The skew direction may be found based on the sign of the difference in encoder counts of the two skew sensors, or based on the order in which the skew sensors are struck by the skewed document, as will be discussed in more detail below. 
     FIG. 2  shows the skewed document  102  of  FIG. 1 , part (a), which may be presumed to have been rotated about its front corner  206  by a skew angle.  FIG. 3  shows how the front corner  206  of the skewed document  102  would be transformed to the rear corner  302  on the skewed image  106 . As shown in  FIG. 3 , the document is over-scanned for not to miss any part of the skewed document, if it is skewed. However, the corrected image should be adjusted so that it appears on the right coordinates that match the document. According to the presently preferred embodiment of the present invention, after finding the position coordinates of rear corner  302 , to correct the skewed image  106  in  FIG. 3 , the skewed image  106  may be rotated about its rear corner  302  by the skew angle in the same direction that the document is skewed, as discussed in connection with part (b) of FIG.  1 . As mentioned above, the skew angle and direction of skew of a document may be determined using the encoder counts read from the two sensors  122  and  124 . However, the position coordinates of the rear corner  302  of the skewed image  106  have to be determined. This rear corner position coordinates may be used to define where the first pixel of the image should start. Consequently, the in-track and/or cross-track mis-registration of the skewed image will be corrected, regardless of whether or not the document has been rotationally skewed. The skew angle, skew direction, and the corner position coordinates of the skewed image may be stored in the correction board registers, as explained in more detail below, before the scanner starts capturing the image. Thereafter, the scanner rotates each segment of the real-time captured skewed image of the skewed document about the rear corner of the skewed image. 
   According to the presently preferred embodiment, at least one “cross-track” sensor is also used to sense the position of the top edge of the document during scan operation. The cross-track sensor may include, preferably, a linear CCD array sensor. The cross-track sensor is read by the scanner&#39;s processing unit at the time the second skew sensor is struck by the document.  FIG. 2  shows a cross-track sensor  210 , and  FIG. 4  show its operation. 
   Referring to  FIG. 4 , when a document being fed into a scanner does not cover any part of the cross-track sensor  210 , e.g. part (a), the sensor reads its maximum count of, for example  127 . However, when the document covers a portion of the sensor, e.g. parts (b) and (c), the sensor reads fewer counts as shown, depending on how much of the sensor is covered by the skewed document. The cross-track sensor&#39;s reading, x ts , which indicates the relative lateral position of the top edge of the document at the time the second skew sensor is struck by a skewed document, is used to determine the coordinates of the cross track sensor, x s  and y s . The image-space position coordinates of the skew sensors and the cross-track sensor are obtained from the calibration procedure of the skew sensors, as explained below. 
     FIG. 5  shows the skewed image  106 , as shown in  FIG. 3 , and the line equation  502  for the lead edge  504  and the line equation  506  for the top edge  508  of the skewed image  106 . Assuming these two edges are perpendicular, by intersecting their two line-equations  502  and  508 , the position coordinates of the image rear corner  302 , x c  and y c , my be determined. This rear corner position coordinates may be used to define where the first pixel of the image should start, to correct the in-track and/or cross-track mis-registration of the skewed image, regardless of whether or not the document has been rotationally skewed. The position coordinates of the front corner  206  my be determined if the image width of the document and the skew angle are known. 
     FIG. 6  shows the image widths for common standard-size papers for both portrait and landscape orientations. In the presently preferred embodiment, there are generally  5  image widths for preset widely used standard papers. However, other paper dimensions may be also used. The dimensions of the scanner paper may be detected by the scanner&#39;s paper tray sensors, and the corresponding image width may be found by using a lookup table, such as the one provided in FIG.  6 . 
     FIG. 7  shows a list of skew correction parameters  702  that may be preferably used to program a scanner for correcting a skewed image. The parameters may be obtained by the calculation of the corresponding formula  704 , or by pre-computed table-lookups. In one embodiment, the scanner may include a correction board, including twelve registers, preferably each having 24 bits, which may be loaded with the parameter values  702 , before starting to capture the image. The “Output X Address Start” and “Output Y Address Start” parameters represent the document corner coordinates in the high-resolution format required by the skew correction algorithm. These coordinates are obtained using FIGS.  8 ( a ),  8 ( b ), and  9 . 
   FIGS.  8 ( a ) and  8 ( b ) show the lists of intermediate parameters for calculating the skew correction parameters  702  in FIG.  7 . The parameters provided in FIG.  8 ( a ) include: constants parameters  802  and calibration parameters  804 . The constants parameters  802  are exemplary parameters provided for a certain type of scanner. However, the inventive concepts presented in connection with the presently preferred embodiment disclosed herein are equally applicable to other scanners or similar devices, including photocopier, fax machines, and the like. The calibration parameters  804  are obtained by calibrating the scanner by a test document that has specific features on it. Through the calibration process, the image space coordinates of the sensors are obtained. 
   FIG.  8 ( b ) shows input parameters  806  and calculations  808 . After determining the intermediate parameters listed in FIGS.  8 ( a ) and  8 ( b ), the high resolution position coordinates of the front corner  206  may be determined using  FIG. 9 , as explained below. 
     FIG. 9  shows a set of equations for calculating the position coordinates of the front corner  206  of the skewed document  106  (FIG.  2 ), depending on whether the front sensor was second to be struck by the skewed document, part (a), or whether the rear sensor was second to be struck by the skewed document, part (b). The position coordinates of the front corner  206  of the skewed document “x-fc” and “y-fc” are calculated from the position coordinates of the rear corner  302  of the skewed image as provided in  FIG. 5 , the image width as provided in  FIG. 6 , and the skew angle as provided by the calculations  808  in FIGS.  8 ( b ). Part (c) of  FIG. 9  shows the required equations for transforming the position coordinates of the front corner  206  of the skewed document  102  to the rotated coordinate space, which is the space that the captured skewed image should be transferred to for correcting the skewed image. Part (d) of  FIG. 9  shows the high-resolution corner coordinates used by the scanner. As mentioned above, the skew correction algorithm, according to presently preferred embodiment, captures each segment of the real-time skewed image, and rotates it to the desire location as determined by the equations provided in part (d) of FIG.  9 . 
   The above information may be used to program the image processing electronics of the scanner, which implements the image rotation algorithm. This algorithm preferably uses a Cubic Convolution Interpolation method, as discussed in Keys&#39; article published in  IEEE Transaction on Acoustics, Speech, and Signal Processing , Vol. ASSP-29, No.4, December 1981, pages 1153-1160, which is incorporated herein in its entirety by reference. However, other interpolation methods may also be used, i.e., bilinear interpolation. Knowing the corner position of the document and the document size, the image may be cropped so that no registration error occurs. 
   More details of the presently preferred embodiments of the present invention may be found in the attached Appendix A. 
   It will be appreciated that a wide range of changes and modifications to the presently preferred embodiments of skew correction method and system disclosed herein are contemplated. Accordingly, while preferred embodiments have been shown and described in detail by way of examples, further modifications and embodiments are possible without departing from the scope of the invention as defined by the examples set forth. It is therefore intended that the invention be defined by the appended claims and all legal equivalents.