CN110781890A - Identification card identification method and device, electronic equipment and readable storage medium - Google Patents

Identification card identification method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN110781890A
CN110781890A CN201911027888.7A CN201911027888A CN110781890A CN 110781890 A CN110781890 A CN 110781890A CN 201911027888 A CN201911027888 A CN 201911027888A CN 110781890 A CN110781890 A CN 110781890A
Authority
CN
China
Prior art keywords
image
identity card
content area
content
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911027888.7A
Other languages
Chinese (zh)
Inventor
于文浩
高岩
潘建丰
闫宪杰
杨续强
石俊彬
钟水平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Kai Tak Mdt Infotech Ltd
Original Assignee
Shanghai Kai Tak Mdt Infotech Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Kai Tak Mdt Infotech Ltd filed Critical Shanghai Kai Tak Mdt Infotech Ltd
Priority to CN201911027888.7A priority Critical patent/CN110781890A/en
Publication of CN110781890A publication Critical patent/CN110781890A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Multimedia (AREA)
  • Character Input (AREA)

Abstract

The application provides an identification card identification method, an identification card identification device, electronic equipment and a readable storage medium, and relates to the technical field of image processing. The method comprises the following steps: determining the position of a designated content area in an identity card image; determining the positions of other content areas in the identity card image based on the positions of the specified content areas and the position relation of each content area of the identity card; performing image segmentation on the identity card image according to the position of the designated content area and the positions of other content areas; determining an image of a target content area in images of all content areas obtained by image segmentation, wherein the target content area is at least one content area in all content areas; and acquiring characters in the image of the target content area by performing image recognition on the image of the target content area. According to the method, other content areas are deduced through the position relation, the target character is obtained, all the content areas do not need to be positioned, the image processing calculation amount is reduced, and the recognition efficiency is improved.

Description

