Automatic certificate correction method and system for image scanning equipment

By building a document standard database and recognition-oriented technology, the problem of image irregularity when the scanner equipment is tilted is solved, automatic correction of documents is realized, and the centering and quality of the output image are ensured.

CN118675189APending Publication Date: 2024-09-20北京高德品创科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310263676.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-18
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

When existing scanner equipment is used to scan ID cards, Hong Kong, Macao and Taiwan residence permits, social security cards and other documents, if the position is tilted, the scanned image will be irregular and the copied manuscript will also be tilted.

Method used

Construct a document standard database and save the standard feature vectors of various types of documents. During scanning, through image collection, feature extraction and orientation recognition, the cosine similarity between the feature vector of the document to be recognized and the standard feature vector is calculated, the document orientation is determined, and the process is carried out based on the orientation. The image is output centered.

Benefits of technology

Automatic correction of documents is realized to ensure that the output image is in the center position and improves the scanning quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118675189A
    Figure CN118675189A
Patent Text Reader

Abstract

The invention is suitable for the technical field of image scanning, and particularly relates to an image scanning equipment certificate automatic correction method and system, and the method comprises the steps: constructing a certificate standard database which stores standard feature vectors corresponding to various certificates; during scanning, carrying out image acquisition on equipment to be scanned to obtain a certificate image to be identified; performing feature extraction on the to-be-identified certificate image to obtain to-be-identified certificate feature data; constructing a to-be-identified certificate feature vector based on the to-be-identified certificate feature data, calculating a cosine similarity between the to-be-identified certificate feature vector and a standard feature vector, and determining the orientation of the current certificate; and performing centering output on the to-be-identified certificate image according to the orientation of the certificate. The face of the certificate can be automatically recognized according to the certificate, then the position of the whole certificate is adjusted, the finally output certificate is located in the center, and the output quality is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image scanning, and in particular relates to a method and system for automatically correcting documents of image scanning equipment. Background Art

[0002] An image scanner is a computer peripheral device that captures images and converts them into digital input devices that can be displayed, edited, stored, and output by the computer. It can extract and convert original lines, graphics, text, photos, and plane objects into digital forms that can be edited and added to files.

[0003] When existing scanners are used to scan identity cards, Hong Kong, Macao and Taiwan residence permits, social security cards and other documents, if they are placed at an angle, the scanned image will be irregular and the copy will also be tilted when copied. Summary of the invention

[0004] The purpose of the embodiment of the present invention is to provide a method for automatically correcting documents using an image scanning device, aiming to solve the problem that the scanned image is easily tilted when scanning using current scanner devices.

[0005] The embodiment of the present invention is implemented as follows: a method for automatically correcting a document of an image scanning device, the method comprising: Constructing a certificate standard database, wherein the certificate standard database stores standard feature vectors corresponding to various certificates; When scanning, the device to be scanned is imaged to obtain an image of the document to be identified; Extract features from the image of the document to be identified to obtain feature data of the document to be identified; Construct a feature vector of the document to be identified based on the feature data of the document to be identified, calculate the cosine similarity between the feature vector of the document to be identified and the standard feature vector, and determine the orientation of the current document; The document image to be recognized is output in the center according to the orientation of the document.

[0006] Preferably, the step of constructing a certificate standard database specifically includes: For different types of certificates, sample images of each certificate in different orientations are collected; Extract features from the sample image to obtain sample document feature data; A standard feature vector is constructed according to the characteristic data of the sample certificate, and is stored in a database to obtain a standard certificate database.

[0007] Preferably, the feature extraction step specifically includes: Binarization is performed on the image that needs to be feature extracted to obtain a binary image; Dividing the binary image into a plurality of local images, wherein the number of pixels of the local images is the same; The number of black pixels and white pixels in each local image is counted to obtain feature data.

[0008] Preferably, one type of certificate corresponds to four aspects, and each aspect corresponds to a standard feature vector.

[0009] Preferably, when determining the orientation of the document, the feature vector of the document to be identified is compared with four groups of standard feature vectors of the document of this type, the cosine similarity is calculated, and the group of standard feature vectors with the largest cosine similarity is selected to obtain the orientation of the current document.

[0010] Preferably, in the step of outputting the certificate image to be identified in a center according to the orientation of the certificate, the certificate image to be identified is rotationally adjusted.

