Abstract:
At least one sheet of paper is conveyed in a feeding direction along a conveyance path. A line perpendicular to the feeding direction of the conveyed sheet includes at least first and second distinct view field regions (lengths) separated from one another by the center of the path. The light directed toward the sheet which passes across the path along the perpendicular line is optically scanned, and a value of the dimension a conveyed sheet projects into each of the first and second view field regions is produced for each scan. The sheet is repetitively scanned a plurality of times as it is conveyed along the path, and the values obtained, for each scan, for at least for the first and second regions are summed with a predetermined constant value to produce a sequence of width values representing the widths of the conveyed paper sheet at a corresponding plurality of longitudinal positions along the sheet. The width values from the sequence which fall within a range about a predetermined nominal width value of the sheet (the range being this nominal width value plus or minus a preset allowable deviation) are selected and used for computing the average width value of the sheet. The average width value is compared with a reference width value. Document skew, dog-ear, puncture and other parameters may also be determined from the measured width values.

Description:
BACKGROUND OF THE INVENTION 
     The present invention relates to a profile and feeding state detection apparatus and method for a paper sheet to be fed into an inspection apparatus for determining the condition and authenticity (i.e., counterfeit nature) of a paper sheet such as a banknote and, more particularly, to a detection apparatus and method for detecting the width, damage, skew, misalignment, puncture, or dog ear of the paper sheet. 
     A conventional profile and feeding state detection apparatus of the type described above has a configuration as shown in FIG. 1. A light source 1 directs light onto the lower surface of a paper sheet P which is fed in the feeding direction indicated by arrow a. Rod-shaped photocells 3 and 5 are disposed above the paper sheet P and oppose the light source 1 through the paper sheet P. The beams of light from the light source 1 which are transmitted through the paper sheet P are incident on the photocells 3 and 5. Output signals from the photocells 3 and 5 are amplified by amplifiers 7 and 9 respectively. The amplified signals are then supplied to a processing circuit 11. The photocells 3 and 5 are disposed at the two edges (width-wise) of the paper sheet P in the direction perpendicular to the feeding direction indicated by arrow a. When the paper sheet P is fed below the photocells 3 and 5, the light beams to be incident on the photocells 3 and 5 are shielded in accordance with the width (direction perpendicular to the feeding direction indicated by arrow a), damage, punctures, dog ears, etc. of the paper sheet P. At this time, the output signals from the photocells 3 and 5 are supplied to and amplified by the amplifiers 7 and 9 respectively. The amplified signals are then supplied to the processing circuit 11. In the processing circuit 11, each amplified signal is integrated for a predetermined time interval. Integrated values are used to detect the width and any damage, misalignment, or puncture of the paper sheet P. 
     In the conventional detection apparatus for detecting the width, damage, misalignment and puncture of the paper sheet P, when a dog ear is present in the paper sheet P or when the paper sheet P is damaged, output signals from the photocells 3 and 5 are greatly changed. As a result, a large error occurs in the integrated value of the output signal. For example, the integrated value may appear to indicate that the width of the paper sheet P is decreased. The detection apparatus then erroneously less than it should be that the paper sheet P has a width smaller than its actual width. In this condition, proper width and misalignment detection cannot be performed. 
     Similarly, the above integrated value may appear to indicate that the paper sheet P is damaged. Furthermore, the value may appear to indicate that a puncture (hole) is present in the paper sheet P. In this manner, even if the paper sheet P is neither damaged nor punctured, the detection apparatus erroneously detects that a damaged portion or a puncture is present which can result in greater inconvenience. Furthermore, proper detection cannot be performed when the paper sheet P such as a banknote is very thin, or when an old and worn banknote is used. For example, when a new banknote is used, the amount of light transmitted through the banknote is greater than that transmitted through an old, worn banknote. Therefore, the integrated value obtained by detecting the new banknote appears to indicate that its width is decreased in the same manner as in instances where the detection apparatus erroneously detects that the paper sheet has a damaged portion or a puncture. As a result, the detection apparatus erroneously detects that the new banknote has a width shorter than the standard width (or the detection apparatus erroneously detects that the new banknote has a damaged portion or a puncture). However, when an old banknote is used, the amount of light transmitted therethrough is smaller than that transmitted through a new banknote. The integrated value obtained by detecting the old banknote appears to indicate that its width is greater than it actually is (or the detecting apparatus erroneously detects that the old banknote does not have any damaged portion or puncture). The old banknote can be detected to have a width greater than the standard width, or to have no damaged portion or puncture, even if the old banknote has many damaged portions or punctures. 
     Another conventional skew detection apparatus is shown in FIG. 2. A pair of photosensors 13 and 15 are disposed in the direction perpendicular to the feeding direction indicated by arrow a and are spaced apart from one another. Skew detection is performed such that a time interval T sk  (sec) from the moment when one corner of the leading edge of the paper sheet P passes the first one of the photosensors 13 and 15 to the moment when the other corner of the leading edge of the paper sheet P passes the second one of the photosensors 13 and 15 is measured using a unit time interval T cp  (sec/m). Using the measured time interval T sk  (sec), a distance L A  (m) of the skewed paper sheet P is calculated from equation (I). Furthermore, using the obtained distance L A  (m) and a distance L B  (m) between the photosensors 13 and 15, a skew angle θ is calculated from equation (II) below: 
     
         L.sub.A =T.sub.sk /T.sub.cp                                (I) 
    
     
         θ=tan.sup.-1 (L.sub.A /L.sub.B)                      (II) 
    
     However, in the conventional skew detection apparatus described above, when the paper sheet P has a dog ear (B in FIG. 3) or a damaged corner, a large error occurs in the measured value. Therefore, highly precise and accurate skew measurement cannot be performed. 
     FIG. 4 shows a conventional dog ear detection apparatus. Light sources 17 and 19 radiate light beams from above the paper sheet P fed in the feeding direction indicated by arrow a. Photocells 21 and 23 respectively oppose the light sources 17 and 19 and sandwich the paper sheet P. The photocells 21 and 23 receive light beams from the light sources 17 and 19, respectively. Output signals from the photocells 21 and 23 are amplified by amplifiers 25 and 27, respectively. The amplified signals are then supplied to a processing circuit 29. The photocells 21 and 23 are disposed at the two side edges (i.e., the edges defining the width) of the paper sheet P in the direction perpendicular to the feeding direction indicated by arrow a. When the paper sheet P is fed under the light sources 17 and 19, the light beams from the light sources 17 and 19 are shielded in accordance with the size of the dog ear of the paper sheet P. At this time, the output signals from the photocells 21 and 23 are amplified by the amplifiers 25 and 27, respectively, and are then supplied to the processing circuit 29. The processing circuit 29 counts each output signal for a predetermined time interval to detect a folded size l. 
     However, in the dog ear detection apparatus of the type described above, when the paper sheet P is misaligned or when the sizes of the paper sheets differ slightly, the output signals from the photocells 21 and 23 will vary greatly, resulting in a large error in the count value. As shown in FIGS. 5A to 5D, misalignment and variation in the size of the paper sheet results in a change in the folded size l. Therefore, the detected folded size is determined to be smaller than the actual folded size. 
     SUMMARY OF THE INVENTION 
     It is, therefore, an object of the present invention to provide a profile and feeding state detection apparatus and method for very precisely detecting a profile, such as a width, and any damage, puncture or corner folding of a paper sheet, as well as feeding states such as skew and misalignment of the paper sheet. 
     In order to achieve the above object of the present invention, there is provided a profile and feeding state detection apparatus, comprising: 
     (a) a light source disposed above or below a paper sheet; 
     (b) an optical system opposing said light source through the paper sheet; 
     (c) a sensor disposed in a direction perpendicular to a feeding direction of the paper sheet, for scanning two detection areas which are split with respect to a center of feeding; and 
     (d) electronic processing circuit means for processing an output signal from the sensor. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     Other objects and features of the present invention will be apparent from the following description taken in connection with the accompanying drawings, in which: 
     FIG. 1 is a schematic view of a conventional profile and feeding state detection apparatus for a paper sheet; 
     FIGS. 2 and 3 show skew detection according to conventional methods; 
     FIG. 4 is a schematic view of a conventional dog ear detection apparatus; 
     FIGS. 5A to 5D show dog ear detection according to conventional techniques; 
     FIG. 6 is a schematic view of a profile and feeding state detection apparatus according to an exemplary embodiment of the present invention; 
     FIG. 7 is shows detection range and operation of a line sensor for detecting a width of the paper sheet; 
     FIG. 8 is a timing chart of a signal for showing a quantification method of the quantifier shown in FIG. 6; 
     FIG. 9 is a detailed block diagram of a processing circuit shown in FIG. 6; 
     FIGS. 10A through 10D are timing charts of timing signals produced by a timing signal generator shown in FIG. 9, in which FIG. 10A shows a timing signal T 1  which designates a first length A 1  shown in FIG. 7, FIG. 10B shows a timing signal T 2  which designates a second length A 2  shown in FIG. 7, FIG. 10C shows a timing signal T 3  which designates a third length A 3  shown in FIG. 7, and FIG. 10D shows an interrupt timing signal T4; 
     FIG. 11 shows the scanning state when the line sensor shown in FIG. 6 scans the paper sheet; 
     FIGS. 12A and 12B are flow charts showing the main routines executed by the CPU shown in FIG. 9; 
     FIGS. 12C to 12H are flow charts showing various subroutines shown in FIG. 12B, in which FIG. 12C shows a subroutine &#34;width determination&#34;, FIGS. 12D and 12E show a subroutine &#34;damage determination&#34;, FIG. 12F shows a subroutine &#34;skew determination I&#34;, FIG. 12G shows another subroutine &#34;skew determination II&#34;, FIG. 12H shows a subroutine &#34;misalignment determination&#34;, and 
     FIGS. 12I and 12J show a subroutine &#34;puncture determination&#34;; 
     FIG. 13 shows the scanning state of the line sensor for puncture detection; 
     FIG. 14 shows detection of the skew I in detail; 
     FIG. 15 shows detection of the skew II in detail; 
     FIG. 16A and 16B show discrimination of a damaged banknote and a banknote with a puncture; 
     FIG. 17 shows dog ear detection in detail; and 
     FIGS. 18A and 18B show a dog ear detection area. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
     Referring to FIG. 6, a paper sheet P such as a banknote is fed along the direction indicated by arrow a. A rod-shaped light source 31 such as a fluorescent lamp is disposed in the direction perpendicular to the feeding direction indicated by arrow a. The light source 31 radiates light beams onto the lower surface of the paper sheet P. The rod-shaped light source 31 has a sufficient length to cover length A 0  as shown in FIG. 7. An optical system 33 reduces an image of the paper sheet P to a ratio of 1/m. The image reduced in scale by the optical system 33 is focused on a line sensor 35. The line sensor 35 comprises a self-scan type photoelectric transducer having a number of solid-state image pickup elements which are linearly aligned in the direction perpendicular to the feeding direction indicated by arrow a. The line sensor 35 scans the length (range) A 0  in the direction indicated by arrow b. Therefore, the length A 0  corresponds to the detection range of the line sensor 35. The length A 0  is divided into first, second and third length (ranges) A 1 , A 2  and A 3 . The second length A 2  is located substantially at the central portion of the paper sheet P to be fed. The line sensor 35 is driven by a driver 37. A detector unit 39 detects the leading edge of the paper sheet P and supplies an output signal to a processing circuit 45 to be described later. The detector unit 39 comprises a light source 39a and a light-receiving element 39b and is located in a predetermined position in front of the line sensor 35 with respect to the feeding direction. The output signal from the line sensor 35 is amplified by an amplifier 41 and is then supplied to a quantizer 43. The quantizer 43 quantizes in units of bits the output signal which is produced by the line sensor 35 and amplified by the amplifier 41. In this case, as shown in FIG. 8, in which a signal waveform for one bit is enlarged, the quantizer 43 slices the output signal at a slice level (V pp  /2) corresponding to about one-half of an amplitude V pp  obtained by a change in the paper sheet P. Thus, quantized data is obtained. An output signal from the quantizer 43 is supplied to the processing circuit 45 which executes various types of different operations. 
     FIG. 9 is a detailed block diagram of the processing circuit 45 shown in FIG. 6. A timing generator 47 sequentially produces timing signals T 1 , T 2  and T 3  (FIGS. 10A to 10C) which respectively specify the first, second and third lengths A 1 , A 2  and A 3  (FIG. 7), in synchronism with each scanning of the line sensor 35. The timing generator 47 further produces an interrupt timing signal T 4  (FIG. 10D) at a time interval after the timing signal T 3  is produced and before the next timing signal T 1  is produced for the next scanning cycle. An AND gate 49 receives an output from the quantizer 43 and the timing signal T 1  and produces a signal of logic level &#34;1&#34; if they are both at logic level &#34;1&#34;. An AND gate 51 receives a signal which is produced by the quantizer 43 and inverted by an inverter 53, and the timing signal T 2 . If both input signals are at logic level &#34;1&#34;, the AND gate 51 produces a logic level &#34;1&#34; signal. An AND gate 55 receives the output from the quantizer and the timing signal T 3 . If both input signals are at logic level &#34;1&#34;, the AND gate 55 produces a logic level &#34;1&#34; signal. The output signals from the AND gates 49, 51 and 55 are supplied to first, second and third counters 57, 59 and 61, respectively. The first counter 57 corresponds to the first length A 1  shown in FIG. 1 and counts the output from the AND gate 49 to measure a length WW 1  (a length between the leading edge of the paper sheet P and the leading edge of the second area A 2 ) shown in FIG. 7. The second counter 59 corresponds to the second length A 2  shown in FIG. 7 and counts the output from the AND gate 51. When a puncture or hole H (FIG. 7) is present in the second length A 2  of the paper sheet P, the second counter 59 counts to measure a size WW4 of the hole H. The third counter 61 corresponds to the third length A 3  and counts the output from the AND gate 55 to measure a length WW 3  (the length from the trailing edge of the second length A 2   to the trailing edge of the paper sheet P) shown in FIG. 7. The output signals from the first, second and third counters 57, 59 and 61 are supplied to a data bus 67 through bus drivers 69, 71 and 73, respectively. The bus drivers 69, 71 and 73 are connected to a microcomputer 66 through an address bus 65. A random access memory (RAM) 75 for storing the contents of the first, second and third counters 57, 59 and 61 is connected to the data bus 67 and the address bus 65. A bus driver 77 for transferring the output signal from the detector unit 39 onto the data bus 67 is also connected to the data bus 67 and the address bus 65. The microcomputer 66 comprises a CPU 63, a read-only memory (ROM) 64 for storing the control program or operating system, and an I/O port 62. The microcomputer 66 may comprise an 8-bit microprocessor TMP 8085 AP (TOSHIBA Corporation, Japan). The microcomputer 66 is connected to the timing generator 47 and to the RAM 75 and the bus drivers 69, 71, 73 and 77 via the address bus 65 and the data bus 67, so as to execute various types of different operations. 
     The mode of operation of the profile and feeding state detection apparatus and method according to an embodiment of the present invention will be described with reference to FIGS. 12A to 12J. When the detection operation is started, in step 79, the CPU 63 determines whether or not the leading edge of the paper P is detected. In other words, the CPU 63 enables the bus driver 77 through the address bus 65 to fetch the output from the detector unit 39 across the data bus 67. The CPU 63 then checks in step 79 whether or not the output signal from the detector unit 39 is at a &#34;dark&#34; level, that is, a level obtained when the light beams from the light source 31 are interrupted by the paper sheet P. If the decision of step 79 is answered YES, that is, if it is determined that the paper sheet P is fed in the feeding direction indicated by arrow a and the leading edge of the paper sheet P is detected by the detector unit 39, the CPU 63 executes step 81. In step 81, a delay timer built into the CPU 63 is set, and the flow advances to step 83. In step 83 it is determined whether or not the delay time has timed out. If the delay time has timed out, the flow advances to step 85, and the number n (predetermined in accordance with the size of the paper sheet P to be processed) of scanning lines to be fetched is set. The line sensor 35 then starts scanning the paper sheet P. In general, folding and damage of the paper sheets frequently occur at the leading and trailing edge portions thereof. Therefore, data for such portions must not be used. Therefore, when the leading edge of the paper sheet P is detected, the delay timer is set. When a predetermined time interval t has elapsed, the number n of lines to be fetched is set, and line sensor 35 is scanned across the sheet. 
     As shown in FIG. 11, when the line sensor 35 starts scanning the paper sheet P from a position spaced apart from the leading edge of the paper sheet P by a predetermined distance l (corresponding to the predetermined time interval t), the line sensor 35 sequentially scans a first scanning line H 1 , a second scanning line H 2 , . . . , an nth scanning line H n  in the direction indicated by arrow b. Scan data of each line is then photoelectrically converted to electrical signals. In this case, a distance between two adjacent scanning lines is set to be 1 mm. Referring to FIG. 11, it can be seen that a portion B of the sheet shown there is damaged. The output signal from the line sensor 35 is amplified by the amplifier 41 and is then supplied to the quantizer 43. The amplified signal is quantized in units of bits in the quantizer 43. More specifically, when the output signal from the line sensor 35 is set to the &#34;dark&#34; level, the quantizer 43 produces a signal of logic level &#34;1&#34;. However, when the output signal from the line sensor 35 is set to the &#34;light&#34; level (a level obtained when the light beams from the light source 31 are not interrupted by the paper sheet P), the quantizer 43 produces a signal of logic level &#34;0&#34;. The above operation by the line sensor 35 is performed in units of bits. Thus, quantized signals of logic level &#34;1&#34; and of logic level &#34;0&#34; are supplied to the processing circuit 45. 
     In the processing circuit 45, since the timing generator 47 sequentially supplies the timing signals T 1 , T 2  and T 3  (FIGS. 10A to 10C) to the AND gates 49, 51 and 55, respectively, the first counter counts the output signal or the signal of logic level &#34;1&#34; from the quantizer 43 for a period during which the timing signal T 1  is ON, to measure the length WW 1  shown in FIG. 7. The second counter 59 counts the output or the signal of logic level &#34;1&#34; from the inverter 53 to measure the size WW 4  of hole H when the puncture of hole H is present during the time the timing signal T 2  is ON. Furthermore, the third counter 61 counts the output or the signal of logic level &#34;1&#34; from the quantizer 43 during the period the timing signal T 3  is ON to measure the length WW 3  shown in FIG. 7. When the interrupt timing signal T 4  shown in FIG. 10D is supplied from the timing generator 47 to the CPU 63, the CPU 63 executes step 87. In step 87, the contents (one-line data for each of lengths WW 1  and WW 3  and of size WW 4 ) of the first, second and third counters 57, 59 and 61 are read out and are fetched from the CPU 63. The CPU 63 enables the bus drivers 69, 71 and 73 via the address bus 65 to read out the contents of the first, second and third counters 57, 59 and 61, and fetches these contents. When the CPU 63 has fetched and stored the contents, it executes step 89. In step 89, the CPU 63 causes the one-line data for each of the lengths WW 1  and WW 3  and the size WW 3  to be stored in the RAM 75. Step 91 is then executed. Step 91 determines whether or not the number of lines to be fetched has reached n. If the decision of step 91, is answered NO, step 87 is reexecuted and the above operation is repeated. The three types of data for the lengths WW 1  and WW 3  and the size WW 4  are obtained for lines from the first scanning line H 1  to the nth scanning line H n  by means of the first, second and third counters 57, 59 and 61, respectively. When the three types of data are obtained, these pieces of data are fetched from the CPU 63 in response to the interrupt timing signal T 4  shown in FIG. 10D and are stored in the RAM 75. 
     When scanning is completed from the first scanning line H 1  to the nth scanning line H n  and when the number of lines to be fetched reaches n in step 91, the CPU 63 stops fetching and storing data and executes step 93. In step 93, the data for the length WW 1  and the data for the length WW 3  which correspond to each line are sequentially read out beginning with the data of the first scanning line H 1  and preceeding to that of the nth scanning line H n . In accordance with the set of readout data, widths W 1 , W 2 , . . . , W n  of the paper sheet P at the corresponding lines are obtained in step 95. Assume the scanning line be H i  (i=1 to n). Then, a width W i  of the scanning line Hi is given by the following equation. 
     
         W.sub.i =WW.sub.i1 +WW.sub.2 +WW.sub.i3                    (1) 
    
     where WW i1  is the length WW 1  of the scanning line H i , WW i3  is the length WW 3  of the scanning line H i , and WW 2   is a constant representing the length of the second area A 2  shown in FIG. 7. Therefore, 
     
         WW.sub.2 =C (C: constant) 
    
     Equation (1) can be rearranged in the following manner: 
     
         W.sub.i =C+WW.sub.i1 +WW.sub.i3                            (2) 
    
     Values of the width W i  can be obtained in the form of W 1 , W 2 , W 3 , . . . , W n  for each of the first scanning line H 1  to the nth scanning line H n . In step 95, the CPU 63 performs operations based on the following equations: ##EQU1## Using the above equations, the widths W 1 , W 2 , W 3 , . . . , W n  for each scanning line can be obtained. The CPU 63 then calls for subroutine &#34;width determination&#34; 97 to determine the final width W of the paper sheet P. 
     FIG. 12C is a flow chart of the &#34;width determination&#34; subroutine 97. In step 109, the CPU 63 clears a total memory M k  for obtaining the total value of the widths W i  numbering k (e.g., 15) which satisfy the condition to be described shortly. The flow advances to step 111. In step 111, 1 is respectively set in a counter C i  for counting the check frequency of each value or width of W 1 , W 2 , W 3 , . . . , W n  so as to select the width W i  which satisfies the condition to be described shortly, and in a counter C k  for counting the number k of W i  finally obtained. The CPU 63 then executes step 113, which determines whether each one W i  of the values (widths) W 1 , W 2 , W 3 , . . . , W n  obtained in step 95 satisfies the condition of equation (4) as follows: 
     
         W.sub.s -ΔW≦W.sub.i ≦W.sub.s +ΔW (4) 
    
     where W s  is the standard value or width of the paper sheet P, and ΔW Is the allowance including the manufacturing error and the measuring error of the paper sheet P. If the value or width W i  satisfies equation (4), the CPU 63 executes step 115. In step 115, the value or width W i  which satisfies equation (4) is added to the storage content of the total memory M k . The sum is then stored in the total memory M k . Further, the contents of the counter C k  are increased by one (incremented). The CPU 63 then executes step 117. However, if NO is the result in step 113, the CPU executes steps 117 instead. The values or widths W i  (e.g., W 1 ) of one scanning line H i  are thus completely checked. In step 117, the counts of the counters C i  are increased by one, and the CPU 63 executes step 119. In step 119 it is determined whether the count of the counter C i  is greater than n, that is, all the values or widths W 1 , W 2 , W 3 , . . . , W n  are checked. If the decision of step 119 is answered NO, that is, if C i  &gt;n is not true, all the values are not checked. The CPU 63 executes step 121. In step 121 it is determined whether the count of the counter C k  is greater than k, that is, whether the number of obtained values W i  which satisfy the above condition has reached k. If step 121 is answered NO, the number of obtained values W i  has not reached k, so that the flow returns to step 113. The above operation is then repeated. However, if the decision of step 121 is answered YES, that is, if the condition C k  &gt;k is true, the number of obtained values W i  has reached k (e.g., 15). The CPU 63 then executes step 123 to obtain the means value of the values W i  divided by k. The total of the values W i  numbering k is stored in the total memory M k . When the CPU 63 performs equation (5), the means value described above is obtained and is then defined as the final width W of the paper sheet P as follows: 
     
         M.sub.k /K=W                                               (5) 
    
     The values W i  numbering k which satisfy equation (4) are selected from among the widths W 1 , W 2 , W 3 , . . . , W n  which correspond to each line by step 95. The mean value of the values W i  divided by k is defined as the width W of the paper sheet P. If the condition C i  &gt;n is true as tested for by step 119, the values W i  which satisfy the above condition do not number k even if all the values W 1 , W 2 , W 3 , . . . , W n  have been checked. Therefore, in this case, the CPU 63 determines that a width detection error has occurred and then executes step 125. In step 125, data of the width detection error is stored, and the &#34;width determination&#34;  subroutine 97 is completed. 
     In the width detection procedure described above, the paper sheet P is scanned by the line sensor 35 with a predetermined frequency (n times) in the direction perpendicular to the feeding direction indicated by arrow a. Thus, a plurality of widths W 1 , W 2 , W 3 , . . . , W n  are measured by scanning the lines H 1 , H 2 , H 3 , . . . , H n  in the direction perpendicular to the feeding direction indicated by arrow a. As a result, the values W i  (i=1 to n) which satisfy equation (4) are selected to number k (e.g., 15). The mean value of the selected values W i  is determined to be the width W of the paper sheet P. Even if the paper sheet P has a dog ear and/or a damaged portion, and even if the paper sheet P varies in thickness and is solid, proper width detection is nevertheless performed. The detection area of the line sensor 35 is divided into a plurality of lengths (dimensions). A set of data (corresponding to the lengths WW 1  and WW 3 ) obtained from the respective lengths is used to perform predetermined operations to measure the values or widths W 1 , W 2 , W 3 , . . . , W n , so that highly precise measurement is performed and hence, accurate width detection can be performed. 
     Since the quantization level or the slice level of the quantizer 43 is constantly determined to be substantially one-half of an amplitude corresponding to a change in the paper sheet P, errors are substantially eliminated regardless of whether the paper sheet P is new or old. When the total of the first, second and third lengths A 1 , A 2  and A 3  is, for example, 100 mm and when the line sensor 35 comprises a capacity of 1,024 bits, the resolution along the direction of the scanning line is given by equation (6): 
     
         100 (mm)÷1024≈0.1 (mm)                         (6) 
    
     As is apparent from equation (6), highly precise detection can be achieved with a simple construction at low cost. Therefore, the above width detection is effectively performed even for a banknote which is very thin and easily soiled. 
     In the embodiment described above, the detection range of the line sensor is divided into three areas to improve the precision of the measured values. However, the detection rnage may be divided into more than three lengths. The resolution of the line sensor in the feeding direction and the resolution thereof in the scanning direction are 1 mm and 0.1 mm, respectively. These values may be arbitrarily changed in accordance with a required width measuring precision of the paper sheet to be detected. 
     FIGS. 12D and 12E show a &#34;damage determination&#34; subroutine 97 of the main routine. The &#34;damage determination&#34; subroutine will be described in detail hereinafter. In step 127, the CPU 63 checks all the values W 1 , W 2 , W 3 , . . . , W n  to execute the subroutine &#34;damage determination&#34;. In order to check the frequency, 1 is set in the counter C i . The CPU 63 then executes step 129. In step 129, the values W 1 , W 2 , W 3 , . . . , W n , that is, the values W i  (i=1 through n) obtained in step 95 are sequentially compared (W i  :W x ) with a reference value W x . The reference value W x  is used to determine whether or not the values W i  indicate a damaged portion in the X direction (FIG. 13); the reference value W x  is determined in advance in accordance with the size of the paper sheet P to be processed. If the measured value W i  is greater than or equal to the reference value W x , that is, if the condition W i  ≧W x  is established, the CPU 63 determines that no damaged portion is present in the ith scanning line H i  and then executes step 131. Step 131 determines whether or not a damaged portion is present in a scanning line H i-1 , which is one line ahead of the scanning line H i , by referring to the logic state (1 or 0) of a damage flag F. If the decision of step 131 is answered NO (F=logic level &#34;0&#34;), the CPU 63 executes step 133. Step 133 determines whether or not the count of the counter C i  is greater than n is checked, that is, whether all the values W 1 , W 2 , W 3 , . . . , W n  are checked. If it is determined that the count of the counter C i  is not greater than n, that is, the condition C i  &gt;n is not true, all the values W 1 , W 2 , W 3 , . . . , W n  have not yet been checked. The CPU 63 then executes step 135. In step 135, the count of the counter C i  is increased by one in order to check the value W i  of the next scanning line. The CPU 63 then re-executes step 129. The above operation is repeated to check the value W i  for the next scanning line. 
     In step 129, if the measured value W i  is smaller than the reference value W x , that is, if the condition W i  &lt;W x  is true, the CPU 63 determines that a damaged portion is present in the ith scanning line H i  and then executes step 137. In step 137, the same check as in step 131 is performed. As a result, if no damaged portion is present, that is, if the damage flag F is at logic level &#34;0&#34;, the CPU 63 executes step 139 to set the damage flag F. Thereafter, the CPU executes step 141. However, if the decision of step 137 is answered YES, that is, if it is determined that the damage flag F is at logic level &#34;1&#34;, the CPU 63 directly executes step 141. In step 141, the count of a damage counter CB for counting data of a width (width in the direction parallel to the feeding direction indicated by arrow a) of a damaged portion B shown in FIG. 13 is increased by one. The CPU 63 then executes step 133. The above operation is then repeated. 
     In this manner, values or widths W 1 , W 2 , W 3 , . . . , W n  for each scanning line which are obtained in step 95 are sequentially checked. When any value W i  which is smaller than the reference value W x  is obtained for the first time, the damage flag F is set, and the count of the damage counter C B  is increased by one. Thereafter, each time a value W i  which is smaller than the reference value W x  is obtained, the count of the damage counter C B  is incremented. Therefore, when the condition W i  ≧W x  is true in step 129 after the damage flag F is set, the damage flag F is determined to be at logic level &#34;1&#34; in step 131. Therefore, the flow advances from step 131 to step 143. In step 143, the count of the damage counter C B  is compared with a reference value W y . The reference value W y  is set to determine whether or not a damaged portion is present. As a result of the comparison described above, if it is determined that the count of the counter C B  is smaller than the reference value W y , that is, if it is determined that the condition C B  &lt;W y  is established, the CPU 63 determines that no damaged portion is present. The CPU 63 then executes step 145. In step 145, the damage flag F and the damage counter C B  are reset, and the CPU 63 then executes step 133. The above operation is repeated. However, if in step 143 it is determined that the count of the counter C B  is greater than or equal to the reference value W y , that is, if it is determined that the condition C B  ≧W y  is true, the CPU 63 finally determines that a damaged portion B is present in the paper sheet P which is currently being checked. The CPU 63 then executes step 147 and stores data indicating that the damaged portion B is present in the paper sheet which is currently being checked. The &#34;damage determination&#34; subroutine is completed at this point. If it is determined in step 133 that the condition C i  &gt;n is true, the CPU 63 determines that all the values W 1 , W 2 , W 3 , . . . , W n  are checked and the damaged portion B is not present in the paper sheet P. The CPU 63 then executes step 149 and stores data indicating the absence of the damaged portion. The &#34;damage determination&#34; subroutine 99 is then finished. 
     FIG. 12F shows a &#34;skew determination&#34; subroutine 101 which will be described in detail hereinafter. Two pieces of data which respectively correspond to the predetermined scanning lines at two points spaced apart by a predetermined distance are stored in counters C M  and C N  to obtain two measured values W i  at the two points spaced apart by the predetermined distance. These two measured values W i  are selected from the values W 1 , W 2 , W 3 , . . . , W n  obtained in step 95 to perform skew detection. For example, assuming the number n of scanning lines to be fetched is 180 (n=180), data &#34;30&#34; is stored in the counter C M , while data &#34;120&#34; is stored in the counter C N . As shown in FIG. 14, the 30th scanning line H 30  and the 120th scanning line H 120  of the paper sheet P are selected. The CPU then executes step 153 in which measured values W 30  and W 120  at the scanning lines H 30  and H 120  respectively corresponding to the counts of the counters C M  and C N  are selected from the values W 2 , W 2 , W 3 , . . . , W n  obtained in step 95. The CPU 63 then executes step 155. Step 155 determines whether or not the measured values W 30  and W 120  fall within an allowance, that is, whether the measured values W 30  and W 120  satisfy equations (7) below: ##EQU2## where W s  is the standard value (width) of the paper sheet P, and ΔW is an allowance to cover both the manufacturing error and the measuring error of the paper sheet P. If the measured value W 30  and W 120  do not satisfy equations (7), they do not fall within the tolerable allowance. Therefore, in this case, the CPU 63 executes step 157 to check the following measured values W 31  and W 121 . In step 157, the counts of the counters C M  and C N  are respectively increased by one, and the CPU 63 then re-executes step 153. The above operation is then repeated. In step 153, the CPU 63 selects the measured values W 31  and W 121 . In step 155, the CPU 63 then checks the measured values W 31  and W 121 . 
     In step 155, if it is determined that the measured values that test satisfy equations (7), the CPU 63 executes step 159. In step 159, the two measured values used in step 95 to obtain the values W 30  and W 120 , that is, values or widths W 301  and W 1201  (FIG. 14) in the first length A 1  (the upper portion of the paper sheet P) and values or widths W 303  and W 1203  (FIG. 14) in the third length A 3  (the lower portion of the paper sheet P), are read out from the RAM 75. Thereafter, the CPU 63 executes step 161. In step 161, using the readout values, subtraction is performed as in equations (8) so as to obtain an upper skew distance L U  and a lower skew distance L L  : ##EQU3## The upper skew distance L U  corresponds to an upper skew amount, and the lower skew distance L L  corresponds to a lower skew amount, as shown in FIG. 14. In this manner, only when the values satisfy equations (7), that is, only when the two measured values W 30  and W 120  fall within the allowance, is subtraction performed as in equations (8) to measure the upper skew distance L U  and the lower skew distance L L . These measured values are defined as valid values. Therefore, even if a damaged portion is present in the paper sheet P, the measured values are not adversely affected by the presence of the damaged portion. 
     When the upper and lower skew amounts are determined as described above, the CPU 63 executes step 163. In step 163, the upper skew distance L U  corresponding to the upper skew amount is compared (L U  :L L ) with the lower skew distance L L  corresponding to the lower skew amount. If it is determined that the upper skew distance L U  is smaller than or equal to the lower skew distance L L , that is, if it is determined that the condition L U  ≦L L  is established, the CPU 63 executes step 165. In step 165, the CPU 63 determines that the upper skew distance L U  is defined as a final skew amount L E . Thereafter, the CPU 63 executes step 167. However, if in step 163 it is determined that the upper skew distance L U  is greater than the lower skew distance L L , that is, if it is determined that the condition L U  &gt;L L  is established, the CPU 63 executes step 169. In step 169, the CPU 63 determines that the lower skew distance L L  is defined as the final skew amount L E . Thereafter, the CPU executes step 167. As described above, the smaller one of the upper and lower skew distances L U  and L L  is defined as the final skew amount L E . Therefore, even if the paper sheet P has a dog ear or a damaged portion, erroneous detection due to the presence of the dog ear or the damaged portion can be prevented. In step 167, the final skew amount L E  is compared (L E  :L R ) with a reference value L R  (a reference value set so as to determine whether or not the sheet is skewed). If it is determined that the final skew amount L E  is greater than or equal to the reference value L R , that is, if it is determined that the condition L E  ≧L R  is true, the CPU 63 finally determines that the paper sheet P which is currently being checked is skewed. The CPU 63 executes step 171 and stores data indicating that the paper sheet P is skewed, and &#34;skew determination&#34; subroutine 101 is completed. However, if step 167 determines that the final skew amount L E  is smaller than the reference value L R , that is, if it is determined that the condition L E  &lt;L R  is true, the CPU 63 finally determines that the paper sheet P is not skewed. The CPU 63 then executes step 173 and stores data indicating the determination of an absence of skew and the &#34;skew determination&#34; subroutine 101 is completed. 
     According to the skew detection procedures described above, the paper sheet P is scanned n times by the line sensor 35 in the direction perpendicular to the feeding direction. A plurality of values or widths W 1 , W 2 , W 3 , . . . , W n  are obtained corresponding to the n scans in the direction perpendicular to the feeding direction. Two different values, selected from the plurality of values or widths W 1 , W 2 , W 3 , . . . , W n  correspond to two points on the paper sheet P which are spaced apart from one another. These two values are checked to see whether or not they satisfy equations (7). Only if it is determined that these two values satisfy equations (7) is subtraction performed, using equations (8), to obtain skew distances L U  and L L  at the two edges located perpendicular to the feeding direction of the paper sheet P. The smaller of the skew distances L U   and L L  is finally defined as the final skew amount L E . By comparing the final skew amount L E  with the reference value L R , the presence or absence of skew is detected. Therefore, even if the paper sheet P has a dog ear or a damaged portion, erroneous detection due to such defects can be properly prevented, and highly precise skew detection can be performed. 
     As described above, only when the two measured values satisfy equations (6), that is, only when they fall within the allowable range, is subtraction performed using equations (7) to obtain the upper and lower skew distances L U  and L L , thereby verifying these measured values. Thus, if a damaged portion is present in the paper sheet P, the adverse effects of the damage will be prevented. Further, since the smaller value between the upper and lower skew distance L U  and L L  is defined as the final skew amount L E , erroneous detection is also prevented even if the paper sheet P has a dog ear or a damaged portion. 
     In the embodiment described above, skew detection is performed by obtaining skew distances L U  and L L . However, angles may be used in place of skew distances to perform skew detection. A case will be described with reference to FIGS. 12G and 15 in which skew angles are used in place of skew distances. The flow chart shown in FIG. 12G is substantially the same as that shown in FIG. 12F, except that step 175 is added between steps 161 and 163, and steps 163 to 167 are different. Only these steps of the sequence will be described, and a description of the remaining steps is omitted. In step 175, the values corresponding to the distances L U  and L L  are inserted into equations (9) shown below to obtain an upper skew angle θ U  and a lower skew angle θ L  : ##EQU4## where L C  is the predetermined distance between the 30th scanning line H30 and the 120th scanning line H120 (FIG. 15). The upper skew angle θ U  is defined as the upper skew amount, and the lower skew angle 74  L  is defined as the lower skew amount, as shown in FIG. 15. Then, after the upper and lower skew angles θ U  and θ L  are obtained, the CPU 63 executes step 163. In step 163, the upper skew angle θ U  is compared (θ U  :θ L ) with the lower skew angle θ L . If it is determined that the condition θ U  ≦θ L  is true, the CPU 63 executes step 165 to define the upper skew angle θ U  as the final skew value θ E , and the CPU executes step 167. However, if in step 163 it is determined that the condition θ U  &gt;θ L  is true, the CPU 169 executes step 169 to define the lower skew angle θ L  as the final skew value θ E . Thereafter, the CPU 63 executes step 167. In step 167, the final skew value θ E  is compared (θ E  :θ R ) with a reference value θ R  (a preset value to determine whether or not the presence of skew is detected, and, in this case, a preset value of 3°). If it is determined that the condition θ E  ≧θ R  is true, the CPU 63 determines that the sheet is skewed. However, if it is determined that the condition θ E  &lt;θ R  is true, the CPU 63 determines that the sheet is not skewed. In the following steps, the same operations as those shown in the flow chart in FIG. 12F are performed. The same effect as the embodiment of the present invention described above can be obtained. Further, since the measured skew values are represented by angles, the values can be visually displayed to signal accurate skew values to the operator. 
     In the embodiment described above, skew detection is performed by detecting the skew values at the two long sides of the paper sheet P which are perpendicular to the feeding direction. However, the above skew detection need not be performed by obtaining the skew values for both of the two long sides, but may be performed by obtaining a skew value for only one of the two long sides. In the embodiment described above, the detection range of the line sensor is divided into three lengths so as to easily process the measured values in the CPU and to improve measurement precision. However, as needed, the detection lengths may be arbitrarily determined in accordance with the size of the paper sheet or the number of bits of the line sensor. Furthermore, the resolution of the line sensor 35 in the feeding direction and in the scanning direction perpendicular thereto is predetermined to be 1 mm and 0.1 mm, respectively in the preferred embodiment. However, these values can be arbitrarily determined in accordance with the degree of precision of the skew values of the paper sheet to be detected. 
     FIG. 12H shows the &#34;misalignment determination&#34; subroutine 103 which will be described in detail hereinafter. 
     In step 177, the CPU 63 clears total memories W 1sm  and W 3sm  for combining 16 pieces of data for each of widths or values W n1  and W n3 , and also clears parameter counters i and k. The CPU 63 then executes step 179. Step 179 checks whether or not the width or value W i  corresponding to the count of the parameter counter i falls within the standard value. If the answer to the decision of step 179 is YES, the CPU executes step 181. In step 181, values or widths W i1  and W i3  are respectively added to storage contents in the total memories W 1sm  and W 3sm . The count of the parameter counter k is also increased by one. Thereafter, the CPU 63 executes step 183. If the answer to the decision of step 179 is NO, the CPU 63 executes step 183. The count of the parameter counter i is increased by one in step 183, and the CPU executes step 185. 185 checks whether or not the parameter i is greater than n, that is, whether all the values W 11  , W 21 , . . . , W n1  and W 13 , W 23 , . . . , W n3  have been checked. If the answer to the decision of step 185 is NO, then all the values W 11 , W 21 , . . . , W n1  and W 13 , W 23 , . . . , W n3  have been checked. The CPU 63 then executes step 187. 
     Step 187 checks whether or not the count of the parameter counter k is greater than 16. If the answer to the decision of step 187 is YES, the number of values W i  which satisfy the standard values is greater than 16. Thus, sufficient data has been accumulated to determine misalignment. 
     Since data of the total (=W 1sM ) of 16 values W 11  and data of the total (=W 3sM ) of 16 values W 13  are stored in the total memories, these total are respectively divided by 16 to obtain mean values W 1s  and W 3s  in step 189. Thereafter, the CPU 63 executes step 191. In step 191, an absolute value of a difference between the mean values W 1s  and W 3s  is calculated and is defined as a misalignment value S L . 
     Step 193 determines whether or not the misalignment value S L  falls within the standard value. If the answer to the decision performed by step 193 is YES, the &#34;misalignment determination&#34; subroutine 103 is completed. 
     The width W obtained in the subroutine shown in FIG. 12C can also be obtained by the following equation; 
     
         W=C+W.sub.1s +W.sub.3s                                     (10) 
    
     Equation (10) indicates a slightly advanced technique for width detection, as compared with the width detection shown in FIG. 12C. The width can thus be detected in the process of misalignment detection. 
     According to the misalignment detection described above, the paper sheet P currently being fed is scanned n times by the line sensor 35 in the direction perpendicular to the feeding direction. A plurality of widths W 1 , W 2 , W 3 , . . . , W n  are measured in the direction perpendicular to the feeding direction. The values W i  (i=1 to n) numbering k (e.g., 16) which satisfy equation (4) are selected from the measured values W 1 , W 2 , W 3 , . . . , W n . The mean values of the values W i1  and W i3  are defined as mean values between the right and left edges of the paper sheet P. Thus, proper misalignment detection can be performed even if the paper sheet P has a dog ear or a damaged portion and, further, even if the paper sheet P varies in thickness and is dirty. Furthermore, the detection range of the line sensor 35 is divided into a plurality of lengths (ranges), and the pieces of data which correspond to the lengths WW 1  and WW 3  obtained from these lengths are computed in a predetermined manner so as to measure the values W 1 , W 2 , W 3 , . . . W n . Therefore, highly precise measured values can be obtained, and hence, highly precise detection can be performed. 
     FIGS. 12I and 12J show the &#34;puncture determination&#34; subroutine 105 for detecting the presence of a puncture or hole, which will now be described in detail. 
     The count of a scan counter i and the count of a feeding direction counter H YC  are cleared in step 199. The value stored by the feeding direction counter is increased (incremented) when an amount W 4  of light passing through the puncture or hole is higher than an allowable reference level H XL . The CPU then executes step 201. The count of the scan counter i is incremented by 1, and the CPU 63 executes step 203. The CPU 63 checks in step 203 whether or not the number n of scans (predetermined for the puncture check) is greater than the count of the counter i. If it is determined that the condition i&gt;n is true, all the values have checked and the subroutine is ended. If not, in step 205, if it is determined that the condition W i4  &gt;H XL  is true, a puncture or hole is determined to be present in the paper sheet P. The CPU 63 then executes steps 221 and 223 to be described later and further executes step 207. In step 207, the count of the counter H YC  is increased by one. The CPU 63 then re-executes step 201 to check the next scanning line. 
     However, when the condition W i4  ≦HXL is true, it is determined that no puncture or hole is present in the paper sheet P. The CPU 63 then executes step 209 to check the previous determination of the presence or absence of a puncture, or whether the puncture or hole has been determined to be not present. 
     If the decision performed by step 209 is answered YES, or if the condition H YC  =0 is established, any puncture or hole continues to the scanning line currently being checked, so that the CPU 63 re-executes step 201. In step 201, the CPU 63 checks the next scanning line. 
     However, if the answer to the decision of step 209 is NO, or if the condition H YC  ≠0 is true, the puncture or hole is present immediately before the scanning line currently being checked. Therefore, in step 211, the CPU 63 checks the count of the counter H YC . 
     In step 211, the count of the counter H YC  is compared with a first level H L1  for puncture determination. If it is determined that the condition H YC  &lt;H L1  is true, a puncture or hole is present in the X direction and is continuously formed in the Y direction. The size of the puncture is within an allowable range, so that the CPU 63 determines that no puncture present. The CPU 63 then executes step 217 which clears the counter H YC . The CPU 63 then re-executes step 201 to check the next scanning line. However, if it is determined in step 211 that the condition H YC  ≧H L1  is true, the count of the counter H YC  is compared with a second level H L2  for puncture determination in step 213. 
     In step 213, if it is determined that the condition H L1  ≦H YC  ≦H L2  is true, the counter H YC  is cleared. Then, a &#34;mutilated sheet&#34; flag is set to determine a nonusable banknote when the banknote inspection apparatus is used. However, it is not certain at this stage if all the required areas of the paper sheet P have been checked. A large puncture or hole may yet be present to satisfy the condition H YC  &gt;H L2 . Therefore, the CPU 63 re-executes step 201 to check the next scanning line. However, if it is determined that the condition H YC  &gt;H L2  is true, the counter H YC  is cleared. Furthermore, if the mutilated sheet flag is set, a rejected sheet flag is also set. In this case, the presence of a puncture need not be checked further and the subroutine &#34;puncture determination&#34; is ended. The above-mentioned series of operations allows highly precise puncture detection. 
     FIGS. 16A and 16B demonstrate the distinction between a banknote having a damaged portion and a banknote having a puncture. When a damaged banknote is checked, the levels of the line sensor change in a sequence of light, dark and light. However, when a banknote having a puncture is checked, at least one of the scanning lines indicates a sequence of dark, light and dark. CPU 63 executes steps 221 and 223 to distinguish a puncture from a damaged portion. When the presence of a puncture of the size or length W i4  is detected in step 205, as shown in FIG. 12I, and when lengths W i1  and W i3  are not 0 respectively in steps 221 and 223, the levels change in the sequence of dark, light and dark. Thus, a puncture is determined to exist. In steps 221 and 223, if only one of the lengths W i1  and W i3  is 0, the CPU 63 determines that only a damaged portion is present in the paper sheet. 
     FIG. 17 demonstrates a dog ear or bent edge determination system in detail. The detection lengths (ranges) used for detecting the dog ears number four in the preferred embodiment, as shown in FIG. 17. These detection lengths are indicated by lengths X and Y, respectively, in the directions perpendicular and parallel to the feeding direction. The length X corresponds to the first and third lengths A1 and A3. Widths adjacent to the dog ear detection areas are obtained by equation (3). If the measured widths fall within the allowable range, the obtained values W i1 , W i3 , W m1  and W m3  are stored in the memory. However, if the measured widths do not fall within this range, that is, if the widths are short due to the presence of a damaged portion or puncture, these values are not stored. When the resolution of the line sensor in the feeding direction is 1 mm, Y=16 mm. A standard area S F1  is selected in a portion spaced apart from the leading edge of the paper sheet P by the length Y (i=20 mm in FIG. 17). Only when widths measured from the position spaced apart from the leading edge of the paper sheet by 20 mm fall within the allowance, 16 values of widths of the 16 scanning lines are added. The sum is used to measure the standard area S F1 . A standard area S F3  is also obtained in the same manner as described above. A standard area S B1  is obtained in the following manner: if widths measured from the position (corresponding to the nth scanning line H n ) spaced apart from the trailing edge of the paper sheet by 20 mm fall within the allowable range, 16 values of widths of the 16 scanning lines are added to obtain a sum which is used to obtain the standard area S B1 . A standard area S B3  is obtained in the same manner as described above. Referring to FIG. 11, if the leading and trailing edges of the paper sheet are defined to correspond to H l  and H n , respectively, dog ear amounts DE F1 , DE F3 , DE B1  and DE B3  are given by following equations: ##EQU5## Thus, obtained dog ear amounts DE F1 , DE F3 , DE B1 , and DE B3  are compared with the dog ear determination level. If the amounts do not fall within the allowance, these values are rejected. FIGS. 18A and 18B are views showing dog ear detection areas. FIG. 18A shows a case in which even if the paper sheet P is misaligned to the right, the determination of dog ear amount DE F1  may not be adversely affected by such misalignment and may not be changed. FIG. 18B shows a case in which a large paper sheet (right) and a small paper sheet (left) are used. The dog ear amounts of these paper sheets are the same. As a result, highly precise dog ear detection can be provided.