Identification card identification method and device, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to an identification card identification method and apparatus, an electronic device, and a readable storage medium.
Background
With the rapid development of network technologies, more and more websites and the like need to perform real-name authentication on users online, or identity card information needs to be entered based on other needs, and the efficiency and accuracy of manually inputting the identity card information by users are low, so a mode of performing image recognition on identity card images uploaded by users to obtain effective information is generally adopted. However, when content areas such as an identification card number, an address, a birth date and the like of an identification card need to be identified, each content area needs to be subjected to image processing to be positioned, and the problems of large image processing calculation amount and low identification efficiency exist.
Disclosure of Invention
In view of the above, embodiments of the present disclosure provide an identification card recognition method, an identification card recognition apparatus, an electronic device, and a readable storage medium, so as to solve the problems of a large amount of image processing calculation and low recognition efficiency in the prior art.
The embodiment of the application provides an identification card identification method, which comprises the following steps: determining the position of a designated content area in an identity card image; determining the positions of other content areas in the identity card image based on the positions of the specified content areas and the position relation of each content area of the identity card; performing image segmentation on the identity card image according to the position of the specified content area and the positions of the other content areas; determining an image of a target content area in images of all content areas obtained by image segmentation, wherein the target content area is at least one content area in all the content areas; and acquiring characters in the image of the target content area by carrying out image recognition on the image of the target content area.
In the implementation process, the positions of other content areas are positioned through the position relation between the position of the designated content area and the content area of the identity card, the positioning step in image processing is not needed to be carried out on each content area, the calculation requirement of part of image processing is reduced, the identification efficiency of the identity card is improved, meanwhile, the method carries out content area segmentation on the positioned identity card image, and carries out individual identification and acquisition on the characters of the required target content area, so that the identification accuracy is improved.
Optionally, the determining the position of the designated content area in the identity card image includes: acquiring the identity card image; extracting all contours in the identity card image; acquiring each minimum rectangular area in the identity card image and the plane attribute of each minimum rectangular area based on all the outlines, wherein the plane attribute comprises length and width; and identifying the designated content area in the identity card image based on the plane attribute, and determining the position of the designated content area.
In the implementation process, the content area is identified and positioned through the plane attribute of the minimum rectangular area, so that the positioning accuracy of the specified content area is improved.
Optionally, the extracting all the contours in the identity card image includes: filtering out non-identity card area images in the identity card images by adopting edge detection and a filter; carrying out binarization processing on the identity card image with the non-identity card area image filtered out; and extracting all the contours from the identity card image subjected to binarization processing.
In the implementation process, the influence of the non-identification pattern in the identity card image on identification is eliminated through filtering and binarization processing of the non-identity card area image, and the accuracy of contour extraction is improved, so that the accuracy of identity card identification is improved.
Optionally, the designated content area includes at least two content areas, and after the identification of the designated content area in the identification card image based on the plane attribute, the method further includes: comparing the position relation between the designated content areas with the position relation of the corresponding content areas in the identity card standard template to determine the direction of the identity card image; and when the direction of the identity card image deviates from a preset direction, correcting the direction of the identity card image to the preset direction.
In the implementation process, the direction of the identity card image is corrected through the position relation between at least two content areas in the specified content areas and the comparison result of the corresponding content areas on the identity card template, so that the image of each content area is prevented from being intercepted and recognized under the condition of angle error, and the identification accuracy rate of the identity card is improved.
Optionally, the determining the positions of the other content areas in the identity card image based on the position of the specified content area and the position relationship of each content area of the identity card includes: establishing a coordinate system in the identity card image based on the position of the designated content area; and projecting the coordinate system to an identity card standard template, and determining the positions of other content areas in the identity card image according to the positions of the specified content areas, the position relation of each content area on the identity card standard template and the coordinates in the coordinate system.
In the implementation process, the coordinate positions of other content areas are determined by the coordinate system established by the specified content area based on the positions of the content areas of the identity card standard template, so that the positioning accuracy and efficiency of the content areas are improved.
Optionally, the designated content area includes at least two content areas, and after determining the positions of the other content areas in the identity card image based on the position of the designated content area and the position relationship of each content area of the identity card, the method further includes: determining the direction of the identity card image based on the position interval, the aspect ratio and the coordinates of the two content areas and the comparison result of the position interval, the aspect ratio and the coordinates of the corresponding content areas on the identity card standard template; and when the direction of the identity card image deviates from a preset direction, correcting the direction of the identity card image to the preset direction.
In the implementation process, the direction of the identity card image is corrected again based on the comparison results of the position interval, the width-to-height ratio and the coordinates of the designated content area and the corresponding content area of the identity card template, and the identification accuracy of the identity card image is further improved.
Optionally, the performing image recognition on the image of the target content area to obtain the characters in the image of the target content area includes: performing minimum neural unit processing on the image of the target content area to obtain a minimum neural unit processing result; loading an identification library of the artificial neural network model; and calling the artificial neural network model to perform image recognition on the image of the target content area based on the recognition library and the minimum neural unit processing result so as to acquire characters in the image of the target content area.
In the implementation process, the minimum neural unit is used for only carrying out image recognition on the image of the target content area which needs character recognition, and complete image recognition of the identity card image is not needed, so that the recognition calculation amount is reduced, and the recognition efficiency is improved.
The embodiment of the present application further provides an identification card recognition apparatus, the identification card recognition apparatus includes: the first position determining module is used for determining the position of the designated content area in the identity card image; the second position determining module is used for determining the positions of other content areas in the identity card image based on the position of the specified content area and the position relation of each content area of the identity card; the segmentation module is used for carrying out image segmentation on the identity card image according to the position of the specified content area and the positions of the other content areas; the target determining module is used for determining an image of a target content area in images of all content areas obtained by image segmentation, wherein the target content area is at least one content area in all the content areas; and the recognition module is used for carrying out image recognition on the image of the target content area to obtain characters in the image of the target content area.
In the implementation process, the positions of other content areas are positioned through the position relation between the position of the designated content area and the content area of the identity card, the positioning step in image processing is not needed to be carried out on each content area, the calculation requirement of part of image processing is reduced, the identification efficiency of the identity card is improved, meanwhile, the method carries out content area segmentation on the positioned identity card image, and carries out individual identification and acquisition on the characters of the required target content area, so that the identification accuracy is improved.
Optionally, the first position determination module comprises: the identity card image acquisition unit is used for acquiring the identity card image; the outline extraction unit is used for extracting all outlines in the identity card image; a minimum rectangle determining unit, configured to obtain, based on all the contours, each minimum rectangular region in the identity card image and a plane attribute of each minimum rectangular region, where the plane attribute includes a length and a width; and the designated content area positioning unit is used for identifying the designated content area in the identity card image based on the plane attribute and determining the position of the designated content area.
In the implementation process, the content area is identified and positioned through the plane attribute of the minimum rectangular area, so that the positioning accuracy of the specified content area is improved.
Optionally, the contour extraction unit is specifically configured to: filtering out non-identity card area images in the identity card images by adopting edge detection and a filter; carrying out binarization processing on the identity card image with the non-identity card area image filtered out; and extracting all the contours from the identity card image subjected to binarization processing.
In the implementation process, the influence of the non-identification pattern in the identity card image on identification is eliminated through filtering and binarization processing of the non-identity card area image, and the accuracy of contour extraction is improved, so that the accuracy of identity card identification is improved.
Optionally, the apparatus further comprises: the first correction module is used for comparing the position relation of the specified content area with the position relation of the corresponding content area in the identity card standard template and determining the direction of the identity card image; and when the direction of the identity card image deviates from a preset direction, correcting the direction of the identity card image to the preset direction.
In the implementation process, the direction of the identity card image is corrected through the position relation between at least two content areas in the specified content areas and the comparison result of the corresponding content areas on the identity card template, so that the image of each content area is prevented from being intercepted and recognized under the condition of angle error, and the identification accuracy rate of the identity card is improved.
Optionally, the second position determination module comprises: the coordinate establishing unit is used for establishing a coordinate system in the identity card image based on the position of the specified content area; and the content area determining unit is used for projecting the coordinate system to an identity card standard template and determining the positions of other content areas in the identity card image according to the position of the specified content area, the position relation of each content area on the identity card standard template and the coordinates in the coordinate system.
In the implementation process, the coordinate positions of other content areas are determined by the coordinate system established by the specified content area based on the positions of the content areas of the identity card standard template, so that the positioning accuracy and efficiency of the content areas are improved.
Optionally, the apparatus further comprises: the second correction module is used for determining the direction of the identity card image based on the position interval, the aspect ratio and the coordinates of the at least two content areas and the comparison result of the position interval, the aspect ratio and the coordinates of the corresponding content areas on the identity card standard template; and when the direction of the identity card image deviates from a preset direction, correcting the direction of the identity card image to the preset direction.
In the implementation process, the direction of the identity card image is corrected again based on the comparison results of the position interval, the width-to-height ratio and the coordinates of the designated content area and the corresponding content area of the identity card template, and the identification accuracy of the identity card image is further improved.
Optionally, the identification module comprises: the minimum neural unit processing unit is used for carrying out minimum neural unit processing on the image of the target content area to obtain a minimum neural unit processing result; the loading unit is used for loading the identification library of the artificial neural network model; and the recognition execution unit is used for calling the artificial neural network model to perform image recognition on the image of the target content area based on the recognition library and the minimum neural unit processing result so as to acquire characters in the image of the target content area.
In the implementation process, the minimum neural unit is used for only carrying out image recognition on the image of the target content area which needs character recognition, and complete image recognition of the identity card image is not needed, so that the recognition calculation amount is reduced, and the recognition efficiency is improved.
An embodiment of the present application further provides an electronic device, where the electronic device includes a memory and a processor, where the memory stores program instructions, and the processor executes steps in any one of the above implementation manners when reading and executing the program instructions.
The embodiment of the present application further provides a readable storage medium, in which computer program instructions are stored, and the computer program instructions are read by a processor and executed to perform the steps in any of the above implementation manners.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a schematic flowchart of an identification card identification method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a step of locating a designated content area according to an embodiment of the present application;
FIG. 3 is a flowchart illustrating an image recognition step according to an embodiment of the present disclosure;
fig. 4 is a block diagram of an identification card recognition apparatus according to an embodiment of the present application.
Icon: 20-identification card recognition means; 21-a first position determination module; 22-a second position determination module; 23-a segmentation module; 24-a target determination module; 25-identification module.
Detailed Description
The technical solution in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
The applicant researches and discovers that the requirement for extracting the identity card information through the identity card image is increasing day by day, the efficiency of inputting the identity card information manually is too low, the error rate is high, meanwhile, in the existing method for automatically extracting the identity card information based on the image recognition technology, all content areas such as names, birth dates, addresses, identity card numbers and the like on the identity card are generally required to be positioned, then image recognition is carried out on part or all of the content areas to obtain required content, and the method needs to consume more computing processing resources during the image processing step of positioning, so that the efficiency of identity card recognition is reduced.
In order to solve the above problem, an embodiment of the present application provides an identification card identification method, please refer to fig. 1, where fig. 1 is a schematic flow chart of the identification card identification method provided in the embodiment of the present application, and the specific steps of the method may be as follows:
step S11: the location of the designated content area in the identification card image is determined.
The content area of the side of the identity card containing the personal information comprises name, gender, ethnicity, date of birth, address, photo and citizenship number, and the designated content area can be any two of the above content areas.
Step S12: and determining the positions of other content areas in the identity card image based on the position of the specified content area and the position relation of each content area of the identity card.
The position relationship of the content areas of the identity card is a fixed position relationship between the content areas of the standard identity card, and optionally, the position relationship may include a distance between the content areas, a direction angle of a connecting line, and the like.
Step S13: and performing image segmentation on the identity card image according to the position of the designated content area and the positions of other content areas.
This step divides all the content areas one by one, and obtains an image containing character information of one content area based on the one content area.
Step S14: and determining an image of a target content area in the images of all the content areas obtained by image segmentation, wherein the target content area is at least one content area in all the content areas.
The target content area can be set according to the specific requirements of an identity card information input party or an identity card image uploading party, and can comprise at least one of content areas such as names, sexes, nationalities, birth dates, addresses, photos, national identification numbers and the like.
Step S15: and acquiring characters in the image of the target content area by performing image recognition on the image of the target content area.
In the steps S11-S15 in the above embodiment, the positions of other content areas are located by specifying the position relationship between the position of the content area and the content area of the identification card, and there is no need to perform a locating step in image processing on each content area, so that the calculation requirement for part of image processing is reduced, and the identification efficiency of the identification card is improved.
Referring to step S11, please refer to fig. 2, where fig. 2 is a schematic flowchart of a step of locating a designated content area according to an embodiment of the present application, and the specific steps may be as follows:
step S12.1: and acquiring an identity card image.
The identity card image can be uploaded to identity card image recognition and input equipment through mobile phones, computers and other equipment after a user uses a camera or a mobile phone for shooting. Optionally, the identification card image may also be stored in a certain database, and the identification card image recognition and entry device directly reads the identification card image to be recognized in the database.
Step S12.2: all contours in the identification card image are extracted.
The process of extracting the contour refers to the process of determining the contour of the target by adopting certain technology and method in a digital image containing the target and the background, neglecting the influence of the background, the texture inside the target and noise interference. For example, in an image in which a butterfly stops on a flower, the butterfly is used as a target, the flower is used as a background, and contour extraction is performed to obtain an image of the butterfly with the flower removed. In this embodiment, the content area or the character on the identification card image may be used as the target, and the background color, the pattern, or the like of the other background in the identification card image may be used as the background.
Step S12.3: and acquiring each minimum rectangular area in the identity card image based on all the outlines and the plane property of each minimum rectangular area, wherein the plane property comprises length and width.
The minimum rectangular region may be a region surrounded by a minimum bounding rectangle of any content region in the identification card image, where the minimum bounding rectangle refers to a maximum range of a plurality of two-dimensional shapes (e.g., points, straight lines, polygons) represented by two-dimensional coordinates, that is, a rectangle whose boundary is determined by a maximum abscissa, a minimum abscissa, a maximum ordinate, and a minimum ordinate of each vertex of a given two-dimensional shape.
Optionally, when the minimum rectangular region is determined, adjacent contours obtained by contour extraction may be combined, and specifically, the stitching combination may be a combination of contours whose distances are smaller than a preset value, which is regarded as the minimum rectangular region.
Step S12.4: and identifying the designated content area in the identity card image based on the plane attribute, and determining the position of the designated content area.
In the step, the aspect ratio and the area of the minimum rectangular area can be calculated according to the length and the width in the plane attribute, the minimum rectangular area is matched with the aspect ratio and the area of the specified content area in the identity card template, the minimum rectangular area in the identity card image is determined to be the specified content area when the matching is successful, and the position of the minimum rectangular area in the identity card image is determined.
In steps S12.1 to S12.4 of the above embodiment, the designated content area and the position thereof in the identification card image are determined by dividing the minimum rectangular area and comparing the minimum rectangular area with the width-to-height ratio and the area of the content area in the identification card template, and the content area is identified and positioned by the plane attribute of the minimum rectangular area, so that the positioning accuracy of the designated content area is improved, and meanwhile, a complicated image identification method such as a neural network is not required to be used for positioning, so that the calculation amount is reduced, and the identification efficiency of the identification card is improved.
As an alternative implementation, step S12.2 may include the following specific steps:
step S12.2a: and filtering non-identity card area images in the identity card image by adopting edge detection and a filter.
Among these, edge detection is a fundamental problem in image processing and computer vision, and the purpose of edge detection is to identify points in digital images where brightness changes are significant. Significant changes in image properties typically reflect significant events and changes in properties, which may include discontinuities in depth, surface orientation discontinuities, material property changes, and scene lighting changes, among others. In the embodiment, the data volume is greatly reduced through edge detection, and information which can be considered irrelevant, such as background color, patterns and other irrelevant information in the non-identity card area image in the identity card image, is eliminated, so that important structural attributes of the image are reserved.
Alternatively, the filter may be a high pass filter, a low pass filter, or the like that can weaken the non-identity card area. Specifically, the filter in the present embodiment may be an averaging filter in a low-pass filter, and the image may be blurred by the spatial averaging process, and the content area or the character may be highlighted.
Step S12.2b: and carrying out binarization processing on the identity card image with the non-identity card area image filtered out.
Image Binarization (Image Binarization) is to set the gray value of a pixel point on an Image to be 0 or 255, namely, to make the whole Image exhibit an obvious black-and-white effect, so that the data volume in the Image is greatly reduced, and the outline of a target can be highlighted.
Optionally, in addition to binarization, graying processing may be performed on the identity card image with the non-identity card region image filtered out.
Step S12.2c: and extracting all contours from the identity card image subjected to binarization processing.
Optionally, the contour extraction in this embodiment may be implemented by FindContours and DrawContour functions in Opencv. FindCours' input image is a binary image, the output is a set of contour points for each connected region, and the function DrawContours is a function for drawing contours.
In the contour extraction step, the influence of the non-identification pattern in the identity card image on identification is eliminated through the filtering and binarization processing of the non-identity card area image, and the accuracy of contour extraction is improved, so that the accuracy of identity card identification is improved.
It should be appreciated that when image recognition is performed without performing direction correction on the identification card image, a recognition area error may be caused by an angle deviation, thereby reducing recognition accuracy. Therefore, as an optional implementation manner, after step S12.4, this embodiment may further include the following steps: comparing the position relation of the designated content area with the position relation of the corresponding content area in the identity card standard template to determine the direction of the identity card image; and when the direction of the identity card image deviates from the preset direction, correcting the direction of the identity card image to the preset direction.
The position relationship comprises the distance between at least two content areas in the designated content areas and the included angle between the midpoint connecting line and the reference line. Wherein the reference line may be a horizontal line or a vertical line, etc. And when the distance between the corresponding content areas in the identity card template and the reference included angle between the midpoint connecting line and the datum line are the same as the obtained included angle to be compared, determining the direction of the identity card image as the preset direction. Otherwise, the direction of the identity card image is considered to deviate from the preset direction, and the identity card image is rotated at the same time, so that the distance between the two content areas and the included angle to be compared are the same as the corresponding value in the identity card template, and the direction of the identity card image is corrected to the preset direction.
In the prior art, the angle correction of the image is usually realized through a sorting filter, the calculation complexity is high, in the direction correcting step of the embodiment, the direction of the identity card image is corrected through the position relation between at least two content areas in the specified content area and the comparison result of the corresponding content area on the identity card template, and the image of each content area is prevented from being intercepted and recognized under the condition of angle error, so that the identification accuracy of the identity card is improved, and the calculation complexity of the angle correction is reduced.
With respect to step S12, this step may include: establishing a coordinate system in the identity card image based on the position of the designated content area; and projecting the coordinate system to the identity card standard template, and determining the positions of other content areas in the identity card image according to the position of the specified content area, the position relation of each content area on the identity card standard template and the coordinates in the coordinate system.
The position of the other content area can be accurately determined by projecting a coordinate system to the identification card standard template, for example, the position of the identification card number content area (designated content area) in the coordinate system of the identification card standard template is (121,122), the position of the name content area (other content area) is (121,342), the position of the identification card number content area in the identification card image is (121,122), and the position of the identification card number content area in the identification card image is (121,342).
In the steps, the coordinate positions of other content areas are determined based on the positions of the content areas of the identity card standard template through the coordinate system established by the specified content areas, so that the positioning accuracy and efficiency of the content areas are improved.
Further, in order to improve the identification accuracy, the present embodiment may further correct the direction of the identification card image based on the coordinate system after the coordinate system is established, and the step may specifically include: determining the direction of the identity card image based on the position interval, the aspect ratio and the coordinates of the two content areas and the comparison result of the position interval, the aspect ratio and the coordinates of the corresponding content areas on the identity card standard template; and when the direction of the identity card image deviates from the preset direction, correcting the direction of the identity card image to the preset direction.
In the steps, the direction of the identity card image is corrected again based on the comparison results of the position interval, the width-to-height ratio and the coordinates of the designated content area and the corresponding content area of the identity card template, and the identification accuracy of the identity card image is further improved.
After the respective content areas are determined through steps S11-S12, the images of the respective content areas may be directly segmented next. It should be understood that image segmentation is a technique and process for dividing an image into a number of specific regions with unique properties and presenting objects of interest, and the step of step S12 may be considered as part of the image segmentation step.
For step S14, the target content area may be set by the identification card information identification and entry party according to specific needs. For example, the e-commerce website needs to input name and address information for receiving and sending commodities, and the content area of the name and the address can be set as the target content area, so that the content area of the name and the address is only used as an identification object, and the complete image identification of the identity card image is not needed, thereby reducing the identification calculation amount and improving the identification efficiency.
Referring to step S15, please refer to fig. 3, where fig. 3 is a schematic flowchart of an image recognition step provided in the embodiment of the present application, and the step may specifically be as follows:
step S15.1: and carrying out minimum neural unit processing on the image of the target content area to obtain a minimum neural unit processing result.
The minimum neural unit processing in this embodiment may be to use a single number in a content area such as an identification number or a single chinese character in a content area such as an address as the minimum neural unit. The minimum Neural unit is a concept in an Artificial Neural Network (ANN), and the Artificial Neural Network refers to a complex Network structure formed by connecting a large number of processing units (neurons) with each other, and is a certain abstraction, simplification and simulation of an organization structure and an operation mechanism of a human brain. The artificial neural network is divided into a plurality of layers and a single layer, each layer comprises a plurality of neurons, the neurons are connected by directed arcs with variable weights, and the network achieves the purpose of processing information and simulating the relation between input and output by a method of gradually adjusting and changing the connection weights of the neurons through repeated learning and training of known information. It does not need to know the exact relation between input and output, does not need a large number of parameters, and only needs to know the non-constant factor causing the output change, namely the non-quantitative parameter. Therefore, compared with the traditional data processing method, the neural network technology has obvious advantages in the aspects of processing fuzzy data, random data and nonlinear data, and is particularly suitable for systems with large scale, complex structure and ambiguous information.
Step S15.2: and loading an identification library of the artificial neural network model.
The recognition library is obtained based on a large number of identification card images during training of the artificial neural network model, and the recognition library comprises character images extracted from the identification card images.
Step S15.3: and calling an artificial neural network model to perform image recognition on the image of the target content area based on the recognition library and the minimum neural unit processing result so as to acquire characters in the image of the target content area.
And calling an artificial neural network model to respectively perform image recognition on each minimum neural unit, and directly calling trained network parameters based on a recognition library, so that the recognition efficiency is improved.
Optionally, in this embodiment, the artificial neural network model may be iteratively trained based on the recognition accuracy thereof during training of the artificial neural network model, so that the recognition accuracy of the artificial neural network model on the preset character is higher than the preset accuracy.
Referring to fig. 4, fig. 4 is a block diagram of an identification card recognition apparatus 20 according to an embodiment of the present application.
The identification card recognition device 20 includes:
a first position determining module 21, configured to determine a position of the specified content area in the identity card image.
And the second position determining module 22 is configured to determine positions of other content areas in the identity card image based on the position of the specified content area and the position relationship of each content area of the identity card.
And the segmentation module 23 is configured to perform image segmentation on the identity card image according to the position of the specified content area and the positions of the other content areas.
And the target determining module 24 is configured to determine an image of a target content area in the images of all the content areas obtained by image segmentation, where the target content area is at least one content area in all the content areas.
And the recognition module 25 is configured to acquire characters in the image of the target content area by performing image recognition on the image of the target content area.
Optionally, the first position determination module 21 includes:
and the identity card image acquisition unit is used for acquiring the identity card image.
And the contour extraction unit is used for extracting all contours in the identity card image.
And the minimum rectangle determining unit is used for acquiring each minimum rectangular area in the identity card image and the plane attribute of each minimum rectangular area based on all the outlines, wherein the plane attribute comprises length and width.
And the designated content area positioning unit is used for identifying the designated content area in the identity card image based on the plane attribute and determining the position of the designated content area.
Wherein the contour extraction unit is further specifically configured to: filtering non-identity card area images in the identity card images by adopting edge detection and a filter; carrying out binarization processing on the identity card image with the non-identity card area image filtered out; and extracting all contours from the identity card image subjected to binarization processing.
Optionally, the identification card recognition device 20 may further include: the first correction module is used for comparing the position relation of the specified content area with the position relation of the corresponding content area in the identity card standard template and determining the direction of the identity card image; and when the direction of the identity card image deviates from the preset direction, correcting the direction of the identity card image to the preset direction.
Further, the second position determination module 22 may include:
the coordinate establishing unit is used for establishing a coordinate system in the identity card image based on the position of the specified content area;
and the content area determining unit is used for projecting the coordinate system to the identity card standard template and determining the positions of other content areas in the identity card image according to the position of the specified content area, the position relation of each content area on the identity card standard template and the coordinates in the coordinate system.
In order to further improve the direction accuracy of the identification card image, the identification card recognition device 20 may further include: the second correction module is used for determining the direction of the identity card image based on the position interval, the width-height ratio and the coordinates of the two content areas and the comparison result of the position interval, the width-height ratio and the coordinates of the corresponding content areas on the identity card standard template; and when the direction of the identity card image deviates from the preset direction, correcting the direction of the identity card image to the preset direction.
Alternatively, the identification module 25 may include:
the minimum neural unit processing unit is used for carrying out minimum neural unit processing on the image of the target content area to obtain a minimum neural unit processing result;
the loading unit is used for loading the identification library of the artificial neural network model;
and the recognition execution unit is used for calling the artificial neural network model to perform image recognition on the image of the target content area based on the recognition library and the processing result of the minimum neural unit so as to acquire characters in the image of the target content area.
The embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the memory stores program instructions, and the processor executes the steps in any one of the methods of identification card identification provided in this embodiment when reading and executing the program instructions.
It should be understood that the electronic device may be a Personal Computer (PC), a tablet PC, a smart phone, a Personal Digital Assistant (PDA), or other electronic device having a logical computing function.
The embodiment of the application also provides a readable storage medium, wherein computer program instructions are stored in the readable storage medium, and the computer program instructions are read by a processor and executed to execute the steps in the identification method of the identity card.
In summary, the embodiment of the present application provides an identification card identification method, an identification card identification device, an electronic device, and a readable storage medium, where the method includes: determining the position of a designated content area in an identity card image; determining the positions of other content areas in the identity card image based on the positions of the specified content areas and the position relation of each content area of the identity card; performing image segmentation on the identity card image according to the position of the designated content area and the positions of other content areas; determining an image of a target content area in images of all content areas obtained by image segmentation, wherein the target content area is at least one content area in all the content areas; and acquiring characters in the image of the target content area by performing image recognition on the image of the target content area.
In the implementation process, the positions of other content areas are positioned through the position relation between the position of the designated content area and the content area of the identity card, the positioning step in image processing is not needed to be carried out on each content area, the calculation requirement of part of image processing is reduced, the identification efficiency of the identity card is improved, meanwhile, the method carries out content area segmentation on the positioned identity card image, and carries out individual identification and acquisition on the characters of the required target content area, so that the identification accuracy is improved.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. The apparatus embodiments described above are merely illustrative, and for example, the block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of devices according to various embodiments of the present application. In this regard, each block in the block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams, and combinations of blocks in the block diagrams, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Therefore, the present embodiment further provides a readable storage medium, in which computer program instructions are stored, and when the computer program instructions are read and executed by a processor, the computer program instructions perform the steps of any of the block data storage methods. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a RanDOm Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. An identification card recognition method, characterized in that the method comprises:
determining the position of a designated content area in an identity card image;
determining the positions of other content areas in the identity card image based on the positions of the specified content areas and the position relation of each content area of the identity card;
performing image segmentation on the identity card image according to the position of the specified content area and the positions of the other content areas;
determining an image of a target content area in images of all content areas obtained by image segmentation, wherein the target content area is at least one content area in all the content areas;
and acquiring characters in the image of the target content area by carrying out image recognition on the image of the target content area.
2. The method of claim 1, wherein determining the location of the designated content area in the identification card image comprises:
acquiring the identity card image;
extracting all contours in the identity card image;
acquiring each minimum rectangular area in the identity card image and the plane attribute of each minimum rectangular area based on all the outlines, wherein the plane attribute comprises length and width;
and identifying the designated content area in the identity card image based on the plane attribute, and determining the position of the designated content area.
3. The method of claim 2, wherein the extracting all contours in the identification card image comprises:
filtering out non-identity card area images in the identity card images by adopting edge detection and a filter;
carrying out binarization processing on the identity card image with the non-identity card area image filtered out;
and extracting all the contours from the identity card image subjected to binarization processing.
4. The method of claim 2, wherein the designated content area comprises at least two content areas, and wherein after the identifying the designated content area in the identification card image based on the planar attributes, the method further comprises:
comparing the position relation of the designated content area with the position relation of the corresponding content area in the identity card standard template to determine the direction of the identity card image;
and when the direction of the identity card image deviates from a preset direction, correcting the direction of the identity card image to the preset direction.
5. The method according to claim 1, wherein the determining the positions of the other content areas in the identity card image based on the position of the designated content area and the position relationship of each content area of the identity card comprises:
establishing a coordinate system in the identity card image based on the position of the designated content area;
and projecting the coordinate system to an identity card standard template, and determining the positions of other content areas in the identity card image according to the positions of the specified content areas, the position relation of each content area on the identity card standard template and the coordinates in the coordinate system.
6. The method according to claim 5, wherein the designated content area includes at least two content areas, and after determining the positions of the other content areas in the identity card image based on the position of the designated content area and the position relationship of the content areas of the identity card, the method further comprises:
determining the direction of the identity card image based on the position interval, the aspect ratio and the coordinates of the two content areas and the comparison result of the position interval, the aspect ratio and the coordinates of the corresponding content areas on the identity card standard template;
and when the direction of the identity card image deviates from a preset direction, correcting the direction of the identity card image to the preset direction.
7. The method of claim 1, wherein the image recognizing the image of the target content area to obtain the characters in the image of the target content area comprises:
performing minimum neural unit processing on the image of the target content area to obtain a minimum neural unit processing result;
loading an identification library of the artificial neural network model;
and calling the artificial neural network model to perform image recognition on the image of the target content area based on the recognition library and the minimum neural unit processing result so as to acquire characters in the image of the target content area.
8. An identification card recognition apparatus, the apparatus comprising:
the first position determining module is used for determining the position of the designated content area in the identity card image;
the second position determining module is used for determining the positions of other content areas in the identity card image based on the position of the specified content area and the position relation of each content area of the identity card;
the segmentation module is used for carrying out image segmentation on the identity card image according to the position of the specified content area and the positions of the other content areas;
the target determining module is used for determining images of target content areas in the images of all content areas obtained by image segmentation, wherein the target content areas are any content areas in the identity card images;
and the recognition module is used for carrying out image recognition on the image of the target content area to obtain characters in the image of the target content area.
9. An electronic device comprising a memory having stored therein program instructions and a processor that, when executed, performs the steps of the method of any of claims 1-7.
10. A readable storage medium having stored thereon computer program instructions for executing the steps of the method according to any one of claims 1 to 7 when executed by a processor.
CN201911027888.7A 2019-10-25 2019-10-25 Identification card identification method and device, electronic equipment and readable storage medium Pending CN110781890A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911027888.7A CN110781890A (en) 2019-10-25 2019-10-25 Identification card identification method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911027888.7A CN110781890A (en) 2019-10-25 2019-10-25 Identification card identification method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN110781890A true CN110781890A (en) 2020-02-11

