CN116721409A - Bank card number identification method and device, nonvolatile storage medium and electronic equipment - Google Patents

Bank card number identification method and device, nonvolatile storage medium and electronic equipment Download PDF

Info

Publication number
CN116721409A
CN116721409A CN202310723495.XA CN202310723495A CN116721409A CN 116721409 A CN116721409 A CN 116721409A CN 202310723495 A CN202310723495 A CN 202310723495A CN 116721409 A CN116721409 A CN 116721409A
Authority
CN
China
Prior art keywords
bank card
image
card number
characters
identified
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
CN202310723495.XA
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310723495.XA priority Critical patent/CN116721409A/en
Publication of CN116721409A publication Critical patent/CN116721409A/en
Pending legal-status Critical Current

Links

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
    • G06V20/63Scene text, e.g. street names
    • 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
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words
    • 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
    • G06V30/16Image preprocessing
    • G06V30/164Noise filtering
    • 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
    • G06V30/18Extraction of features or characteristics of the image
    • G06V30/1801Detecting partial patterns, e.g. edges or contours, or configurations, e.g. loops, corners, strokes or intersections
    • 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
    • G06V30/19Recognition using electronic means
    • G06V30/19007Matching; Proximity measures
    • G06V30/19093Proximity measures, i.e. similarity or distance measures

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Character Input (AREA)

Abstract

The application discloses a bank card number identification method and device, a nonvolatile storage medium and electronic equipment. Relates to the field of financial science and technology, and the method comprises the following steps: acquiring a bank card image to be identified; performing edge detection on the bank card image to be identified by adopting N preset convolution operators, and determining the edge of the bank card number in the bank card image to be identified, wherein the N convolution operators are matrices with fixed values, and are used for performing edge detection on the bank card image to be identified from N directions respectively, and N is an integer greater than 1; determining M bank card number characters according to the edges of the bank card numbers, wherein M is an integer greater than 1; and identifying M bank card number characters to obtain the bank card numbers in the bank card images to be identified. The application solves the technical problem of low identification accuracy of the bank card number in the related technology.

Description

