Search

CN-121999509-A - Identification card number identification method and device, terminal equipment and storage medium

CN121999509ACN 121999509 ACN121999509 ACN 121999509ACN-121999509-A

Abstract

The invention discloses an identification card number identification method, an identification card number identification device, terminal equipment and a storage medium, wherein the identification card number identification method comprises the steps of authorizing a user to perform gray processing on an identification card image to be identified to obtain a gray identification card image and a differential energy identification card image; the method comprises the steps of obtaining pixel coordinates of any gray pixel in a gray-scale identity card image, obtaining differential energy pixels from the differential energy identity card image based on the pixel coordinates, comparing the gray-scale pixels with the differential energy pixels until all gray-scale pixels are polled to obtain an identity card edge image, determining a highlight identity card area based on the identity card edge image, performing inflation treatment and connected domain obtaining treatment on the highlight identity card area based on an inflation algorithm to obtain an identity card number connected domain set, selecting a target identity card number connected domain from the identity card number connected domain set based on a screening rule, obtaining a target identity card number area based on the target identity card number connected domain, and identifying the target identity card number area to obtain a target identity card number so as to improve the accuracy of identity card number identification.

Inventors

  • SHI WENCHEN
  • CAI JINGBO
  • WANG YICHUAN
  • XIAO YANG
  • WEI LICHAO

Assignees

  • 上汽通用五菱汽车股份有限公司

Dates

Publication Date
20260508
Application Date
20260122

Claims (10)

  1. 1. An identification card number identification method is characterized by comprising the following steps: acquiring an identity card image to be identified by user authorization, and carrying out gray processing on the identity card image to be identified by user authorization to obtain a gray identity card image; obtaining a differential energy identity card image based on a preset differential image generation algorithm and the gray identity card image; For any gray pixel in the gray identity card graph, acquiring a pixel coordinate corresponding to the gray pixel, acquiring a differential energy pixel from the differential energy identity card graph based on the pixel coordinate, and comparing the gray pixel with the differential energy pixel until all gray pixels in the gray identity card graph are polled to obtain an identity card edge graph; determining a highlight identity card region based on the identity card edge map; Expanding the highlight identity card region based on a preset expansion algorithm to obtain an initial identity card number region; Carrying out connected domain acquisition processing on the initial identity card number region to obtain an identity card number connected domain set; Selecting a target identity card number connected domain from the identity card number connected domain set based on a preset screening rule, and obtaining a target identity card number region based on the target identity card number connected domain; and identifying the target identity card number area to obtain the target identity card number.
  2. 2. The method for identifying an identification card number according to claim 1, wherein the steps of obtaining an identification card image to be identified by a user authorization, and performing gray processing on the identification card image to be identified by the user authorization to obtain a gray identification card image include: Acquiring an original identity card image; Cutting the edge of the original identity card image based on a preset cutting threshold value to obtain the identity card image to be identified by the user authorization.
  3. 3. The identification method of claim 1, wherein the obtaining a differential energy identification card image based on a preset differential image generation algorithm and the gray scale identification card image comprises: performing offset processing on the gray-scale identity card image based on a preset offset value and a preset offset direction to obtain a plurality of offset identity card images; and fusing the gray-scale identity card image and the offset identity card images based on a preset fusion algorithm to obtain a differential energy identity card image.
  4. 4. The identification method of claim 1, wherein the determining the highlighted identification card area based on the identification card edge map comprises: dividing the identity card edge map based on a preset gray identification threshold value to obtain a binary identity card map; and determining a highlight identity card area based on the binary identity card graph.
  5. 5. The identification method of claim 3, wherein the step of obtaining the connected domain of the initial identification number region to obtain the connected domain set of identification numbers comprises: Acquiring all the identity card number image pixels in the initial identity card number area, and initializing the marking state of the identity card number image pixels as unmarked; Repeatedly executing the connected domain generation step until the marking states of all the identity card number image pixels in the initial identity card number area are marked states, obtaining a plurality of identity card number connected domains, and taking the plurality of identity card number connected domains as an identity card number connected domain set; The identity card number connected domain generation step comprises the steps of arbitrarily selecting an identity card number image element with a marked state being an unmarked state as a current identity card number image element, and executing an adjacent pixel merging step based on the current identity card number image element until the marked states of adjacent identity card number image pixels of the current identity card number image pixel are marked states, so as to obtain an identity card number connected domain; the adjacent pixel merging step is to update the marking state of the current identification card number image pixel to a marked state, obtain an adjacent identification card number image pixel set of the current identification card number image pixel, and take each adjacent identification card number image pixel in the adjacent identification card number image pixel set as the current identification card number image pixel.
  6. 6. The identification method of claim 4, wherein selecting a target identification number connected domain from the collection of identification number connected domains based on a preset screening rule, and obtaining a target identification number region based on the target identification number connected domain comprises: acquiring the connected domain areas and the aspect ratios of the connected domains of all the identity card number connected domains in the identity card number connected domain set; And selecting a target identity card number connected domain from the identity card number connected domain set based on the preset identity card number area, the preset identity card number length-width ratio, the connected domain area and the connected domain length-width ratio.
  7. 7. The identification method of claim 4, wherein the identifying the target identification number area to obtain the target identification number comprises: Identifying the target identity card number area to obtain an initial identity card number; acquiring the length of the identification card number of the initial identification card number; And comparing the preset identity card number standard length with the identity card number length, and taking the initial identity card number as the target identity card number when the preset identity card number standard length is equal to the identity card number length.
  8. 8. An identification card number recognition device, comprising: The acquisition module is used for acquiring an identity card image to be identified by user authorization, and carrying out gray processing on the identity card image to be identified by user authorization to obtain a gray identity card image; the differential energy identity card image construction module is used for obtaining a differential energy identity card image based on a preset differential image generation algorithm and the gray identity card image; The comparison module is used for acquiring pixel coordinates corresponding to any gray pixel in the gray identity card graph, acquiring differential energy pixels from the differential energy identity card graph based on the pixel coordinates, and comparing the gray pixel with the differential energy pixels until all gray pixels in the gray identity card graph are polled to obtain an identity card edge graph; the high-brightness identity card region determining module is used for determining a high-brightness identity card region based on the identity card edge map; the expansion module is used for carrying out expansion treatment on the highlight identity card region based on a preset expansion algorithm to obtain an initial identity card number region; the communication module is used for carrying out communication domain acquisition processing on the initial identity card number region to obtain an identity card number communication domain set; The screening module is used for selecting a target identity card number connected domain from the identity card number connected domain set based on a preset screening rule, and obtaining a target identity card number region based on the target identity card number connected domain; And the identification module is used for identifying the target identity card number area to obtain a target identity card number.
  9. 9. A terminal device comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, the processor implementing a method of identification card number as claimed in any one of claims 1-7 when the computer program is executed.
  10. 10. A computer readable storage medium comprising a stored computer program, wherein the computer program, when run, controls a device in which the computer readable storage medium is located to perform an identification card number recognition method as claimed in any one of claims 1-7.