Family

ID=69386847

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911027888.7A Pending CN110781890A (en) 2019-10-25 2019-10-25 Identification card identification method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN110781890A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111709413A (en) * 2020-06-22 2020-09-25 中国平安财产保险股份有限公司 Certificate verification method and device based on image recognition, computer equipment and medium
CN112163578A (en) * 2020-09-25 2021-01-01 深兰人工智能芯片研究院(江苏)有限公司 Method and system for improving OCR recognition rate
CN112686247A (en) * 2020-12-10 2021-04-20 广州广电运通金融电子股份有限公司 Identification card number detection method and device, readable storage medium and terminal
WO2021218183A1 (en) * 2020-04-30 2021-11-04 平安科技(深圳)有限公司 Certificate edge detection method and apparatus, and device and medium
WO2023019508A1 (en) * 2021-08-19 2023-02-23 宁德时代新能源科技股份有限公司 Method for detecting glue application area, electronic device and computer-readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4538059A (en) * 1981-09-16 1985-08-27 Itr International Time Limited Identification card with concealed coding and a simple reader module to decode it
EP0805409A2 (en) * 1994-03-21 1997-11-05 I.D. Tec, S.L. Biometric security process for authenticating identity and credit cards, visas, passports and facial recognation
CN103488984A (en) * 2013-10-11 2014-01-01 从兴技术有限公司 Method and device for identifying second-generation identity cards based on intelligent mobile equipment
CN106156768A (en) * 2016-07-01 2016-11-23 屈桢深 The vehicle registration certificate detection method of view-based access control model
CN108734235A (en) * 2018-04-04 2018-11-02 四川骏逸富顿科技有限公司 A kind of personal identification method and system for electronic prescription
CN108805800A (en) * 2018-04-24 2018-11-13 北京嘀嘀无限科技发展有限公司 image processing method, device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4538059A (en) * 1981-09-16 1985-08-27 Itr International Time Limited Identification card with concealed coding and a simple reader module to decode it
EP0805409A2 (en) * 1994-03-21 1997-11-05 I.D. Tec, S.L. Biometric security process for authenticating identity and credit cards, visas, passports and facial recognation
CN103488984A (en) * 2013-10-11 2014-01-01 从兴技术有限公司 Method and device for identifying second-generation identity cards based on intelligent mobile equipment
CN106156768A (en) * 2016-07-01 2016-11-23 屈桢深 The vehicle registration certificate detection method of view-based access control model
CN108734235A (en) * 2018-04-04 2018-11-02 四川骏逸富顿科技有限公司 A kind of personal identification method and system for electronic prescription
CN108805800A (en) * 2018-04-24 2018-11-13 北京嘀嘀无限科技发展有限公司 image processing method, device and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021218183A1 (en) * 2020-04-30 2021-11-04 平安科技(深圳)有限公司 Certificate edge detection method and apparatus, and device and medium
CN111709413A (en) * 2020-06-22 2020-09-25 中国平安财产保险股份有限公司 Certificate verification method and device based on image recognition, computer equipment and medium
CN112163578A (en) * 2020-09-25 2021-01-01 深兰人工智能芯片研究院(江苏)有限公司 Method and system for improving OCR recognition rate
CN112686247A (en) * 2020-12-10 2021-04-20 广州广电运通金融电子股份有限公司 Identification card number detection method and device, readable storage medium and terminal
WO2023019508A1 (en) * 2021-08-19 2023-02-23 宁德时代新能源科技股份有限公司 Method for detecting glue application area, electronic device and computer-readable storage medium