Bank card number identification method and device, nonvolatile storage medium and electronic equipment
Technical Field
The application relates to the field of financial science and technology, in particular to a bank card number identification method and device, a nonvolatile storage medium and electronic equipment. It should be noted that the bank card number identification method, the device, the nonvolatile storage medium and the electronic equipment determined by the application can be used for bank card number identification in the field of financial science and technology, and can also be used for card number identification in any field except the field of financial science and technology, and the application fields of the bank card number identification method, the device, the nonvolatile storage medium and the electronic equipment related by the application are not limited.
Background
With the increasing popularity of bank cards, people need to enter bank card numbers on various occasions and bind the bank cards for funds transaction. When the card number is recorded, the photographed or pre-stored bank card number image needs to be identified, and the card number information in the bank card number image is extracted.
The existing bank card recognition technology has the problem that the character positioning and segmentation precision is insufficient, is greatly influenced by environmental factors such as character adhesion, pollution, illumination non-uniformity and the like, and further causes that the accuracy of bank card number recognition is not high. The card number identification system commonly used in the industry has single equipment and low data processing capacity, and cannot well complete the work of large data volume.
Aiming at the technical problem of low identification accuracy of the bank card number in the related technology, no effective solution is proposed at present.
Disclosure of Invention
The embodiment of the application provides a bank card number identification method and device, a nonvolatile storage medium and electronic equipment, which are used for at least solving the technical problem of low bank card number identification accuracy.
In order to achieve the above object, according to one aspect of the present application, there is provided a bank card number recognition method. The method comprises the following steps: acquiring a bank card image to be identified; performing edge detection on the bank card image to be identified by adopting N preset convolution operators, and determining the edge of the bank card number in the bank card image to be identified, wherein the N convolution operators are matrices with fixed values, and are used for performing edge detection on the bank card image to be identified from N directions respectively, and N is an integer greater than 1; determining M bank card number characters according to the edges of the bank card numbers, wherein M is an integer greater than 1; and identifying M bank card number characters to obtain the bank card numbers in the bank card images to be identified.
Optionally, performing edge detection on the image of the bank card to be identified by adopting N preset convolution operators, and determining the edge of the bank card number in the image of the bank card to be identified, including: converting the bank card image to be identified into a gray image; carrying out convolution operation on N convolution operators and the gray level image respectively to obtain N operation results corresponding to the N convolution operators, wherein the N operation results respectively represent the variation degree of the pixel value of the gray level image in N directions; and superposing the N operation results to determine the edge of the bank card number.
Optionally, overlapping the N operation results to determine an edge of the bank card number, including: and superposing N operation results to obtain an edge extraction image of the bank card image to be identified, and obtaining L bank card pattern templates, wherein L is an integer greater than 1, determining a target pattern template matched with the edge extraction image in the L bank card pattern templates, comparing the edge extraction image with the target pattern template, and determining the edge of the bank card number in the edge extraction image.
Optionally, determining M bank card number characters according to edges of the bank card numbers includes: and acquiring the resolution of a camera shooting the image of the bank card to be identified and the size of the number of the bank card in the target pattern template, and dividing the edge of the bank card number into M bank card number characters according to the resolution of the camera and the size of the number of the bank card in the bank card pattern template.
Optionally, before performing convolution operation on the gray image by using N convolution operators, respectively, to obtain N operation results corresponding to the N convolution operators, the method includes: and carrying out noise reduction treatment on the gray level image or carrying out noise reduction treatment on the bank card image to be identified.
Optionally, identifying M bank card number characters to obtain a bank card number in a bank card image to be identified, including: and obtaining K template characters, wherein K is an integer greater than 1, respectively matching M bank card number characters with the K template characters, determining M template characters respectively corresponding to the M bank card number characters, wherein the K template characters comprise M template characters corresponding to the M bank card number characters, and determining the number corresponding to the M template characters as the bank card number in the bank card image to be identified.
Optionally, matching the M bank card number characters with the K template characters respectively, and determining M template characters corresponding to and matched with the M bank card number characters respectively, including: and respectively determining the similarity between the processing characters in the M bank card number characters and the K template characters, determining the maximum similarity in the similarity between the processing characters and the K template characters as target similarity, and determining that the template characters corresponding to the target similarity are matched with the processing characters under the condition that the target similarity is larger than a preset threshold value.
In order to achieve the above object, according to another aspect of the present application, there is provided a bank card number recognition apparatus. The device comprises: the acquisition module is used for acquiring the bank card image to be identified; the detection module is used for carrying out edge detection on the bank card image to be identified by adopting N preset convolution operators, and determining the edge of the bank card number in the bank card image to be identified, wherein the N convolution operators are matrices with fixed values, the N convolution operators are used for carrying out edge detection on the bank card image to be identified from N directions respectively, and N is an integer larger than 1; the determining module is used for determining M bank card number characters according to the edges of the bank card numbers, wherein M is an integer greater than 1; and the identification module is used for identifying M bank card number characters to obtain the bank card numbers in the bank card images to be identified.
In order to achieve the above object, according to another aspect of the present application, there is provided a nonvolatile storage medium including a stored program, wherein the bank card number identification method of any one of the above items of equipment in which the nonvolatile storage medium is controlled when the program runs.
In order to achieve the above object, according to another aspect of the present application, there is provided an electronic device including one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the bank card number identification method of any one of the above.
According to the application, the following steps are adopted: acquiring a bank card image to be identified; performing edge detection on the bank card image to be identified by adopting N preset convolution operators, and determining the edge of the bank card number in the bank card image to be identified; determining M bank card number characters according to the edges of the bank card numbers; the method comprises the steps of identifying M bank card number characters to obtain the bank card numbers in the bank card images to be identified, achieving the purpose of high character positioning and segmentation precision, solving the technical problem of low bank card number identification accuracy in the related art, and further achieving the technical effect of improving the bank card number identification accuracy.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
FIG. 1 is a flow chart of a method for identifying a bank card number according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a convolution operator provided in accordance with an alternative embodiment of the present application;
FIG. 3 is a schematic diagram of a bank card number identification system provided in accordance with an alternative embodiment of the present application;
fig. 4 is a schematic diagram of a bank card number recognition device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device for performing a method for identifying a bank card number according to an embodiment of the present application.
Detailed Description
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe the embodiments of the application herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that, related information (including, but not limited to, user equipment information, user personal information, etc.) and data (including, but not limited to, data for presentation, analyzed data, etc.) related to the present disclosure are information and data authorized by a user or sufficiently authorized by each party. For example, an interface is provided between the system and the relevant user or institution, before acquiring the relevant information, the system needs to send an acquisition request to the user or institution through the interface, and acquire the relevant information after receiving the consent information fed back by the user or institution.
The present application will be described with reference to preferred implementation steps, and fig. 1 is a flowchart of a method for identifying a bank card number according to an embodiment of the present application, as shown in fig. 1, and the method includes the following steps:
step S101, acquiring a bank card image to be identified.
In this step, the image of the bank card to be identified is the image of the bank card collected by the camera, and at least the card number of the bank card needs to be included in the image, which may be the image of the bank card containing the face of the bank card number and an image of a small background. Specifically, the bank card can be placed in the photographing range of the camera, and the camera photographs the bank card containing the bank card number to obtain a bank card image to be identified.
Step S102, edge detection is carried out on the image of the bank card to be identified by adopting N preset convolution operators, and the edge of the bank card number in the image of the bank card to be identified is determined, wherein the N convolution operators are used for carrying out edge detection on the image of the bank card to be identified from N directions respectively, and N is an integer larger than 1, and the convolution operators are matrices with fixed values.
In this step, the predetermined N convolution operators may be N matrices, and each matrix in the N matrices may be a 3×3 matrix having no fixed number of unknowns. When the N convolution operators are adopted to carry out edge detection on the image of the bank card to be identified, the effect of carrying out edge detection on the image of the bank card to be identified from N directions can be achieved. Wherein, N can be 2, 4 or 8. When N is 2, edge detection is performed on the image by adopting 2 convolution operators, namely, edge detection is performed on the image from the 0-degree direction and the 90-degree direction; when N is 4, edge detection is performed on the image by adopting 4 convolution operators, namely, edge detection is performed on the image from the 0-degree direction and the 90-degree direction of the image, the 45-degree direction and the 135-degree direction of the image; when N is 8, 8 convolution operators are used to perform edge detection on the image, namely, image detection is performed from the opposite directions of the four directions on the basis of performing edge detection on the image from the 0-degree direction and the 90-degree direction of the image, the 45-degree direction and the 135-degree direction of the image.
In the case of an image, when the image is edge-detected in the vertical direction, the edge of the image is detected from top to bottom, and the edge of the image is detected from bottom to top, so that the edge in the image can be more accurately identified by using 8 convolution operators.
Step S103, M characters of the bank card number are determined according to the edges of the bank card number, wherein M is an integer greater than 1.
In the step, as the space between the numbers in the bank card is smaller, the problem of character adhesion and character breakage is easy to occur during image recognition. Therefore, after the edges of the bank card numbers are determined, the bank card numbers adhered together can be divided into single digital characters, namely M bank card number characters are determined.
Step S104, identifying M bank card number characters to obtain the bank card numbers in the bank card images to be identified.
After the steps are carried out, M bank card number characters can be extracted from the bank card image to be identified, in the steps, the M bank card number characters can be identified, the digital meaning corresponding to each bank card number character is determined, and finally the bank card number in the bank card image to be identified is determined.
The bank card number identification method provided by the embodiment of the application comprises the steps of obtaining a bank card image to be identified; performing edge detection on the bank card image to be identified by adopting N preset convolution operators, and determining the edge of the bank card number in the bank card image to be identified; determining M bank card number characters according to the edges of the bank card numbers; and identifying M bank card number characters to obtain the bank card number in the bank card image to be identified, so that the technical problem of low bank card number identification accuracy in the related art is solved, and the technical effect of improving the bank card number identification accuracy is further achieved.
As an optional embodiment, using N preset convolution operators, performing edge detection on a to-be-identified bank card image, and determining an edge of a bank card number in the to-be-identified bank card image, including: converting the bank card image to be identified into a gray image; carrying out convolution operation on N convolution operators and the gray level image respectively to obtain N operation results corresponding to the N convolution operators, wherein the N operation results respectively represent the variation degree of the pixel value of the gray level image in N directions; and superposing the N operation results to determine the edge of the bank card number.
Alternatively, the bank card image to be recognized may be a color photograph, but in edge detection of the image, the influence of the color in each pixel may not be considered, and only whether the pixel value itself is mutated or not may be considered. In this case, in order to simplify the calculation amount of edge recognition, the bank card image to be recognized can be converted into a gray image, the influence of different colors in the image is removed, only the gray or brightness of the pixel value itself is considered, whether the gray or brightness of the pixel value in the image is suddenly changed is analyzed, and the position where the pixel value suddenly changes is the edge position in the image.
The convolution operation can be carried out on the N convolution operators and the gray level image respectively to obtain N operation results corresponding to the N convolution operators, and the numerical value of the matrix in the N convolution operators can be set, so that the numerical value of the obtained image matrix is the gradient value of the pixel in the original image matrix changing in the corresponding direction after the convolution operation is carried out on the gray level image and each operator. FIG. 2 is a schematic diagram of a convolution operator provided according to an alternative embodiment of the present application, where a matrix in a 0 ° direction and a convolution operator in a 180 ° direction may be set as shown in FIG. 2, after multiplication of the convolution operator in the 0 ° direction with an image matrix, an operation result obtained by subtracting a value of a first column from a third column in the original image matrix, and after multiplication of the convolution operator in the 180 ° direction with the image matrix, an operation result obtained by subtracting a value of a 3 rd column from the first column in the original image matrix, that is, after operation of the convolution operator in the 0 ° direction and the convolution operator in the 180 ° direction with the image respectively, a gradient value of a pixel in the original image matrix varying in a horizontal direction may be determined from a left-to-right direction and from a right-to-left direction; similarly, as shown in fig. 2, a convolution operator in the 90 ° direction, a convolution operator in the 270 ° direction, a convolution operator in the 45 ° direction, a convolution operator in the 225 ° direction, a convolution operator in the 135 ° direction, and a convolution operator in the 315 ° direction may be set, where the convolution operator in the 90 ° direction corresponds to the convolution operator in the 270 ° direction, and gradient values of the pixels in the original image matrix that vary in the vertical direction may be determined from the opposite two directions; the convolution operator in the 45-degree direction corresponds to the convolution operator in the 225-degree direction, and gradient values of pixels in the original image matrix, which change in the diagonal direction from the upper left corner to the lower right corner, can be determined from the two opposite directions; the convolution operator in the 135 ° direction corresponds to the convolution operator in the 315 ° direction, and the gradient values of the pixels in the original image matrix changing in the diagonal direction from the upper right corner to the lower left corner can be determined from the two opposite directions.
It should be noted that in the practical application process, any number of the above 8 convolution operators may be adopted to perform convolution operation with the to-be-identified bank card image, each convolution operator and the to-be-identified bank card image may be operated to obtain an operation result, and N operation results may be superimposed, that is, the change of the pixel values of the gray level images in N directions is comprehensively considered, and finally the edge in the to-be-identified bank card image is determined. The superposition of the N operation results may specifically be that the square sum and the root number of the N operation results corresponding to each pixel are calculated, the pixel value corresponding to the pixel after superposition is obtained, and the value after superposition of each pixel value in the gray image is respectively determined. When the pixel value after the superposition of the N operation results is larger than the set threshold value, the pixel value can be determined to belong to the edge in the image, the pixels after the superposition of the N operation results can be traversed, all the pixels included in the edge image can be determined, and the edge extraction image of the bank card image to be identified after the superposition of the N operation results can be obtained.
As an alternative embodiment, overlapping N operation results to determine an edge of the bank card number, including: and superposing N operation results to obtain an edge extraction image of the bank card image to be identified, and obtaining L bank card pattern templates, wherein L is an integer greater than 1, determining a target pattern template matched with the edge extraction image in the L bank card pattern templates, comparing the edge extraction image with the target pattern template, and determining the edge of the bank card number in the edge extraction image.
Alternatively, since the financial institution may issue multiple types of bank cards, where the positions of the card numbers may be inconsistent in each type of bank card, the existing L bank card type templates may be acquired, and the template used for determining the current bank card image to be identified is the target type template. And comparing the bank card image to be identified with a target pattern target, and determining the position of the bank card number in the edge extraction image, so as to determine the edge of the bank card number from the edge extraction image. It should be noted that, the L bank card style templates may be updated according to actual situations.
As an alternative embodiment, determining M bank card number characters according to edges of the bank card number includes: and acquiring the resolution of a camera shooting the image of the bank card to be identified and the size of the number of the bank card in the target pattern template, and dividing the edge of the bank card number into M bank card number characters according to the resolution of the camera and the size of the number of the bank card in the bank card pattern template.
Alternatively, in each style of bank card, the locations where the card numbers are located may not be identical, and the spacing between each number in the card numbers may also be inconsistent. In addition, the resolution of the camera and the distance from the camera to the bank card for shooting the image of the bank card to be identified are not fixed values, that is, the resolution of the camera and the size of the number of the bank card in the bank card model template affect the position of the number in the image of the bank card to be identified. Therefore, the resolution of a camera shooting the image of the bank card to be identified and the size of the bank card number in the target pattern template can be obtained, and the position of the vertical dividing line dividing the edge of the bank card number into M bank card number characters can be determined.
As an alternative embodiment, before performing convolution operation with the gray image by using N convolution operators, respectively, to obtain N operation results corresponding to the N convolution operators, the method includes: and carrying out noise reduction treatment on the gray level image or carrying out noise reduction treatment on the bank card image to be identified.
Optionally, noise reduction, corrosion and expansion of the gray scale image are also required before the N operation results are obtained. Noise reduction can reduce the influence of noise on convolution operation results; etching can remove non-target area image blocks in the digital image containing the card number; the expansion can thicken the edge of the digital character by 2-3 pixels, so that the subsequent segmentation of the card number digital image is facilitated.
As an optional embodiment, identifying M bank card number characters to obtain a bank card number in a bank card image to be identified includes: and obtaining K template characters, wherein K is an integer greater than 1, respectively matching M bank card number characters with the K template characters, determining M template characters respectively corresponding to the M bank card number characters, wherein the K template characters comprise M template characters corresponding to the M bank card number characters, and determining the number corresponding to the M template characters as the bank card number in the bank card image to be identified.
As an optional embodiment, respectively matching M banking card number characters with K template characters, determining M template characters respectively corresponding to and matched with the M banking card number characters, including: and respectively determining the similarity between the processing characters in the M bank card number characters and the K template characters, determining the maximum similarity in the similarity between the processing characters and the K template characters as target similarity, and determining that the template characters corresponding to the target similarity are matched with the processing characters under the condition that the target similarity is larger than a preset threshold value.
Alternatively, the processing character may be a certain character of the recognized M bank card number characters, and in the matching stage, the numerical meaning of each of the M bank card number characters needs to be determined. The template characters for which the corresponding numerical meanings have been determined may be acquired first, and specifically, ten-digit images of digits 0 to 9 may be acquired as 10 template characters. And then the similarity of each character in the M bank card number characters and the template character can be compared, and the numerical meaning corresponding to the template character with the highest similarity can be taken as the numerical meaning of the bank card number character processed at this time, namely the bank card number character processed at this time is identified. The processing characters are characters for template matching in M bank card number characters.
Specifically, from the first character, the M bank card number characters may be sequentially matched with the character templates, and the numerical meanings of the M bank card number characters may be respectively identified. For one recognition process, the similarity between the processing character and 10 template characters can be respectively determined, the maximum value of the similarity is determined to be the target similarity, then the size relation between the target similarity and a preset similarity threshold value can be determined, if the target similarity is larger than the similarity threshold value, the similarity between the template character corresponding to the target similarity and the processing character can be directly determined to meet the requirement, and the matching of the template character and the processing character can be determined; however, if the target similarity is smaller than the similarity threshold, that is, the similarity between the character most similar to the processed character and the processed character in the 10 template characters is not satisfied, the template character that the processed character does not match may be determined temporarily, and the numerical meaning of the processed character may be determined in other manners. Specifically, the similarity can be determined by determining the difference operation result between the processing character and the template character, that is, the processing character is differenced from the target character, an image of the processing character minus the template character is obtained, the sum of absolute values of pixel differences is determined, and then the image is compared with a preset matching threshold value, and if the sum of absolute values of pixel differences is smaller than the matching threshold value, the image is the corresponding character. The image can be divided into a plurality of subareas, the weight of each subarea is determined, the difference value of each subarea is subjected to weighting operation, the difference value of the whole bank card character image and the template character image is finally determined, and then the difference value is compared with a matching threshold value.
Optionally, when the target similarity is not greater than the preset threshold, the grid characteristics of the character cannot be extracted when the template character matched with the processing character cannot be determined, that is, the binarized processing character image is divided into m×n grids, each grid corresponds to a characteristic value of 0 or 1, then the template image is also divided into the same m×n grids, the characteristic value corresponding to each grid in the character image is determined by the matching number of the pixel points in the character grid and the pixel points in the template grid, for example, the image of the processing character can be divided into four areas, that is, four grids, each grid includes a plurality of pixel points, then the image of the template character can be equally divided into the corresponding four grids according to the same grid division method, the same number of the pixel points of the processing character in the first grid as the pixel points of the template character can be confirmed, if the same number of grids is a plurality, the characteristic value of 1 can be determined, that is, the processing character image and the template character image can be matched in the same number, for example, then whether each grid can be matched with the template character can be successfully matched in turn can be determined, and if the matching of the template character can be successfully matched with the character can be determined.
As a specific embodiment, fig. 3 is a schematic diagram of a bank card number identification system according to an alternative embodiment of the present application. As shown in fig. 3, the OV5640 can be controlled by the FPGA to acquire image information of a corresponding position of the system; displaying real-time information through an upper computer; prompting a user to place the invoice to be tested at a corresponding position, and starting image acquisition; preprocessing the acquired image, wherein the image preprocessing process comprises operations such as image denoising, color image graying, gray image binarization and the like, and the image acquired by the camera is removed from being influenced by the environment; the card number digital region is positioned in the preprocessed image, a bank card image acquired by a camera can be distinguished from a bank card image containing digital information image and a background image, the bank card number information is intercepted, and other background information of the image is removed; the intercepted information of the bank card number is subjected to character segmentation, after a card number area is positioned in an image containing the bank card number, the image is subjected to corrosion expansion and other treatments, characters are segmented, and only single character features can be identified in the character identification process, so that the characters are segmented before character identification, and finally the information required to be acquired is segmented into single characters, so that the subsequent identification operation is facilitated; the method comprises the steps of identifying the character after segmentation, namely analyzing the characteristics of each character, judging the content of the character, carrying out normalization processing on the single character after the character segmentation, extracting the characteristic information of each character, carrying out matching, and realizing character identification according to the similarity; and finally, outputting a character recognition result, and outputting the card number information to different application platforms according to different application scenes after correctly recognizing the card number, so as to realize automatic management of the card number.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
The embodiment of the application also provides a bank card number recognition device, and the bank card number recognition device can be used for executing the bank card number recognition method. The bank card number recognition device provided by the embodiment of the application is introduced as follows.
Fig. 4 is a schematic diagram of a bank card number recognition device according to an embodiment of the present application. As shown in fig. 4, the apparatus includes: an acquisition module 41, configured to acquire a bank card image to be identified; the detection module 42 is connected with the acquisition module 41, and is configured to perform edge detection on the image of the bank card to be identified by using N preset convolution operators, and determine an edge of a bank card number in the image of the bank card to be identified, where the convolution operators included in the N convolution operators are matrices with fixed values, and the N convolution operators are used to perform edge detection on the image of the bank card to be identified from N directions respectively, where N is an integer greater than 1; the determining module 43 is connected with the detecting module 42 and is used for determining M characters of the bank card number according to the edges of the bank card number, wherein M is an integer greater than 1; the identification module 44 is connected to the determination module 44, and is configured to identify M characters of the bank card numbers, so as to obtain the bank card numbers in the image of the bank card to be identified.
The bank card number identification device provided by the embodiment of the application obtains the bank card image to be identified; performing edge detection on the bank card image to be identified by adopting N preset convolution operators, and determining the edge of the bank card number in the bank card image to be identified; determining M bank card number characters according to the edges of the bank card numbers; and identifying M bank card number characters to obtain the bank card number in the bank card image to be identified, so that the technical problem of low bank card number identification accuracy in the related art is solved, and the technical effect of improving the bank card number identification accuracy is further achieved.
The bank card number identification device comprises a processor and a memory, wherein the acquisition unit, the detection unit, the determination unit, the identification unit and the like are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor includes a kernel, and the kernel fetches the corresponding program unit from the memory. The kernel can be provided with one or more than one, and the identification accuracy of the bank card number is improved by adjusting kernel parameters.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
The embodiment of the invention provides a computer readable storage medium, on which a program is stored, which when executed by a processor, implements a bank card number identification method.
The embodiment of the invention provides a processor, which is used for running a program, wherein the program runs to execute a bank card number identification method.
Fig. 5 is a schematic structural diagram of an electronic device for performing a method for identifying a bank card number according to an embodiment of the present invention, and as shown in fig. 5, the embodiment of the present invention provides an electronic device, where the device includes a processor, a memory, and a program stored in the memory and capable of running on the processor, and when the processor executes the program, the processor implements the following steps: acquiring a bank card image to be identified; performing edge detection on the bank card image to be identified by adopting N preset convolution operators, and determining the edge of the bank card number in the bank card image to be identified, wherein the N convolution operators are matrices with fixed values, and are used for performing edge detection on the bank card image to be identified from N directions respectively, and N is an integer greater than 1; determining M bank card number characters according to the edges of the bank card numbers, wherein M is an integer greater than 1; and identifying M bank card number characters to obtain the bank card numbers in the bank card images to be identified.
Optionally, performing edge detection on the image of the bank card to be identified by adopting N preset convolution operators, and determining the edge of the bank card number in the image of the bank card to be identified, including: converting the bank card image to be identified into a gray image; carrying out convolution operation on N convolution operators and the gray level image respectively to obtain N operation results corresponding to the N convolution operators, wherein the N operation results respectively represent the variation degree of the pixel value of the gray level image in N directions; and superposing the N operation results to determine the edge of the bank card number.
Optionally, overlapping the N operation results to determine an edge of the bank card number, including: and superposing N operation results to obtain an edge extraction image of the bank card image to be identified, and obtaining L bank card pattern templates, wherein L is an integer greater than 1, determining a target pattern template matched with the edge extraction image in the L bank card pattern templates, comparing the edge extraction image with the target pattern template, and determining the edge of the bank card number in the edge extraction image.
Optionally, determining M bank card number characters according to edges of the bank card numbers includes: and acquiring the resolution of a camera shooting the image of the bank card to be identified and the size of the number of the bank card in the target pattern template, and dividing the edge of the bank card number into M bank card number characters according to the resolution of the camera and the size of the number of the bank card in the bank card pattern template.
Optionally, before performing convolution operation on the gray image by using N convolution operators, respectively, to obtain N operation results corresponding to the N convolution operators, the method includes: and carrying out noise reduction treatment on the gray level image or carrying out noise reduction treatment on the bank card image to be identified.
Optionally, identifying M bank card number characters to obtain a bank card number in a bank card image to be identified, including: and obtaining K template characters, wherein K is an integer greater than 1, respectively matching M bank card number characters with the K template characters, determining M template characters respectively corresponding to the M bank card number characters, wherein the K template characters comprise M template characters corresponding to the M bank card number characters, and determining the number corresponding to the M template characters as the bank card number in the bank card image to be identified.
Optionally, matching the M bank card number characters with the K template characters respectively, and determining M template characters corresponding to and matched with the M bank card number characters respectively, including: and respectively determining the similarity between the processing characters in the M bank card number characters and the K template characters, determining the maximum similarity in the similarity between the processing characters and the K template characters as target similarity, and determining that the template characters corresponding to the target similarity are matched with the processing characters under the condition that the target similarity is larger than a preset threshold value.
The device herein may be a server, PC, PAD, cell phone, etc.
The application also provides a computer program product adapted to perform, when executed on a data processing device, a program initialized with the method steps of: acquiring a bank card image to be identified; performing edge detection on the bank card image to be identified by adopting N preset convolution operators, and determining the edge of the bank card number in the bank card image to be identified, wherein the N convolution operators are matrices with fixed values, and are used for performing edge detection on the bank card image to be identified from N directions respectively, and N is an integer greater than 1; determining M bank card number characters according to the edges of the bank card numbers, wherein M is an integer greater than 1; and identifying M bank card number characters to obtain the bank card numbers in the bank card images to be identified.
Optionally, performing edge detection on the image of the bank card to be identified by adopting N preset convolution operators, and determining the edge of the bank card number in the image of the bank card to be identified, including: converting the bank card image to be identified into a gray image; carrying out convolution operation on N convolution operators and the gray level image respectively to obtain N operation results corresponding to the N convolution operators, wherein the N operation results respectively represent the variation degree of the pixel value of the gray level image in N directions; and superposing the N operation results to determine the edge of the bank card number.
Optionally, overlapping the N operation results to determine an edge of the bank card number, including: and superposing N operation results to obtain an edge extraction image of the bank card image to be identified, and obtaining L bank card pattern templates, wherein L is an integer greater than 1, determining a target pattern template matched with the edge extraction image in the L bank card pattern templates, comparing the edge extraction image with the target pattern template, and determining the edge of the bank card number in the edge extraction image.
Optionally, determining M bank card number characters according to edges of the bank card numbers includes: and acquiring the resolution of a camera shooting the image of the bank card to be identified and the size of the number of the bank card in the target pattern template, and dividing the edge of the bank card number into M bank card number characters according to the resolution of the camera and the size of the number of the bank card in the bank card pattern template.
Optionally, before performing convolution operation on the gray image by using N convolution operators, respectively, to obtain N operation results corresponding to the N convolution operators, the method includes: and carrying out noise reduction treatment on the gray level image or carrying out noise reduction treatment on the bank card image to be identified.
Optionally, identifying M bank card number characters to obtain a bank card number in a bank card image to be identified, including: and obtaining K template characters, wherein K is an integer greater than 1, respectively matching M bank card number characters with the K template characters, determining M template characters respectively corresponding to the M bank card number characters, wherein the K template characters comprise M template characters corresponding to the M bank card number characters, and determining the number corresponding to the M template characters as the bank card number in the bank card image to be identified.
Optionally, matching the M bank card number characters with the K template characters respectively, and determining M template characters corresponding to and matched with the M bank card number characters respectively, including: and respectively determining the similarity between the processing characters in the M bank card number characters and the K template characters, determining the maximum similarity in the similarity between the processing characters and the K template characters as target similarity, and determining that the template characters corresponding to the target similarity are matched with the processing characters under the condition that the target similarity is larger than a preset threshold value.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that 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 one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.