[0011] Another object of an embodiment of the present invention is to provide an automatic correction system for image scanning equipment documents, the system comprising: A database construction module is used to construct a certificate standard database, wherein the certificate standard database stores standard feature vectors corresponding to various certificates; The image acquisition module is used to acquire images of the device to be scanned during scanning to obtain the image of the document to be identified; A feature extraction module is used to extract features from the image of the document to be identified and obtain feature data of the document to be identified; An orientation recognition module is used to construct a feature vector of the document to be identified based on the feature data of the document to be identified, calculate the cosine similarity between the feature vector of the document to be identified and the standard feature vector, and determine the orientation of the current document; The centering output module is used to output the center of the document image to be identified according to the orientation of the document.

[0012] An automatic document correction method for an image scanning device provided in an embodiment of the present invention can automatically identify the orientation of a document according to the document, and then adjust the position of the entire document so that the final output document is in a centered position, thereby ensuring the output quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 A flowchart of a method for automatically correcting a document of an image scanning device provided by an embodiment of the present invention; Figure 2 An architecture diagram of an automatic document correction system for an image scanning device provided in an embodiment of the present invention. Implementation

[0014] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0015] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script.

[0016] like Figure 1 FIG. 1 is a flowchart of a method for automatically correcting a document of an image scanning device provided by an embodiment of the present invention, the method comprising: A certificate standard database is constructed, wherein the certificate standard database stores standard feature vectors corresponding to various types of certificates.

[0017] In this step, a standard database of certificates is constructed. In order to facilitate the identification of various types of certificates, samples of various types of certificates are collected, and feature data corresponding to various types of certificates are constructed based on various types of sample certificates. The step of extracting feature data includes binarizing the image that needs to be feature extracted to obtain a binary image, that is, converting the image into a black and white image, which consists of only black pixels and white pixels, dividing the binary image into multiple local images, the local images have the same number of pixels, and counting the number of black pixels and white pixels in each local image to obtain feature data, which is the number of black pixels and white pixels. The feature data of each local image is taken as an element to construct a standard feature vector of one aspect. A certificate contains four aspects, and then one certificate corresponds to four standard feature vectors.

[0018] When scanning, the image of the device to be scanned is captured to obtain the image of the document to be identified.

[0019] Extract features from the image of the document to be identified and obtain feature data of the document to be identified.

[0020] The feature vector of the document to be identified is constructed based on the feature data of the document to be identified, the cosine similarity between the feature vector of the document to be identified and the standard feature vector is calculated, and the orientation of the current document is determined.

[0021] In this step, the captured image is processed in the same way as constructing a standard database of certificates, thereby extracting feature data of the certificate to be identified, and constructing a corresponding feature vector of the certificate to be identified. The orientation of the current certificate is determined by calculating the cosine similarity.

[0022] The document image to be recognized is output in the center according to the orientation of the document.

[0023] In this step, during this process, the document image to be identified is rotated so that it is in a centered position and then output.

[0024] In this embodiment, the overall solution can be summarized as follows: sample images of four orientations (front side up, front side down, back side up, back side down) of the certificate to be supported are collected, and then the image is modeled to obtain modeled template data of the four orientations. When scanning the certificate, the scanned certificate image data is subjected to the same modeling method to obtain feature data of the current certificate image, and cosine similarity calculation is performed between the feature data and the four orientation template data. The orientation with the highest cosine similarity value is determined, and then the orientation is centered and output according to the specified orientation.

[0025] The automatic correction method for image scanning equipment documents disclosed in the present invention is divided into two major processes: sample data collection and scanning origin positioning detection.

[0026] 1. Sample data collection process The first step is to collect image data from four aspects of the document; The second step is to model the image data. The modeling method is to cut the image. Assuming that the original image is 100*100 pixels, the image is binarized and divided into 100 10*10 pixel images. Then, for each 10*10 pixel image, the number of white and black is calculated as the feature value, and then the template data of the image feature (that is, the standard feature vector of a single aspect of a single document) is generated. The third step is to save the template data.

[0027] 2. Scan origin positioning detection The first step is to obtain the captured image of the document; The second step is to use the modeling method of the sample image to model the image and obtain the template data of the image (i.e. the feature vector of the document to be identified); The third step is to calculate the cosine similarity between this template data and the four template data facing the sample image; The fourth step is to determine which of the four cosine similarity values ​​is higher, and then determine which direction is the current one.