Description

Identification card number identification method and device, terminal equipment and storage medium Technical Field The present invention relates to the field of identification card number identification, and in particular, to an identification card number identification method, an identification card number identification device, a terminal device, and a storage medium. Background Currently, in the scenes such as a high-speed rail station and transaction handling, the identity card number of the identity card for the active placement authorization identification of a user needs to be acquired for identity verification, the identity card number identification is a core identity confirmation link, and the identification efficiency and accuracy directly influence the fluency and safety of the related transaction. However, various visual noises such as head images and shading exist on the surface of the identity card, so that the effective identification of the identity card number is directly influenced, in the existing identity card number identification method, a part of the existing identity card number identification method depends on a deep learning model, but the method needs a large number of samples for training, has higher requirements on hardware equipment and is required to depend on GPU support, so that the deployment cost is high, the flexibility is poor, the method is difficult to be rapidly applied to a common terminal, and a part of the method adopts a single threshold value for edge extraction, but the method is greatly influenced by factors such as illumination change, image noise and the like, cannot effectively highlight the edge characteristics of the identity card number characters, and further influences the accurate extraction of the identity card number characters. Disclosure of Invention The invention provides an identification method, an identification device, terminal equipment and a storage medium, which can solve the problems and improve the identification accuracy of an identification card. The invention provides an identification card number identification method, which comprises the following steps: acquiring an identity card image to be identified by user authorization, and carrying out gray processing on the identity card image to be identified by user authorization to obtain a gray identity card image; obtaining a differential energy identity card image based on a preset differential image generation algorithm and the gray identity card image; For any gray pixel in the gray identity card graph, acquiring a pixel coordinate corresponding to the gray pixel, acquiring a differential energy pixel from the differential energy identity card graph based on the pixel coordinate, and comparing the gray pixel with the differential energy pixel until all gray pixels in the gray identity card graph are polled to obtain an identity card edge graph; determining a highlight identity card region based on the identity card edge map; Expanding the highlight identity card region based on a preset expansion algorithm to obtain an initial identity card number region; Carrying out connected domain acquisition processing on the initial identity card number region to obtain an identity card number connected domain set; Selecting a target identity card number connected domain from the identity card number connected domain set based on a preset screening rule, and obtaining a target identity card number region based on the target identity card number connected domain; and identifying the target identity card number area to obtain the target identity card number. According to the scheme, all gray pixels in the gray identity card image are polled one by one, corresponding differential energy pixels are obtained according to pixel coordinates and compared, the background removing effect can be effectively achieved, character edge gradient energy is remarkably amplified, stroke contrast is enhanced, a large amount of visual noise on the surface of the identity card is effectively filtered, the identity card edge image with high signal to noise ratio is generated, and the highlight identity card area is accurately determined. And then, carrying out expansion treatment and connected domain acquisition treatment on the highlighted identity card region, selecting a target identity card number connected domain by combining a preset screening rule, effectively and accurately locking the target identity card number region, avoiding the interference of irrelevant regions, and subsequently only identifying the target identity card number region. In another embodiment, the obtaining the identity card image to be identified by the user authorization and performing gray processing on the identity card image to be identified by the user authorization to obtain a gray identity card image includes: Acquiring an original identity card image; Cutting the edge of the original identity card image based on a preset cutting