Claims (10)

1. A method for identifying a bank card number, comprising:
acquiring a bank card image to be identified;
performing edge detection on the to-be-identified bank card image by adopting N preset convolution operators, and determining the edge of a bank card number in the to-be-identified bank card image, wherein the N convolution operators are matrices with fixed values, and are used for performing edge detection on the to-be-identified bank card image from N directions respectively, and N is an integer greater than 1;
Determining M bank card number characters according to the edges of the bank card numbers, wherein M is an integer greater than 1;
and identifying the M bank card number characters to obtain the bank card numbers in the bank card images to be identified.
2. The method of claim 1, wherein the edge detection of the image of the bank card to be identified using N convolution operators set in advance, and determining the edge of the bank card number in the image of the bank card to be identified, comprises:
converting the bank card image to be identified into a gray image;
performing convolution operation on the N convolution operators and the gray level image respectively to obtain N operation results corresponding to the N convolution operators, wherein the N operation results respectively represent the variation degree of the pixel value of the gray level image in the N directions;
and superposing the N operation results to determine the edge of the bank card number.
3. The method of claim 2, wherein the superimposing the N operation results to determine the edge of the bank card number comprises:
superposing the N operation results to obtain an edge extraction image of the bank card image to be identified;
Obtaining L bank card style templates, wherein L is an integer greater than 1;
determining target pattern templates matched with the edge extraction images from the L bank card pattern templates;
comparing the edge extraction image with the target pattern template, and determining the edge of the bank card number in the edge extraction image.
4. The method of claim 3, wherein said determining M bank card number characters from edges of the bank card number comprises:
acquiring the resolution of a camera shooting the bank card image to be identified and the size of a bank card number in the target pattern template;
and dividing the edge of the bank card number into M bank card number characters according to the resolution of the camera and the size of the bank card number in the bank card style template.
5. The method according to claim 2, wherein before performing convolution operations with the gray-scale image using the N convolution operators, respectively, to obtain N operation results corresponding to the N convolution operators, respectively, the method comprises:
noise reduction processing is carried out on the gray level image;
or, carrying out noise reduction treatment on the bank card image to be identified.
6. The method according to any one of claims 1 to 5, wherein the identifying the M bank card number characters to obtain a bank card number in the bank card image to be identified includes:
obtaining K template characters, wherein K is an integer greater than 1;
respectively matching the M bank card number characters with the K template characters, and determining M template characters correspondingly matched with the M bank card number characters, wherein the K template characters comprise M template characters correspondingly matched with the M bank card number characters;
and determining the number corresponding to the M template characters as the bank card number in the bank card image to be identified.
7. The method of claim 6, wherein the matching the M banking number characters with the K template characters, respectively, determines M template characters that are correspondingly matched with the M banking number characters, respectively, comprises:
respectively determining the similarity between the processing characters in the M bank card number characters and the K template characters;
determining the maximum similarity in the similarity between the processing character and the K template characters as a target similarity;
And under the condition that the target similarity is larger than a preset threshold value, determining that the template character corresponding to the target similarity is matched with the processing character.
8. A bank card number identification device, comprising:
the acquisition module is used for acquiring the bank card image to be identified;
the detection module is used for carrying out edge detection on the bank card image to be identified by adopting N preset convolution operators, and determining the edge of a bank card number in the bank card image to be identified, wherein the N convolution operators are matrices with fixed numerical values, and are used for carrying out edge detection on the bank card image to be identified from N directions respectively, and N is an integer greater than 1;
the determining module is used for determining M bank card number characters according to the edges of the bank card numbers, wherein M is an integer greater than 1;
and the identification module is used for identifying the M bank card number characters to obtain the bank card numbers in the bank card images to be identified.
9. A nonvolatile storage medium, characterized in that the nonvolatile storage medium includes a stored program, wherein the program, when run, controls a device in which the nonvolatile storage medium is located to execute the bank card number identification method according to any one of claims 1 to 7.
10. An electronic device comprising one or more processors and a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the bank card number identification method of any of claims 1-7.
CN202310723495.XA 2023-06-16 2023-06-16 Bank card number identification method and device, nonvolatile storage medium and electronic equipment Pending CN116721409A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310723495.XA CN116721409A (en) 2023-06-16 2023-06-16 Bank card number identification method and device, nonvolatile storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310723495.XA CN116721409A (en) 2023-06-16 2023-06-16 Bank card number identification method and device, nonvolatile storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN116721409A true CN116721409A (en) 2023-09-08