[0028] like Figure 2 As shown, an automatic correction system for image scanning equipment documents provided by an embodiment of the present invention, the system includes: A database construction module is used to construct a certificate standard database, wherein the certificate standard database stores standard feature vectors corresponding to various certificates; The image acquisition module is used to acquire images of the device to be scanned during scanning to obtain the image of the document to be identified; A feature extraction module is used to extract features from the image of the document to be identified and obtain feature data of the document to be identified; An orientation recognition module is used to construct a feature vector of the document to be identified based on the feature data of the document to be identified, calculate the cosine similarity between the feature vector of the document to be identified and the standard feature vector, and determine the orientation of the current document; The centering output module is used to output the center of the document image to be identified according to the orientation of the document.

[0029] In one embodiment, a computer device is provided, the computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented: Constructing a certificate standard database, wherein the certificate standard database stores standard feature vectors corresponding to various certificates; When scanning, the device to be scanned is imaged to obtain an image of the document to be identified; Extract features from the image of the document to be identified to obtain feature data of the document to be identified; Construct a feature vector of the document to be identified based on the feature data of the document to be identified, calculate the cosine similarity between the feature vector of the document to be identified and the standard feature vector, and determine the orientation of the current document; The document image to be recognized is output in the center according to the orientation of the document.

[0030] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the processor performs the following steps: Constructing a certificate standard database, wherein the certificate standard database stores standard feature vectors corresponding to various certificates; When scanning, the device to be scanned is imaged to obtain an image of the document to be identified; Extract features from the image of the document to be identified to obtain feature data of the document to be identified; Construct a feature vector of the document to be identified based on the feature data of the document to be identified, calculate the cosine similarity between the feature vector of the document to be identified and the standard feature vector, and determine the orientation of the current document; The document image to be recognized is output in the center according to the orientation of the document.

[0031] It should be understood that, although each step in the flow chart of each embodiment of the present invention is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.

[0032] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0033] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0034] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

[0035] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for automatically correcting documents using an image scanning device, characterized in that: The method comprises: Constructing a certificate standard database, wherein the certificate standard database stores standard feature vectors corresponding to various certificates; When scanning, the device to be scanned is imaged to obtain an image of the document to be identified; Extract features from the image of the document to be identified to obtain feature data of the document to be identified; Construct a feature vector of the document to be identified based on the feature data of the document to be identified, calculate the cosine similarity between the feature vector of the document to be identified and the standard feature vector, and determine the orientation of the current document; The document image to be recognized is output in the center according to the orientation of the document.

2. The automatic correction method for image scanning equipment according to claim 1, characterized in that: The step of constructing a certificate standard database specifically includes: For different types of certificates, sample images of each certificate in different orientations are collected; Extract features from the sample image to obtain sample document feature data; A standard feature vector is constructed according to the characteristic data of the sample certificate, and is stored in a database to obtain a standard certificate database.

3. The automatic correction method for image scanning equipment according to claim 2, characterized in that: The feature extraction step specifically includes: Binarization is performed on the image that needs to be feature extracted to obtain a binary image; Dividing the binary image into a plurality of local images, wherein the number of pixels of the local images is the same; The number of black pixels and white pixels in each local image is counted to obtain feature data.

4. The automatic correction method for image scanning equipment according to claim 1, characterized in that: One type of certificate has four aspects, and each aspect corresponds to a standard feature vector.

5. The automatic correction method for image scanning equipment according to claim 4, characterized in that: When determining the orientation of the document, the feature vector of the document to be identified is compared with four sets of standard feature vectors of the same type of document, the cosine similarity is calculated, and the set of standard feature vectors with the largest cosine similarity is selected to obtain the orientation of the current document.

6. The automatic correction method for image scanning equipment according to claim 4, characterized in that: In the step of outputting the certificate image to be identified in the center according to the orientation of the certificate, the certificate image to be identified is rotated and adjusted.

7. An automatic correction system for image scanning equipment, characterized in that: The system comprises: A database construction module is used to construct a certificate standard database, wherein the certificate standard database stores standard feature vectors corresponding to various certificates; The image acquisition module is used to acquire images of the device to be scanned during scanning to obtain the image of the document to be identified; A feature extraction module is used to extract features from the image of the document to be identified and obtain feature data of the document to be identified; An orientation recognition module is used to construct a feature vector of the document to be identified based on the feature data of the document to be identified, calculate the cosine similarity between the feature vector of the document to be identified and the standard feature vector, and determine the orientation of the current document; The centering output module is used to output the center of the document image to be identified according to the orientation of the document.