Similar Documents

Publication Publication Date Title
CN110781890A (en) Identification card identification method and device, electronic equipment and readable storage medium
CN108920580B (en) Image matching method, device, storage medium and terminal
CN111259889A (en) Image text recognition method and device, computer equipment and computer storage medium
CN106447721B (en) Image shadow detection method and device
CN108875731B (en) Target identification method, device, system and storage medium
US20190362193A1 (en) Eyeglass positioning method, apparatus and storage medium
US11823358B2 (en) Handwritten content removing method and device and storage medium
US20190294921A1 (en) Field identification in an image using artificial intelligence
US8781227B2 (en) Recognition of numerical characters in digital images
CN111680690B (en) Character recognition method and device
CN111178355B (en) Seal identification method, device and storage medium
CN109902541B (en) Image recognition method and system
CN110751146B (en) Text region detection method, device, electronic terminal and computer readable storage medium
CN112101386B (en) Text detection method, device, computer equipment and storage medium
CN111259891B (en) Method, device, equipment and medium for identifying identity card in natural scene
CN113111880B (en) Certificate image correction method, device, electronic equipment and storage medium
CN114092938B (en) Image recognition processing method and device, electronic equipment and storage medium
CN108256520B (en) Method for identifying coin year, terminal equipment and computer readable storage medium
CN113221897B (en) Image correction method, image text recognition method, identity verification method and device
CN110991201B (en) Bar code detection method and related device
CN114049568A (en) Object shape change detection method, device, equipment and medium based on image comparison
CN111178153A (en) Traffic sign detection method and system
CN114495146A (en) Image text detection method and device, computer equipment and storage medium
CN112749576A (en) Image recognition method and device, computing equipment and computer storage medium
CN114120300A (en) Picture correction method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200211

RJ01 Rejection of invention patent application after publication