Family

ID=87865766

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310723495.XA Pending CN116721409A (en) 2023-06-16 2023-06-16 Bank card number identification method and device, nonvolatile storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN116721409A (en)

Similar Documents

Publication Publication Date Title
CN109766890B (en) Information identification method, equipment and system
US9679354B2 (en) Duplicate check image resolution
CN109344824B (en) Text line region detection method, device, medium and electronic equipment
US10262220B1 (en) Image analysis and processing pipeline with real-time feedback and autocapture capabilities, and visualization and configuration system
CN111784675A (en) Method and device for processing article texture information, storage medium and electronic equipment
CN112052702A (en) Method and device for identifying two-dimensional code
CN108960247B (en) Image significance detection method and device and electronic equipment
CN105787419A (en) Palm detection method and palm detection system for palm image
CN112232336A (en) Certificate identification method, device, equipment and storage medium
Ganapathy et al. A Malaysian vehicle license plate localization and recognition system
CN110135288B (en) Method and device for quickly checking electronic certificate
CN116721409A (en) Bank card number identification method and device, nonvolatile storage medium and electronic equipment
CN114240928B (en) Partition detection method, device and equipment for board quality and readable storage medium
CN105825161A (en) Image skin color detection method and system thereof
CN115374517A (en) Testing method and device for wiring software, electronic equipment and storage medium
CN111931687B (en) Bill identification method and device
CN113343968A (en) Multi-template certificate rapid verification method, system, medium and device
JP6175904B2 (en) Verification target extraction system, verification target extraction method, verification target extraction program
CN107240184B (en) Method, device and equipment for identifying versions of plastic coins
CN111414889A (en) Financial statement identification method and device based on character identification
CN113255657B (en) Method and device for detecting scratch on bill surface, electronic equipment and machine-readable medium
CN117218654A (en) Bank card number identification method and device, storage medium and electronic equipment
CN115830299A (en) Image recognition method and device, storage medium and processor
Chen Bank Card Number Identification Program Based on Template Matching
CN116935412A (en) Method and device for inputting handwritten text information, processor and electronic equipment

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