Identity card information extraction method and device and computer storage medium

An information extraction and ID card technology, applied in the field of image processing, can solve problems such as information leakage, manual entry, and wrong entry of information, and achieve the effects of high recognition accuracy, fast positioning and recognition, and efficient acquisition

Active Publication Date: 2019-11-12
SHANGHAI MARITIME UNIVERSITY
2 Cites 4 Cited by

AI-Extracted Technical Summary

Problems solved by technology

At present, most of the personal information entry in the ID card is manually entered. This method is not only time-consuming and inefficient, but also prone to incorrect information entry due to manual input, resulting in unnecessary losses; and if it can be from the perspective of image processing, Let the machine replace the human to identify the information of...
View more

Method used

[0113] The entire network uses the same size of 3*3 convolution kernel size and 2*2 maximum pooling size, and the network result is concise. The network structure is: the input layer accepts a 64x64 binarized picture, connects two 64x3x3 convolutional layers, connects a 2x2 pooling laye...
View more

Abstract

The invention provides an identity card information extraction method. The method comprises the steps of obtaining a to-be-processed image; detecting a human face in the to-be-processed image; determining the position of an identity card in the to-be-processed image based on the detected face, and obtaining an identity card image; performing binarization processing on the identity card image to obtain a processed image; obtaining a connected region of the processed image through a connected region search algorithm; carrying out character row segmentation according to the communication area, and carrying out character column segmentation according to a projection method; performing character recognition according to the CNN network model; and acquiring identity card information according toa preset identity card integration format and the character recognition result. In addition, the invention further discloses an identity card information extraction device and a computer storage medium.

Application Domain

Character recognition

Technology Topic

Character recognitionNetwork model +4

Image

  • Identity card information extraction method and device and computer storage medium
  • Identity card information extraction method and device and computer storage medium
  • Identity card information extraction method and device and computer storage medium

Examples

  • Experimental program(1)

Example Embodiment

