Abstract:
Disclosed are a valuable-file identifying method and an identifying device thereof. The identifying method and the identifying device store image data of a valuable file using a fast storage method for image data. The fast storage method for image data comprises: compulsively converting collected single-byte image data into long-integer image data; using N data masks which correspond to each other through a “bitwise AND” operation to extract the long-integer image data in such a manner that N points are extracted from M*N points in each line and one point is extracted from L points in each column, where N is an integer greater than or equal to 2, L and M are all integers greater than or equal to 1; and integrating the data extracted respectively by N data masks through a “bitwise OR” operation to obtain coded image data and store same. In conclusion, the present invention converts single-byte image data into long-integer image data, and extracts multipoint data at one time using a plurality of data masks which correspond to each other, reducing the number of operations, and achieving fast, compressed storage of images.

Description:
[0001]    This application claims the priority of Chinese Patent Application No. 201110380229.9, entitled “FAST STORAGE METHOD OF IMAGE DATA, SECURITY DOCUMENT IDENTIFICATION METHOD AND APPARATUS”, filed on Nov. 24, 2011 with Chinese Patent Office, which is incorporated herein by reference in its entirety. 
       FIELD OF THE INVENTION 
       [0002]    The present invention relates to an fast storage method of image data, and in particular to an fast storage method of image data which can quickly compress and store the image data and a security document identification method and apparatus for storing an image data of the security document by the above mentioned fast storage method of the image data. 
       BACKGROUND OF THE INVENTION 
       [0003]    For a security document identification apparatus, there is commonly a difficulty in the storage of a sample image. The key problem is that since the data volume of the sample image is large and the identification apparatus has to operate fast and continuously, the time for storage is short. An ordinary teller machine processes eight security documents per second, the average processing time for each of the security documents is 125 ms, the overhead of the system is about 20 ms, the time for the serial port communication is 15 ms, the sample images are collected in parallel which cost about 10 ms in the total CPU time, therefore the remaining time is about: 125 ms-20 ms-15 ms-10 ms=80 ms. Based on a TMS320 platform with the frequency of 600MCPU, the time for identifying the security documents (including category, denomination, orientation, counterfeit, serial number) is about 65 ms, and thus the time for storing the sample image must be controlled in less than 15 ms. It is needed to store at least three sample images so as to store complete image information. Now it is assumed that, among the three sample images, one image is a white light sample image with a resolution of 480*800, another image is an infrared sample image with a resolution of 240*400, and a third image is a transmission sample image with a resolution of 240*400. In the white light sample image, the resolution of 480*800 is only used for the serial number area. The resolution of 240*400 is actually used. Therefore, it may be chosen to store all of the three sample images, or to convert the white light sample image into an image with the resolution of 240*400 and then store the three images with the resolution of 240*400. In the case of the storage in accordance with the existing two methods, the time-consuming is as follows: 
         [0004]    1. if the image is stored point-by-point, the total number of operations is 240*400+240*400+480*800=576,000. In the off-chip storage based on the TMS320 platform of 600MCPU frequency, the three images are stored as images with the resolution of 240*400. That is to say, the two images with middle resolution are directly stored; and for the image with high resolution, one row is stored every two rows and one column is stored every two column, so that the data volume of the image with high resolution is a quarter of the original data volume. In this way, the storage time is about 70 ms (the image resolution conversion and storage are performed simultaneously) and is still far slower than 15 ms. 
         [0005]    2. If a mass of images is copied, namely if a basic function of C language, i.e. the memcpy function, is used, the storage time is about 18 ms and still can not meet the requirement. It is disadvantage that this function requires continuous occupation of CPU which can not be interrupted. The continuous occupation conflicts with the image collection. The copy of a large amount of data may cause that the image collection is completely disordered and the system is broken down. 
         [0006]    In summary, the use of the traditional image storage method is unable to meet the requirement to store the three high-resolution images in 15 ms, which even breaks the system down. Therefore, if the images need to be stored, it is only possible to reduce the identification speed of the device or decrease the functions of identification of the device. 
         [0007]    Therefore, a method which can fast store the image data is needed to solve the above mentioned problem. 
       SUMMARY OF THE INVENTION 
       [0008]    The object of the invention is to provide a fast storage method of image data which is used to fast store the image data. 
         [0009]    Another object of the invention is to provide a security document identification method for fast storing image data of a collected security document. 
         [0010]    Yet another object of the invention is to provide a security document identification apparatus for fast storing an image data of a collected security document. 
         [0011]    In order to achieve the above mentioned objects, the disclosure provides a fast storage method of image data which is used to compress and store the image data of a security document collected during the identification of the security document, including: (A1) obtaining long integer type image data; (A2) extracting the long integer type image data by using N mutually corresponding data masks via a “bitwise AND” operation, wherein extraction step comprises: extracting M points from M*N points of each row and extracting one point from L points of each column, wherein N is an integer greater than or equal to 2, L and M are integers greater than or equal to 1; (A3) performing a “bitwise OR” operation for the data extracted respectively by the N data masks, so as to obtain and store coded image data. Generally, the image data directly collected by a security document identification apparatus is single-byte image data, and therefore it is needed to forcibly convert the collected single-byte image data into long integer type image data before the storage. 
         [0012]    Preferably, the step (A2) further includes: dividing the long integer type image data into N parts equally, and extracting the long integer type image data in the N parts by using the N mutually corresponding data masks via the “bitwise AND” operation respectively. 
         [0013]    In order to achieve another object of the invention, the invention further provides a security document identification method for identifying a current security document, including: (B 1) collecting sample images of the current security document and obtaining corresponding image data; (B2) performing a security document identification based on the image data of the current security document, so as to obtain an identification data of the security document; (B3) forcibly converting the collected image data into long integer type image data; and (B4) compressing and storing the converted data image by using the image data fast storage method. 
         [0014]    Preferably, before the step (B 1), it is detected whether the current security document enters a sampling area; if yes, the image data is collected; else the detection is continuously performed. In this way, the invention can perform automatic detection without an artificial operation. 
         [0015]    Preferably, the sample images include an infrared sample image, a transmission sample image and a white light sample image, and the step (B4) specifically comprises: directly storing the long integer type image data of the infrared sample image and the transmission sample image, and storing the long integer type image data of the white light sample image by using the fast storage method of the image data. In order to store complete image information, the infrared sample image, the transmission sample image and the white light sample image are often required. However, since the resolutions of the infrared sample image and the transmission sample image are not high, their image data can already be stored in a faster speed after their image data is converted to the long integer type image data. For example, in the case that an 8-byte data type is used to store an infrared sample image of 240*400 pixels, only 135 clock cycles are needed, the speed becomes nearly eight times faster, therefore the infrared sample image no need to be compressed before the storage. However, the pixel of the long integer type image of the white light sample image are relative larger, it is not sufficient to store the converted long integer type image data in the desired speed, and there is also a need for the compression operation so as to achieve the fast storage. 
         [0016]    Preferably, the security document identification method according to the invention further includes: (B5) recovering the compressed and stored image data to obtain a decompressed image data; and (B6) determining whether the current security document is counterfeit according to the image data of the current security document to further obtain identification data of the security document. The identification and authenticity of the security document needs to recover the compressed and stored image data to obtain the decompressed image data, rather than are performed directly based on the compressed and stored image data. The identification data of the security document includes information such as the type, denomination, orientation, sequence number and authenticity of the current security document. Particularly, the serial number information of the current security document may be identified according to the image data of the collected white light sample image, and other identification data, such as the authenticity information of the current security document may be analyzed by using the stored image data. Therefore, the invention also needs to decompress the compressed and stored image data. The step (B5) specifically includes: calculating data of each pixel point of the decompressed image template based on the size data of the decompressed image template and the compressed and stored image data, so as to obtain the decompressed image data. 
         [0017]    The invention also provides a corresponding security document identification apparatus for identifying a current security document. The apparatus includes a collecting module, an identification module, a compression module and a storage module. The collecting module is adapted to collect sample images of a current security document and obtain corresponding image data; an identification module is adapted to perform a security document identification based on the image data of the current security document, so as to obtain identification data of the security document; the compression module includes a conversion unit and an encoding unit, wherein the conversion unit forcibly converts the collected image data into long integer type image data; and the encoding unit extracts the long integer type image data by using N mutually corresponding data masks via a “bitwise AND” operation respectively, and then performs a “bitwise OR” operation for the data extracted respectively by the N data masks so as to obtain and store coded image data, wherein the extraction method includes extracting M points from M*N points of each row and extracting one point from L points of each column, wherein N is an integer greater than or equal to 2, L and M are integers greater than or equal to 1; and the storage module is adapted to store the data. 
         [0018]    Preferably, the encoding unit is adapted to divide the long integer type image data into N parts equally, and extracting the long integer type image data in the N parts by using the N mutually corresponding data masks via the “bitwise AND” operation respectively. 
         [0019]    Preferably, the security document identification apparatus further includes a decompression module adapted to recover the encoded image data to obtain decompressed image data. 
         [0020]    Preferably, the collecting module is a contact image sensor. The contact image sensor can detect whether the current security document enters a sampling area, and collect the image data if the current security document enters the sampling area and continuously detect if the current security document does not enter the sampling area. 
         [0021]    Compared with the prior art, in the fast storage method of the image data according to the invention, data of multiple points are extracted at one time by using the multiple mutually corresponding data masks via the “bitwise AND” operations for many times, then the extracted data is re-encoded via the “bitwise OR” operation once, and then the obtained coded image data is stored, so that the times of the operations are greatly reduced and the fast compression and storage of the image data are achieved. Correspondingly, the processing time for the security document identification method and the security document identification apparatus for storing image data of a security document by using the above mentioned image data fast storage method is improved, and the system overhead of the security document identification apparatus is reduced. On the other hand, in the security document identification method and the security document identification apparatus according to the invention, the collected single-byte image data is forcibly converted into the long integer type image data instead of the traditional single-byte storage, so that the times of the operations are reduced and the speed of the storage of the image data is further improved. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0022]      FIG. 1  is a flow chart of a security document identification method according to the invention; 
           [0023]      FIG. 2  is a flow chart of an fast storage method of image data according to the invention; 
           [0024]      FIG. 3  is a structural block diagram of a security document identification apparatus according to the invention; 
           [0025]      FIG. 4   a  is a schematic diagram of a white light sample image before the compression according to the invention; 
           [0026]      FIG. 4   b  is a schematic diagram of a white light sample image after the compression according to the invention; and 
           [0027]      FIG. 4   c  is a schematic diagram of a white light sample image after the decompression according to the invention. 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
       [0028]    In order to describe in detail the technical content, the structural characteristics, the achieved object and effect of the invention, a detailed description will be given in conjunction with embodiments and the accompanying drawings as follows. 
         [0029]    Reference is made to  FIG. 1 . A security document identification method  100  according to the invention includes: ( 11 ) collecting sample images of a current security document and obtaining corresponding image data; ( 12 ) performing a security document identification based on the image data of the current security document; ( 13 ) forcibly converting the collected image data into long integer type image data; ( 14 ) compressing and storing the converted data image by using an fast storage method  200  of the image data; ( 15 ) recovering the compressed and stored image data; and ( 16 ) judging the authenticity of the current security document based on the decompressed image data. Preferably, before the step ( 11 ), it is detected whether the current security document enters a sampling area; and if yes, the image data is collected; else, the detection is continuously performed, so that the invention can perform automatic detection without an artificial operation. 
         [0030]    Reference is made to  FIG. 2 . The fast storage method  200  of the image data includes: ( 21 ) obtaining long integer type image data, and dividing the long integer type image data into N parts equally; ( 22 ) extracting the long integer type image data in the N partitions by using N mutually corresponding data masks via the “bitwise AND” operation respectively, in which the method for the extracting is to extract M points from M*N points of each row and extract one point from L points of each column, and where N is an integer greater than or equal to 2, L and M are integers greater than or equal to 1; ( 23 ) performing a “bitwise OR” operation for the data extracted respectively by the N data masks, so as to obtain and store coded image data. 
         [0031]    Referring to  FIG. 3 , the security document identification apparatus  300  includes a collecting module  31 , an identification module  32 , a compression module  33  and a storage module  34  and a decompression module  35 . The collecting module  31  collects sample images of a current security document and obtains corresponding image data S p . The identification module  32  performs a security document identification based on the image data of the current security document, so as to obtain and output (to a display or an alarming apparatus, for example) identification data S i  of the security document. The compression module  33  forcibly converts the collected image data S p  into long integer type image data S 1 , and performs a compression operation (extracting and recoding operations) on the long integer type image data S 1 , so as to obtain and store coded image data S c . The decompression module  35  is recovers the encoded image data S c  to obtain decompressed image data S d . The storage module  34  is adapted to store the data. Particularly, the collecting module  31  is a contact image sensor. The contact image sensor can detect whether the current security document enters a sampling area, and collect the image data if the current security document enters the sampling area, else continuously detect, so that the invention can perform automatic detection without an artificial operation. 
         [0032]    Referring to  FIG. 3 , the compression module  33  may include a conversion unit  331  and an encoding unit  332 . The conversion unit  331  forcibly converts the collected image data S p  into long integer type image data S i . The coding unit  332  divides the long integer type image data S i  equally into N parts, where N is an integer equal to or greater than 2; and the coding unit  332  extracts the long integer type image data in the N parts by using the N mutually corresponding data masks via the “bitwise AND” operation and then integrates the data extracted respectively by the N data masks via a “bitwise OR” operation, so as to obtain and store coded image data S c . The method for the extracting is to extract M points from M*N points of each row and extract one point from L points of each column, where N is an integer greater than or equal to 2, L and M are integers greater than or equal to 1. 
         [0033]    Preferably, the sample images collected by the collecting module  31  include an infrared sample image, a transmission sample image and a white light sample image. In addition, the image data S p1  of the infrared sample image, the image data S p2  of the transmission sample image the and the image data S p3  of the white light sample image are obtained. The compression and storage processes for the image data S p1 , S p2 , S p3  are as follows. 
         [0034]    The compression and storage of the image data S p1  of the infrared sample image and the image data S p2  of the transmission sample image are described. The resolutions of the infrared sample image and the transmission sample image are 240*480. The collected image data S p1 , S p2  is single-byte image data. The conversion unit  331  in the compression module  33  stores the collected single-byte image data S p1 , S p2  with every eight pixels being an unit, so as to convert the single-byte image data S p2 , S p2  into 8-byte of image data S 11 , S 12  and transmit and store the 8-byte of image data  S11 , S 12  into the storage module  34 . Therefore, the speed for storing the image data S p1  of the infrared sample image and the image data S p2  of the transmission sample image becomes nearly eight times faster. The data storage in the invention is based on the data storage from SDRAM to SDRAM which requires about 135 clock cycles to store a data unit. In the present embodiment, the 8-byte of data type is employed for the storage, the times for the storage of the infrared sample image and the transmission sample image is: (240*400/8)*2=24,0000. Therefore the number of the clock cycles spent to store one infrared sample image or one transmission sample image is: 135*24,000=3,240,000. 
         [0035]    The compression and storage of the image data S p3  of the white light sample image are described. The resolution of the white light sampling image is 480*800, and the collected image data S p3  is the single-byte image data. The compression module  33  forcibly converts the collected single-byte image data S p3  into 8-byte of image data S 13 , compresses the converted image data to obtain coded image data S c , and transmits and stores the coded image data S c  into the storage module  34 . The specific steps are as follows. 
         [0036]    1. the conversion unit  331  stores the collected single-byte image data S p3  with every eight pixels being an unit, so as to convert the single-byte image data S p3  into 8-byte of image data S 13 . 
         [0037]    2. the encoding unit  332  divides the 8-byte of image data S 13  into a U region and a D region, where the U region represents the upper half part of the white light sample image (one grid represents one pixel point), and the region D represents the lower half part of the white light sample image, and the subscript of a value in one block denote the numbers of a row and a column where the pixel point is located. 
         [0038]    Reference is made to Table 1 which is a list of 8-byte of image data for a white light sample image. 
         [0000]    
       
         
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
             
           
               
                 TABLE 1 
               
               
                   
               
             
             
               
                 U 
                 u 11   
                 u 12   
                 u 13   
                 u 14   
                 u 15   
                 u 16   
                 u 17   
                 u 18   
                 u 19   
                 u 1a   
                 u 1b   
                 u 1c   
                 u 1d   
                 u 1e   
                 u 1f   
                 u 1g   
               
               
                 region 
                 u 21   
                 u 22   
                 u 23   
                 u 24   
                 u 25   
                 u 26   
                 u 27   
                 u 28   
                 u 29   
                 u 2a    
                 u 2b   
                 u 2c   
                 u 2d   
                 u 2e   
                 u 2f   
                 u 2g   
               
               
                   
                 u 31   
                 u 32   
                 u 33   
                 u 34   
                 u 35   
                 u 36   
                 u 37   
                 u 38   
                 u 39   
                 u 3a    
                 u 3b   
                 u 3c   
                 u 3d   
                 u 3e   
                 u 3f   
                 u 3g   
               
               
                   
                 u 41   
                 u 42   
                 u 43   
                 u 44    
                 u 45   
                 u 46   
                 u 47   
                 u 48   
                 u 49   
                 u 4a    
                 u 4b   
                 u 4c   
                 u 4d   
                 u 4e   
                 u 4f   
                 u 4g   
               
               
                 D 
                 d 11    
                 d 12   
                 d 13   
                 d 14   
                 d 15   
                 d 16   
                 d 17   
                 d 18   
                 d 19   
                 d 1a   
                 d 1b   
                 d 1c   
                 d 1d   
                 d 1e   
                 d 1f   
                 d 1g   
               
               
                 region 
                 d 21   
                 d 22   
                 d 23   
                 d 24    
                 d 25   
                 d 26   
                 d 27   
                 d 28   
                 d 29   
                 d 2a    
                 d 2b   
                 d 2c   
                 d 2d   
                 d 2e   
                 d 2f   
                 d 2g   
               
               
                   
                 d 31   
                 d 32   
                 d 33   
                 d 34    
                 d 35   
                 d 36   
                 d 37   
                 d 38   
                 d 39   
                 d 3a   
                 d 3b   
                 d 3c   
                 d 3d   
                 d 3e   
                 d 3f   
                 d 3g   
               
               
                   
                 d 41   
                 d 42   
                 d 43   
                 d 44   
                 d 45   
                 d 46   
                 d 47   
                 d 48   
                 d 49   
                 d 4a   
                 d 4b   
                 d 4c   
                 d 4d   
                 d 4e   
                 d 4f   
                 d 4g   
               
               
                   
               
             
          
         
       
     
         [0039]    3. The coding unit  332  extracts some points from the 8-byte of image data S 13  by using two mutually corresponding 8 bytes of data masks M1, M2, so as to obtain 8 bytes of data R1, R2, in which M1=0x00ff00ff00ff00ff and M2=0xff00ff00ff00ff00. The extraction is performed by using the “bitwise AND” operation: R1=A1&amp;M1, R2=B1&amp;M2, where A1 represents 8 byte of image data in the U region, B1 represents 8 byte of image data in the D region. In the present embodiment, N=2, M=1, L=2, and the extraction method is to extract one point from every two points in each row (i.e. to extract one column for every two columns) and to extract one point from every two points in each column (i.e. to extract one row for every two rows), and data in an odd-numbered column and an odd-numbered row is extracted in the U region and data in an even-numbered column and an odd-numbered row is extracted in the D region. 
         [0040]    Referring to Table 2, the 8 bytes of image data in the U region is extracted by using the data mask M1. 
         [0000]    
       
         
               
               
               
               
               
               
               
               
               
               
             
           
               
                   
                 TABLE 2 
               
               
                   
                   
               
             
             
               
                   
                 A1 
                 u 11    
                 u 12   
                 u 13    
                 u 14    
                 u 15   
                 u 16   
                 u 17   
                 u 18   
               
               
                   
                 M1 
                 00 
                 ff 
                 00 
                 ff 
                 00 
                 ff 
                 00 
                 ff 
               
               
                   
                 R1 
                 00 
                 u 12   
                 00 
                 u 14   
                 00 
                 u 16    
                 00 
                 u 18   
               
               
                   
                   
               
             
          
         
       
     
         [0041]    Referring to Table 3, the 8 bytes of image data in the D region is extracted by using the data mask M2. 
         [0000]    
       
         
               
               
               
               
               
               
               
               
               
               
             
           
               
                   
                 TABLE 3 
               
               
                   
                   
               
             
             
               
                   
                 B1 
                 d 11   
                 d 12   
                 d 13   
                 d 14   
                 d 15   
                 d 16   
                 d 17   
                 d 18   
               
               
                   
                 M2 
                 ff 
                 00 
                 ff 
                 00  
                 ff 
                 00 
                 ff  
                 00 
               
               
                   
                 R2 
                 d 11   
                 00 
                 d 13   
                 00  
                 d 15   
                 00 
                 d 17   
                 00 
               
               
                   
                   
               
             
          
         
       
     
         [0042]    Particularly, 4 valid bytes are extracted from 8 bytes of data in the U region, and 4 valid bytes are extracted from 8 bytes of data in the D region, i.e. totally 8 bytes of valid data are extracted from 16 bytes of data. 
         [0043]    4. The 8 bytes of data R1, R2 extracted respectively by M1 and M2 is integrated via a “bitwise OR” operation, so as to obtain the coded image data S c  and store the coded image data S c  into the R region of the storage module  34 : R=R11R2; 
         [0044]    Referring to Table 4, the 8 bytes of data R1, R2 extracted respectively by M1 and M2 is integtrated: 
         [0000]    
       
         
               
               
               
               
               
               
               
               
               
               
             
           
               
                   
                 TABLE 4 
               
               
                   
                   
               
             
             
               
                   
                 R1 
                 00  
                 u 12   
                 00 
                 u 14   
                 00  
                 u 16   
                 00  
                 u 18   
               
               
                   
                 R2 
                 d 11   
                 00  
                 d 13   
                 00  
                 d 15   
                 00  
                 d 17   
                 00 
               
               
                   
                 R 
                 d 11   
                 u 12   
                 d 13   
                 u 14   
                 d 15   
                 u 16   
                 d 17   
                 u 18   
               
               
                   
                   
               
             
          
         
       
     
         [0045]    Reference is made to Table 5 which is an encoded image data list for the white light sample image. 
         [0000]    
       
         
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
               
             
           
               
                 TABLE 5 
               
               
                   
               
             
             
               
                 R 
                 u 11    
                 d 12   
                 u 13   
                 d 14    
                 u 15   
                 d 16    
                 u 17   
                 d 18    
                 u 19   
                 d 1a   
                 u 1b   
                 d 1c   
                 u 1d   
                 d 1e   
                 u 1f   
                 d 1g   
               
               
                 region 
                 u 31    
                 d 32   
                 u 33   
                 d 34   
                 u 35   
                 d 36   
                 u 37   
                 d 38   
                 u 39   
                 d 3a   
                 u 3b   
                 d 3c   
                 u 3d    
                 d 3e   
                 u 3f   
                 d 3g   
               
               
                   
               
             
          
         
       
     
         [0046]    Reference is made to  FIG. 4   a  to  FIG. 4   c  which are schematic diagrams (original sample images) of a white light sample images before compression, after the compression and after decompression, where the block in  FIG. 4   a  filled with an oblique line represents a valid byte in the data of the point to be extracted. Since the identification and analysis of image can not be directly performed on the compressed image, the encoded image data S c  stored in the R region should be recovered to obtain the decompressed image data S d , so that the compressed image is recovered to the normal image. The specific decompression steps are as follows. The upper half area of the decompressed image is referred to as a U′ region, and the lower half area of the decompressed image is referred to as a D′ region. In the present embodiment, the number of rows of the decompressed image is half of the number of rows of the image to be compressed, and the number of columns of the decompressed image is half of the number of columns of the image to be compressed, data corresponding to each of the pixel points on the decompressed image template is calculated according to the data of size of the decompressed image template and the encoded image data S c , so as to obtain the decompressed image data S d . Since U′, D′ and R have the same number of rows, U′ takes the odd-numbered columns in the R region and D′ takes the even-numbered columns in the R region, and the decompression is performed by using the following formulas: U′(i, j)=R(i, 2j-1) and D′(i, j)=R(i, 2j), where (i, j) represents a data in the i th  row and in the j th  column in the U′ region or the D′ region. 
         [0047]    Reference is made to Table 6 which is a decompressed image data list for the white light sample image. 
         [0000]    
       
         
               
               
               
               
               
               
               
               
             
           
               
                 TABLE 6 
               
               
                   
               
             
             
               
                 u 11   
                 u 13   
                 u 15   
                 u 17   
                 u 19   
                 u 1b   
                 u 1d   
                 u 1f   
               
               
                 u 31   
                 u 33   
                 u 35   
                 u 37   
                 u 39   
                 u 3b   
                 u 3d   
                 u 3f   
               
               
                 d 12   
                 d 14   
                 d 16   
                 d 18   
                 d 1a   
                 d 1c   
                 d 1e   
                 d 1g   
               
               
                 d 32   
                 d 34   
                 d 36   
                 d 38   
                 d 3a   
                 d 3c   
                 d 3e   
                 d 3g   
               
               
                   
               
             
          
         
       
     
         [0048]    Referring to Table 1, Table 5 and Table 6, it can be seen that the size of the image data to be compressed is M*N, the size of the compressed image data is M/4*N, and the size of the decompressed image data is M/2*N/2, where in the present embodiment M=480, N=800. Compared with the prior art, the invention operates a 16-byte data per operation by using the “bitwise AND operation” and the “bitwise OR operation” on the basis of the 8 byte data type operation, where the valid data is of 8 bytes, and the number of conversion is one-eighth of that of the conventional method. One conversion needs two “bitwise AND” operation, one “bitwise OR” operation and one conversion operation. Each “bitwise AND” operation or “bitwise OR” operation requires about 20 clock cycles. Therefore the total number of the clock cycles of two “bitwise AND” operation, one “bitwise OR” operation and one conversion operation is about 135+20*3=195, and the time spent in the traditional method/the time spent in the invention: (8*135)/195=5.54. Therefore the speed of the storage becomes about 5.5 times faster. Furthermore, the number of times for the storage of the white light sample image is 240*400/8=12,000, therefore the period spent to store one white light sample image is: 
         [0049]    195*12,000=2,340,000. 
         [0050]    In summary, based on the TMS320 platform of 600MCPU frequency, it is spent more than 70 ms to store two sample images of the medium resolution (240*400), i.e. one infrared sample image and one transmission sample image, and one white light sample image of the high resolution (480*800) according the traditional method, which is far longer than the desired 15 ms. However, based on the fast storage method according to the invention, 2.340,000+3,240,000=5,580,000; the storage time is: 5,580,000/(600*1024*1024)=9.1*10-3s=9.1 ms; and the time loss due to the “for” cycle and so on is counted together, therefore the total storage time is about 9.6 ms. Thus, the overall speed of the storage becomes 7 times faster or more. 
         [0051]    The above embodiment is based on the 8-byte (64-bit) processor. In a second embodiment, in the case that the processor in the invention supports 16 bytes (128 bits), if one point is extracted from every two points, the single-byte image data is converted into 16-byte image data, the data masks are set as follows: M1=0x00ff00ff00ff00ff00ff00ff00ff00ff; M2=0xff00ff00ff00ff00ff00ff00ff00ff00; 32 bytes of data can be operated at one time by the following operation: R=(A1&amp;M1)I(A2&amp;M2), where the 16-byte valid data is extracted. Of course, the similar processing method can be used in a 4-byte processor, a 32-byte the processor. 
         [0052]    A third embodiment is based on the 8-byte (64-bit) processor. The extraction method is to extract one point from every four points. The data is divided into four regions, i.e. U1, U2, U3, U4, and four data masks are set as follows: M1=0x000000ff000000ff, M2=0x0000ff000000ff00; M3=0x00ff000000ff0000, M4=0xff000000ff000000. A1, A2, A3, A4 are respectively 8 bytes data in the U1, U2, U3, U4 regions, C=(A1&amp;M1)|(A2&amp;M2)|(A3&amp;M3)|(A4&amp;M4). In this way, 32 bytes of data can be operated at one time, and the 8 byte of valid data is extracted. Similar method can be used to extract one point from every eight points or from every sixteen points. 
         [0053]    A fourth embodiment is also based on the 8-byte (64-bit) processor. If the extraction method is to extract one point from every three points, the implement is a slightly different from the above method. The data is no longer divided into regions, successive 24 bytes of data are operated at one time, three data masks are set as follows: M1=0xff0000ff0000ff00, M2=0x00ff0000ff0000ff, M3=0x0000ff0000ff0000. Three 8-byte data which is denoted respectively by A1, A2, A3 are extracted by the three data masks at one time, C=(A1&amp; M1)|(A2&amp;M2)|(A3&amp;M3), and thus 24 bytes of data can be operated at one time and the 8-byte valid data is extracted. 
         [0054]    Referring to  FIG. 3 , a specific working process of the security document identification apparatus  300  according to the invention will be described in detail. At the beginning of the work process, the contact image sensor  31  may detect whether a current security document enters into a sampling area, and collect an infrared sample image, a transmission sample image and a white light sample image and obtain corresponding image data S p1 , S p2  and S p3  if the current security document enters into the sampling area, and perform the detection continuously if the current security document does not enter into the sampling area. The identification module  32  performs a security document identification based on the image data S p3 , so as to obtain identification data S i  (information such as the serial number of the current security document) of the security document. The compression module  33  forcibly converts the collected image data S p1 , S p2  and S p3  into long integer type image data S 11 , S 12  and S 13 , and performs a compression operation on the long integer type image data S 13  so as to obtain coded image data S c . The storage module  34  stores the long integer type image data S 11  and S 12  and the coded image data S c . The decompression module  35  recovers the encoded image data S c  to obtain decompressed image data S d . The identification module  32  performs a security document identification and judge the authenticity of the security document based on the long integer type image data S 11  and S 12  and the decompressed image data S d , so as to further obtain identification data Si (information such as the type, denomination, orientation, authenticity of the current security document) of the security document. 
         [0055]    Those disclosed above are only preferred embodiments of the invention and can certainly not be used to limit the scope of protection of the invention. Therefore, any equivalent modification made according the claimed scope of the invention falls within the scope covered by the invention.