[0054] Embodiments of the present invention are described below through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific implementation modes, and various modifications or changes can be made to the details in this specification based on different viewpoints and applications without departing from the spirit of the present invention.
[0055] see figure 1. It should be noted that the diagrams provided in this embodiment are only schematically illustrating the basic idea of ​​the present invention, and only the components related to the present invention are shown in the diagrams rather than the number, shape and shape of the components in actual implementation. Dimensional drawing, the type, quantity and proportion of each component can be changed arbitrarily during actual implementation, and the component layout type may also be more complicated.
[0056] like figure 1 As shown, the embodiment of the present invention provides a method for extracting ID card information, the method comprising:
[0057] S101. Acquire an image to be processed.
[0058] It can be understood that the image to be processed in the embodiment of the present invention is an image containing an ID card.
[0059] S102. Detect a human face in the image to be processed.
[0060] The present invention uses a Haar classifier to detect faces in ID cards. The Haar classifier is composed of Haar feature extraction, discrete strong classifier, and strong classifier cascade. By extracting the Haar features of the face, the feature is quickly calculated using the integral map, and then a small number of key features are selected and sent to a cascade classifier composed of strong classifiers for iterative training.
[0061] Haar-like rectangle features are digital image features for object detection. This type of rectangular feature template is composed of two or more congruent black and white rectangles adjacent to each other, and the rectangular feature value is the sum of the gray value of the white rectangle minus the sum of the gray value of the black rectangle. Simple graph structures such as line segments and edges are more sensitive. If such a rectangle is placed in a non-face area, the calculated eigenvalues ​​should be different from the eigenvalues ​​of the face, so these rectangles are used to quantify the face features to distinguish between human faces and non-human faces.
[0062]The reason why feature-based methods are chosen instead of pixel-based methods is that, given limited data samples, feature-based detection can not only encode the state of a specific region, but also is much more efficient than feature-based systems. The pixel system is fast. The features of the face can be simply described by rectangular features, for example, the eyes are darker than the cheeks, the sides of the bridge of the nose are darker than the bridge of the nose, and the mouth is darker than the surroundings.
[0063] After obtaining the rectangular feature, the value of the rectangular feature is calculated. The integral map is defined as the integral map of coordinates A(x,y) is the sum of all the pixels in its upper left corner, so that the "integral map" obtained by performing a small amount of calculation on each pixel can be calculated in the same time with different scales The rectangular eigenvalues ​​of , thus greatly improving the calculation speed.
[0064] For a point A(x,y) in the image, define its integral graph ii(x,y) as:
[0065]
[0066] Wherein, i(x', y') is the pixel value at the point (x', y').
[0067] It can be seen from this that to calculate the difference between the pixel values ​​of two regions (that is, to calculate the characteristic value of the rectangular template), it is only necessary to use the integral map of the endpoints of the characteristic regions to perform simple addition and subtraction operations. The eigenvalues ​​of rectangular features can be quickly calculated using the integral graph method.
[0068] S103. Based on the detected face, determine the corresponding position of the ID card in the image to be processed, and acquire the ID card image.
[0069] Find the position of the ID card in the picture according to the position and proportion of the face in the ID card, and scale it to the same size.
[0070] Summary of the embodiment of the present invention, firstly, the position of the identity card occupied by the face photo is fixed, and the position of the ID card is determined according to the face detected in the previous step. Assume that the upper left and lower right coordinates of the detected face photo are (x face1 ,y face1 ) and (x face2 ,y face2 ), the width and length of the face photo are width and height respectively, and the coordinates of the upper left and lower right of the ID card are (x 1 ,y 1 ),(x 2 ,y 2 ),but:
[0071]
[0072] S104. Perform binarization processing on the ID card image to obtain a processed image.
[0073] In a 3*3 window, according to the RGB value of a central pixel point A, compare it with the RBG values ​​of the surrounding 8 points, set a threshold N (0
[0074] The present invention uses NLM for denoising. The noise is replaced by the weighted sum of the pixel values ​​in the search window, which is the target pixel value. In the embodiment of the present invention, it is set: the closer to the target pixel, the greater the weight.
[0075]
[0076]
[0077] The above formula i represents the three channels of the color image; p represents the target pixel position; B(p, r) represents the target pixel with the center of p, and the search window size is (2r+1)*(2r+1); q Represents the pixel located in the search window; w(p,q) represents the weight of pixel p and q, and the similarity is generally measured by Euclidean distance. C(p) represents the weight normalization parameter.
[0078]
[0079] w is obtained by an exponential function; d: the Euclidean distance of the neighborhood of two pixels;
[0080]
[0081] σ represents the standard deviation of the noise, and h represents the filter parameters related to σ. When the noise variance is larger, h can be increased accordingly.
[0082] In order to obtain the pixel value that can replace q, the weight between each pixel p and q in the window is first calculated in the window, and the weight is obtained by calculating the Euclidean distance between the neighbors of p and the corresponding pixels in the neighborhood of q.
[0083] The invention uses an Otsu self-adaptive binarization algorithm to binarize the ID card image, and the Otsu algorithm is an adaptive threshold value determination method.
[0084] Let the original gray level be M, and the number of pixels with gray level i be n i , to normalize the grayscale histogram:
[0085]
[0086] For two types of pixels C 0 ,C 1 , the probability of occurrence of each category is:
[0087]
[0088]
[0089] The average gray value of each class is:
[0090]
[0091]
[0092] Among them, the cumulative gray value when the gray level is t is,
[0093] The cumulative gray value of the entire gray range O-M is,
[0094] where w 0 mu 0 +w 1 mu 1 =μ T ,w 0 +w 1 =1. Then the internal variance of the two types of pixels is:
[0095]
[0096]
[0097] In order to measure the variance between classes when the gray level is t, the definition is as follows:
[0098]
[0099]
[0100]
[0101] in,
[0102] In order to obtain the optimal discrimination threshold, only one t is required to maximize the value of λ or η. Select η as the objective function, and find the gray level t to maximize η, which is equivalent to making maximize.
[0103]
[0104] according to When the pixel value of the pixel is greater than When , it is 1, otherwise it is 0, realizing binarization processing.
[0105] S105. Obtain connected regions of the processed image through a connected region search algorithm.
[0106] The present invention uses the findCountors function of opencv to find all connected areas in the ID card. Specifically, the small connected areas can be merged into the circumscribed rectangle of a single Chinese character through the merging algorithm, and the preset gap threshold can be used to recursively determine whether the two small connected areas belong to the same Chinese character, and if so, they are merged.
[0107] According to the center coordinates of the merged circumscribed rectangle of each Chinese character, divide the external rectangles with similar center coordinates into the same group, and obtain the largest circumscribed rectangle of each group of rectangles as the information area of ​​the row.
[0108] S106 , performing text row segmentation according to the connected region, and performing text column segmentation by a projection method.
[0109] First, a single Chinese character cut out according to the vertical projection method.
[0110] Specifically, an array can be defined to store the number of white pixels in each column of pixels. Traverse the binarized image, and record the white (that is, the digital area) pixels in each column in the array.
[0111] Draw the projection image according to the gray value in the array, find the segmentation point between adjacent characters according to the content of the stored gray value array, cut out a single Chinese character according to the vertical projection method, and then divide each pixel in the image by 255 normalized.
[0112] S107, perform character recognition according to the CNN network model.
[0113] The entire network uses the same size of 3*3 convolution kernel size and 2*2 maximum pooling size, and the network results are concise. The network structure is: the input layer accepts a 64x64 binarized picture, connects two 64x3x3 convolutional layers, connects a 2x2 pooling layer and a dropout layer, the activation rate of dropout is 0.25, and then connects two A 128x3x3 convolutional layer, a pooling layer, a dropout layer, and then two 256x3x3 convolutional layers, a pooling layer, a dropout layer, a fully connected layer, a sofmax to get the network Output.
[0114] Among them, the activation function of all layers adopts the ReLU function.
[0115] Write the text in the Chinese character font into the text file, and form a Chinese character font file under the same directory file.
[0116] Save the characters in the Chinese character font library as pictures one by one.
[0117] Next, construct a convolutional neural network, which is mainly composed of an input layer, a convolutional layer, a downsampling layer (pooling layer), a fully connected layer, and an output layer. Among them, the input layer accepts a binarized image of 64x64 size.
[0118] S108. Acquire ID card information according to the preset ID card integration format and the character recognition result.
[0119] Integrate the recognition results into the following format
[0120]
[0121]
[0122] The invention also discloses an ID card information extraction device, the device includes a processor, and a memory connected to the processor through a communication bus; wherein,
[0123] The memory is used to store the ID card information extraction program;
[0124] The processor is configured to execute the ID card information extraction program, so as to realize any one of the ID card information extraction steps.
[0125]And, a computer storage medium is also disclosed, the computer storage medium stores one or more programs, and the one or more programs can be executed by one or more processors, so that the one or more processing The device executes the ID card information extraction step described in any one.
[0126] The above-mentioned embodiments only illustrate the principles and effects of the present invention, but are not intended to limit the present invention. Anyone skilled in the art can modify or change the above-mentioned embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or changes made by those skilled in the art without departing from the spirit and technical ideas disclosed in the present invention should still be covered by the claims of the present invention.

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.

Similar technology patents

Cloud hosting client information management method and device and server

InactiveCN112084386AEfficient acquisition
Owner:SUZHOU LVDIAN INFORMATION TECH CO LTD

Working device position parameter data acquisition method and loader

ActiveCN113684886ACalibration lessEfficient acquisition
Owner:GUANGXI LIUGONG MASCH CO LTD

Method for freeze preservation of tissue-derived cell

InactiveCN101522890Alow costEfficient acquisition
Owner:CELL BANK

Object playing method, server, terminal and storage medium

PendingCN114245214AImprove portabilityEfficient acquisition
Owner:BEIJING DAJIA INTERNET INFORMATION TECH CO LTD

Insect disease monitoring system based on unmanned plane multispectral remote sensing

InactiveCN105739518Ahigh computing powerQuickly identify and locate
Owner:中孚航空科技(天津)有限公司

Damage imaging system based on Lamb waves

InactiveCN108267509AQuickly identify and locate
Owner:海宁盛台材料科技有限公司

Laser path planning visual algorithm

InactiveCN112734782AQuickly identify and locate
Owner:HARGLO APPLIED LASER TECH INST CO LTD +2

Sounding reference signal transmission method, sounding reference signal configuration method, user equipment and network side equipment

ActiveCN110351040AEfficient acquisitionImprove system transfer rate
Owner:VIVO MOBILE COMM CO LTD

Classification and recommendation of technical efficacy words

  • Efficient acquisition
  • Quickly identify and locate

Compressed sensing signal collection method based on filtering

InactiveCN103036573AEfficient acquisitionSimple hardware implementation
Owner:NANJING UNIV OF TECH

A hot news sharing method based on geographical information, an apparatus and a system

InactiveCN103634736Aimprove relevanceEfficient acquisition
Owner:BEIJING YOYO TIANYU SYST TECH

Tree component rendering method and device, data processing equipment and medium

ActiveCN110688531AImprove rendering efficiencyEfficient acquisition
Owner:BEIJING KUANGSHI TECH

Sounding reference signal transmission method, sounding reference signal configuration method, user equipment and network side equipment

ActiveCN110351040AEfficient acquisitionImprove system transfer rate
Owner:VIVO MOBILE COMM CO LTD

Method for freeze preservation of tissue-derived cell

InactiveCN101522890Alow costEfficient acquisition
Owner:CELL BANK

Insect disease monitoring system based on unmanned plane multispectral remote sensing

InactiveCN105739518Ahigh computing powerQuickly identify and locate
Owner:中孚航空科技(天津)有限公司

Damage imaging system based on Lamb waves

InactiveCN108267509AQuickly identify and locate
Owner:海宁盛台材料科技有限公司

Laser path planning visual algorithm

InactiveCN112734782AQuickly identify and locate
Owner:HARGLO APPLIED LASER TECH INST CO LTD +2
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products