WO2020181834A1 - 识别*** - Google Patents
识别*** Download PDFInfo
- Publication number
- WO2020181834A1 WO2020181834A1 PCT/CN2019/121053 CN2019121053W WO2020181834A1 WO 2020181834 A1 WO2020181834 A1 WO 2020181834A1 CN 2019121053 W CN2019121053 W CN 2019121053W WO 2020181834 A1 WO2020181834 A1 WO 2020181834A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- character
- image
- sequence
- target
- information
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/77—Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
- G06V10/774—Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/10—Character recognition
- G06V30/14—Image acquisition
- G06V30/148—Segmentation of character regions
- G06V30/153—Segmentation of character regions using recognition of characters or words
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/10—Character recognition
- G06V30/14—Image acquisition
- G06V30/148—Segmentation of character regions
- G06V30/158—Segmentation of character regions using character size, text spacings or pitch estimation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/10—Character recognition
- G06V30/19—Recognition using electronic means
- G06V30/191—Design or setup of recognition systems or techniques; Extraction of features in feature space; Clustering techniques; Blind source separation
- G06V30/19173—Classification techniques
Definitions
- the present disclosure relates to the field of image recognition, and in particular, to a method and device for recognizing card numbers, storage media, and electronic equipment.
- card number recognition plays an important role in the process of online business processing.
- the present disclosure provides a method and device for identifying a card number, a storage medium, and electronic equipment.
- the first aspect of the present disclosure provides a method for identifying a card number, including:
- the distribution format information includes the character bit spacing information of the card number sequence
- the distribution format information includes the character bit spacing information of the card number sequence
- recognize the character sequence in the target image through a pre-trained neural network model, and obtain all the recognized characters
- the character bit spacing information of the character sequence determine whether the character bit spacing information in the recognized character sequence is consistent with the character bit spacing information in the acquired distribution format information; if the character sequence is The character bit spacing information is consistent with the character bit spacing information in the acquired distribution format information, and the identified character sequence is determined to be the target card number.
- the present disclosure provides a data processing device, the device including:
- the format obtaining module is used to obtain the distribution format information of the character bits of the card number sequence, wherein the distribution format information includes the character bit spacing information of the card number sequence;
- the recognition module is used to recognize the target image through a pre-trained neural network model The character sequence in the character sequence and obtain the character bit spacing information of the recognized character sequence;
- the judgment module is used to determine the character bit spacing information in the recognized character sequence and the obtained distribution format information Whether the character bit spacing information in the character sequence is consistent;
- the determining module is used to determine the identified character bit spacing information when it is determined that the character bit spacing information in the character sequence is consistent with the character bit spacing information in the distribution format information
- the character sequence is the target card number.
- the present disclosure provides a non-volatile computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, it implements the steps of any one of the methods in the first aspect of the present disclosure.
- the present disclosure provides an electronic device applied to a database, including: a memory on which a computer program is stored; and a processor for executing the computer program in the memory to implement the first aspect of the present disclosure The steps of any one of the methods.
- Comparing the format of the recognized character sequence with the distribution format information can determine whether the format of the recognized character sequence is consistent with the format in the distribution format information. If they are consistent, the target card number is output, which can reduce the number of characters that are recognized and missed.
- the recognition error caused by the recognition improves the accuracy of the card number recognition.
- Fig. 1A is a flowchart showing a method for identifying a card number according to an exemplary embodiment.
- Fig. 1B is a schematic diagram showing a method for identifying a card number according to an exemplary embodiment.
- Fig. 2A is a flowchart showing a method for identifying a card number according to another exemplary embodiment.
- Fig. 2B is a schematic diagram showing a virtual detection strip according to an exemplary embodiment.
- Fig. 2C is a schematic diagram showing the distribution of sampling windows according to an exemplary embodiment.
- Fig. 2D is a schematic diagram showing image recognition through a sampling window according to an exemplary embodiment.
- Fig. 2E is a schematic diagram showing a sub-image obtained by a sampling window according to an exemplary embodiment.
- Fig. 3 is a block diagram showing a device for identifying a card number according to an exemplary embodiment.
- Fig. 4 is a block diagram showing an electronic device for identifying a card number according to an exemplary embodiment.
- Fig. 5 is a block diagram showing an electronic device for identifying a card number according to another exemplary embodiment.
- the card number area into multiple card number sub-regions and extract the features of each card number sub-region through a convolutional neural network, and input the features of each card number sub-region into the classifier to obtain the card number in the current image.
- a convolutional neural network In this scheme, there are multiple steps such as image cropping and recognition, and errors in any one link may affect the accuracy of subsequent links.
- the division of sub-regions depends on machine algorithms, there may be numbers at the splicing between sub-regions and sub-regions, which may result in multiple recognitions caused by multiple sub-region recognition of one number, or multiple recognitions in each sub-region.
- the missing identification caused by the inability to identify the digital part.
- the identification error caused by this scenario is difficult to be verified by the subsequent links, which affects the accuracy of card number identification .
- the embodiments of the present disclosure provide a method for identifying card numbers, which can improve the accuracy of card number recognition.
- Fig. 1A is a flowchart showing a method for identifying a card number according to an exemplary embodiment. The method includes the following steps.
- the distribution format information of the character bits of the card number sequence can be determined by determining the character position and character spacing of the card number.
- the distribution format information in this step may be the default distribution format information in the current recognition mode, or the distribution format information in a preset table, or the distribution format information obtained by preprocessing the card image.
- the current recognition mode can be ID card image recognition
- the distribution format information can be XXXXXXXXXXXXXXXXXXXXXXX (number of numbers and arrangement rules), and the number spacing is N Pixel (character pitch information), the character pitch information is (N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N).
- the current recognition mode can also be a bank card image recognition of a specific bank.
- the distribution format information can be XXX-XXXX-XXXX-XXXX (number of numbers and arrangement rules),
- the spacing between adjacent numbers is N1 pixels, and the corresponding spacing at the "-" character is N2 pixels, then the character bit spacing information is (N1, N1, N2, N1, N1, N1, N2, N1, N1, N1, N2, N1 , N1, N1).
- the character spacing can also be expressed by unit length.
- the arrangement on the target image may be XXX---XXXX, then the first 1/2
- the distance between /3 digits is 1 unit length
- the distance between the 3rd and 4th digits is 3 units
- the distance between 4/5/6/7 digits is 1 unit.
- the category information of the card number can be obtained, and the character position of the card number sequence can be determined according to the category information of the card number and the preset correspondence between the card number category and the card number distribution format information The distribution format information.
- the distribution format information of the corresponding card number sequence can be determined by the different card types, different banks, and different card types (ie, type information) to which the card belongs. For example, if the card is an ID card number, and the card number distribution format of the ID card number is 18 digits without interval number, the corresponding distribution format information can be (4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,4,4,4,4,4,4,4), the sequence format thus determined is XXXXXXXXXXXXXXXXXX; if the card is a debit card, and the issuing bank is ICBC, and ICBC’s bank
- the card number distribution format of the debit card is XXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXX
- the corresponding distribution format information can be (4,4,4,4,4,10,4,4,4,4,4,4,4,4,4,4,4,4,4), the sequence format thus determined is XXXXX-XXXXXXXX
- the determination of the category information of the card number can be determined by identifying the pattern of the card background, or by the type of business handled and its progress. For example, if the user is handling a loan business and is at the progress node of entering the ID number, it can be determined that the card image entered by the user belongs to the category of the ID card.
- S12 Recognize the character sequence in the target image through the pre-trained neural network model, and obtain the character bit spacing information of the recognized character sequence.
- the character sequence in the target image can be recognized, and the spacing between the characters can be determined by the pixel position of the character in the character sequence, so as to determine the character bit spacing information of the recognized character sequence.
- the recognized character sequence can be 123-4567-1234-1234, where the character spacing between adjacent characters is 4 pixels, and the corresponding spacing at the "-" character is 10 pixels, then the character bit spacing information is ( 4, 4, 10, 4, 4, 4, 10, 4, 4, 10, 4, 4, 4).
- S13 Determine whether the recognized character bit spacing information in the character sequence is consistent with the obtained character bit spacing information in the distribution format information.
- the character bit spacing information obtained in the distribution format information is (4,4,4,10,4,4,10,4,4,4), which represents a total of 11 digits, and because the fourth and fifth digits and The spacing between 7 and 8 bits is obviously larger than other positions, so the format of the sequence can be determined to be XXXX-XXX-XXXX; and the character spacing information obtained in the character sequence is (4,4,19,4,4,10 , 4, 4, 4,), the sequence format determined from this is XXX-XXX-XXX, the character spacing information between the 3rd and 4th digits is obviously inconsistent with the character spacing information in the distribution format information, so the explanation is in the first 3. The recognition between the 4 digits is incorrect.
- the character spacing information may not completely correspond to each other. Therefore, an error range can be preset. If the character spacing information in the character sequence and the distribution format information The difference between the character bit spacing information is within the error range, and the two can also be considered consistent.
- the character sequence is more likely to be correct, and the character sequence can be determined as the target card number.
- the character sequence can be updated according to the distribution format information.
- the character sequence may be updated in the following manner: deleting characters in the character sequence that do not conform to the distribution format information, and determining in the target image that the pixel position conforms to the character position update of the distribution format information
- the sub-image updates the character sequence according to the recognition result of the updated sub-image.
- the character sequence format represented by the character bit spacing information of the distribution format information is XXX-XXXX-XXXX (first line), and the character sequence format represented by the character bit spacing information in the character sequence is XXXX-XXX -XXXX (the second line, the numbers represent the order of characters), you can determine that the 4th character in the character sequence is multi-identified, and the 7th and 8th characters are missed.
- the character sequence is updated to XXX-XXXX-XXX (the third line, the number represents the sequence of characters) according to the character result, and the updated character sequence is determined as the target card number.
- the embodiment of the present disclosure judges whether there is a recognition error according to the character spacing of the card number, and can recognize the character string and use the spacing between the standardized character strings to correct the character string. Therefore, the method provided by the embodiment of the present disclosure can be applied to a certain standard Recognition and correction of character strings.
- the above technical solution can at least achieve the following technical effects: compare the recognized character sequence with the distributed format information to determine whether the format of the recognized character sequence is consistent with the format in the distributed format information, and output the target card number if they are consistent , Thereby reducing the recognition errors caused by multiple recognition and missing recognition of characters, thereby improving the accuracy of card number recognition.
- Fig. 2A is a flowchart showing a method for identifying a card number according to another exemplary embodiment. The method includes the following steps.
- the rectangular card image can be obtained by the following method: determine at least three vertex pixel positions from the input image, the vertex pixel position is used to characterize the card vertex; according to the at least three vertex pixel positions in The input image is determined to be used to characterize the image area where the card is located; the image area is corrected to generate a rectangular card image.
- the method of identifying the top corner is faster than the method of identifying the edge of the card, and it reduces the recognition failure caused by the distortion generated when the image is taken. Moreover, since the card image can be determined by the three corners, the card edge and the top corner can be reduced Recognition error caused by being covered.
- the inclination of the image can be corrected by ray-like transformation.
- Using card vertex detection instead of edge extraction to extract image regions can effectively reduce redundant calculations and speed up the calculation speed of the overall process.
- the card image as shown in Figure 2B has multiple virtual detection strips parallel to the long side of the card image and passing through the card image (only four are displayed for the convenience of observation, ranging from 221 to 224).
- the length of the virtual detection strips ( Figure 2B)
- the horizontal length of the virtual detection strip in the middle) is the same as the longest side length of the card image.
- the width of the virtual detection strip (the longitudinal length of the virtual detection strip in FIG. 2B) can be any pixel that facilitates the extraction of image features, for example, It is 2 pixels, 4 pixels, 5 pixels, 6 pixels, etc.
- the embodiment of the present disclosure does not limit the specific width of the virtual detection strip.
- the preset image feature includes an image feature that characterizes the intersection of the virtual detection bar and a character.
- the preset image feature includes an image feature that characterizes the intersection of the virtual detection bar and a character.
- the image features generated when the virtual test strip intersects each part of each number are pre-stored. By comparing whether the image of the area where the target virtual test strip is located meets the image characteristics, it can be determined whether the target virtual test strip intersects the character As shown in FIG. 2B, the virtual detection bars 223 and 224 intersect the characters, and the virtual detection bars 221 and 222 do not intersect the characters.
- the position where the virtual detection strip intersects the background pattern may produce similar image features with the character. If it will match the image The virtual detection strip where the characteristic characters intersect is confirmed as the target virtual detection strip, and there may be a risk of incorrectly identifying the position of the target image.
- the first number can be preset according to the number of characters included in the card number, and the first preset number can be 5, 10, 15, etc., which are not limited in the embodiment of the present disclosure. .
- the position of the target image where the character sequence is located can be determined, so as to intercept the target image.
- a second preset number of continuous target virtual test strips can be selected as the target virtual test strip group, and the card image at least includes the target virtual test strip group and the size is preset The size of the image area is used as the target image.
- an image area that includes the target virtual test strip group and does not include other virtual test strips is captured as the target image.
- the second preset number may be 25, and if there are 25 consecutive target virtual test strips, 25 consecutive target virtual test strips can be used as the target virtual test strip group.
- the pixel size of the target virtual detection strip group in the card image can be 428 ⁇ 50; the preset size can be 428 ⁇ 60, you can select the card image to include the area where the target virtual detection strip group is located, and the size is preset The size of the image is the target image.
- the image size of the input card number recognition neural network can be reduced, thereby improving the subsequent recognition speed.
- S205 Determine, in the target image, the pixel position where the target virtual detection bar intersects the character according to the preset image feature.
- the preset image feature includes an image feature that characterizes the intersection of the virtual detection bar and a character.
- the image features generated when the virtual test strip intersects each part of each number are pre-stored. By comparing whether the image of the area where the virtual test strip is located meets the image features, it can be determined whether the virtual test strip intersects the character, such as The virtual detection bars 223 and 224 shown in FIG. 2B intersect the characters, and the virtual detection bars 221 and 222 do not intersect the characters.
- S206 Acquire character bit spacing information of the distribution format information according to the pixel position of at least one intersection of the target virtual detection strip and each character.
- the character bit spacing information of the distribution format information can be obtained through the interval between each character pixel intersecting with the target virtual detection strip.
- the character bit spacing information can be a list, for example, the character bit The spacing information can be 4, 4, 4, 10, 4, 4, 4, which means "the first character and the second character are separated by 4 pixels, ... the fourth character and the fifth character are separated by 10 Pixels.". Since there will be multiple target virtual detection strips that intersect the character, the character spacing information can be any target virtual detection strip at a fixed position in all the target virtual detection strips that intersect the character (for example, the target virtual detection strip located in the center) The list of the spacing between the character pixels on the above is not limited in this disclosure.
- S207 Recognize the character sequence in the target image through the pre-trained neural network model, and obtain the character bit spacing information of the recognized character sequence.
- the character sequence in the target image can be recognized through the following possible implementation manners and the character bit spacing information of the recognized character sequence can be obtained.
- multiple sub-images are acquired on the target image through multiple preset sampling windows.
- Each position in the target image may appear in at least one sampling window, and the sampling windows may be arranged in a parallel and non-overlapping manner, or may be distributed in an array, with adjacent sampling windows partially overlapping.
- the sampling windows may be distributed in the form of an array, the sampling windows of each row of the array are distributed along the horizontal direction of the target image, and the sampling windows of each row of the array Wherein, two adjacent sampling windows are separated by a preset step length and partially overlapped.
- Figure 2C is a schematic diagram of the distribution of the sampling window.
- the first row from left to right is sampling window 1, sampling window 2, sampling window 3, sampling window 4, Sampling window 5, the other lines are the same.
- the sampling windows indicated by the solid frame are sampling window 1, sampling window 3 and sampling window 15 in sequence.
- the sampling windows arranged in this way can cover the entire target image, and there is overlap at the junction, which can reduce recognition errors caused by characters at the junction of image segmentation.
- the size of the target image is a preset pixel size, and the size and arrangement of the sampling windows are also preset styles. Therefore, standard processing flow parameters can be customized according to preset values. When processing different target images, it can be implemented with reference to the above-mentioned standard processing flow parameters to reduce redundant calculations and improve the efficiency of card number recognition.
- the character label corresponding to each of the sub-images is recognized according to the pre-trained neural network model.
- the classifier labels of the pre-trained neural network model may include character class labels corresponding to image features of each digital character in different printing styles and space labels corresponding to image features of non-character regions.
- different printing styles can refer to plane printing, embossing printing, intaglio printing, etc.
- the image characteristics and character spacing corresponding to different printing methods are very different. Because the numbers of different fonts are also very different, you can also add the image characteristics of the numbers of different fonts under each category label.
- the label of the classifier can be set to 21 categories, corresponding to printed numbers 0-9, embossed concave-convex numbers 0-9, and background (no digital output).
- Each number can correspond to two classifier labels, that is, a label with printed numbers and a label with embossed numbers. In this way, the number can be more accurately identified, and it can be applied to scenes with stamped fonts such as cast steel labels.
- the sub-image corresponds to the character label, and may be the character label with the highest probability among all possible classifier character labels corresponding to the sub-image, and the probability of the character label may be that the sub-image is similar to the corresponding character label model degree.
- a non-maximum suppression algorithm is used to determine the target sub-image whose probability corresponding to the character label meets the probability condition.
- Each sub-image can correspond to a recognition result at a position of the target image. If a position on the target image corresponds to multiple sub-images, it can be determined that the sub-image whose character label probability meets the probability condition is the target sub-image.
- the probability condition may be the highest probability among multiple sub-images, or it may be that the probability among multiple sub-images exceeds the probability threshold.
- the sampling windows are distributed in the form of an array, the sampling windows of each row of the array are distributed along the horizontal direction of the target image, and the sampling windows of each row of the array are distributed along the horizontal direction of the target image.
- the sampling window two adjacent sampling windows are separated by a preset step length and partially overlap; after obtaining the character labels and probabilities corresponding to the sub-images, these character labels and probabilities can be arranged according to the arrangement of the sampling windows, For example, if the target image is recognized according to the sampling window in Figure 2D, the sub-images #1-#15 arranged in order from 1 to 15 in Figure 2E will be obtained.
- the recognition result of the row with the highest sum can be determined, and the corresponding row of sub-images can be determined by the recognition result as the definite row sub-image.
- the second The line recognition result has the highest sum of probability values. Therefore, the determined line sub-image with the highest probability sum can be obtained as the sub-image collected by the second line sampling window, that is, the second line sub-image as shown in FIG. 2E.
- the target sub-image whose probability corresponding to the character label meets the probability condition is determined from the determined line sub-image through a non-maximum value suppression algorithm.
- the probability condition may be the highest probability. That is to say, the target sub-image whose probability of corresponding to the character label meets the probability condition may be determined to be the sub-image corresponding to the pixel position of the character, which is most similar to the preset model (ie The sub-image with the highest probability is the target sub-image.
- the pixel position of character 0 corresponds to sub-image 7 and sub-image 8. In these two sub-images, since the probability of sub-image 7 is the highest, it can be determined that sub-image 7 is the target sub-image.
- the character sequence is generated according to the character label corresponding to the target sub-image.
- Each character corresponds to a target sub-image, and the character tags in the recognition results of all target sub-images are arranged in the order of the target sub-images to obtain a character sequence.
- the character sequence generated by the target sub-image (sub-image 6, sub-image 7, sub-image 9, and sub-image 10) determined in the target image as shown in FIG. 2E is 2019.
- the spacing information of the character bits in the character sequence is determined.
- the character spacing can be determined by the spacing between the character pixels represented by each target sub-image, the character spacing can be a list, for example, the character spacing can be 4, 4, 4, 10, 4, 4 , 4, it means "the first character and the second character are separated by 4 pixels, ... the fourth character and the fifth character are separated by 10 pixels, ". Since the character pitch may be different at different pixel positions, the character pitch can be a list of the pitches between character pixels at any position (for example, the pixel position of the horizontal centerline of the target sub-image). Make a limit.
- S208 Determine whether the recognized character bit spacing information in the character sequence is consistent with the obtained character bit spacing information in the distribution format information.
- the character bit spacing information in the character sequence can be compared with the character bit spacing information in the distribution format information, and the recognized character bit spacing information in the character sequence can be determined with the character positions in the distribution format information. Whether the spacing information is consistent.
- the character bit spacing information obtained in the distribution format information is (4,4,4,10,4,4,10,4,4,4), which represents a total of 11 digits, and because the fourth and fifth digits and The spacing between 7 and 8 bits is obviously larger than other positions, so it can be determined that the format of the sequence is XXXX-XXX-XXXX; and the character spacing information obtained in the character sequence is (4, 4, 19, 4, 4, 10, 4, 4, 4,), the sequence format determined from this is XXX-XXX-XXXX, the character spacing information between the 3rd and 4th digits is obviously inconsistent with the character spacing information in the distribution format information, so the explanation is The recognition between the 3rd and 4th digits is incorrect.
- the distribution format information can also be obtained in the following manner: obtaining the category information of the card number, and according to the card number The category information, and the correspondence between the preset card number category and the card number distribution format information, determine the distribution format information of the character bits of the card number sequence.
- step S210 is executed; if the character bit spacing information in the character sequence is consistent with the characters in the distribution format information The bit pitch information is inconsistent, and step S209 is executed.
- the character sequence may be updated in the following manner: delete characters in the character sequence that do not meet the distribution format information, and determine in the determined line sub-image that the pixel position meets the distribution format information For the candidate sub-image of the character bit, the character sequence is updated according to the character tag corresponding to the candidate sub-image.
- the character sequence format represented by the character bit spacing information of the distribution format information is XXX-XXXX-XXXX (the first line in the figure), and the character sequence format represented by the character bit spacing information in the character sequence is XXXX-XXX-XXXX (the second line in the figure, the numbers represent the order of characters), it can be determined that the 4th character in the character sequence is multi-identified, and the 7th and 8th characters are missed.
- the fourth character in the character sequence can be deleted, and the candidate sub-image is determined at the pixel position between the pixel positions corresponding to the seventh and eighth characters of the determined line sub-image, and the content of the candidate sub-image is recognized again, and the first 7.
- the character result between the 8 characters, and the character sequence is updated to XXX-XXXX-XXXX according to the character result (the third line in the figure, the number represents the order of the characters), and then step S210 is executed.
- S210 Perform a preset check algorithm test on the character sequence, and determine whether the test passes.
- the card issuer Since the card issuer usually satisfies a certain verification algorithm when issuing a card number, it can perform a corresponding preset verification algorithm test on the character sequence after obtaining the character sequence.
- Luhn detection when the recognized character sequence is a bank card number, Luhn detection (also called modulo 10 detection) can be performed. Luhn detection can detect single code errors and adjacent digit transposition errors, and can be used to detect bank card numbers and ID numbers.
- the preset verification algorithm may also be other verification algorithms such as the Fairhoff algorithm. The embodiment of the present disclosure does not limit the specific algorithm of the preset verification algorithm.
- the preset check algorithm fails to pass the check, repeat the modification of the distribution format information, update the character sequence according to the distribution format information, and perform a preset check on the updated character sequence The step of algorithm detection until the updated character sequence is detected by the preset verification algorithm.
- the reason for the incorrect character sequence in this step may be that the character interval information in the distribution format information determined in S206 is incorrect. Take a photo of the card Environmental factors such as time angle and illumination interfere with the recognition of distribution format information.
- S212 Determine the character sequence detected by the preset verification algorithm as the target card number.
- the above technical solution can at least achieve the following technical effects.
- the card image can be determined to reduce the image that needs to be finely recognized, so that the speed of subsequent recognition can be improved.
- the distribution format information is pre-identified through the virtual detection strip, and the obtained distribution format information conforms to the actual distribution of the card numbers, providing an effective comparison standard for subsequent recognition results.
- the character sequence that does not pass the detection will be updated until it is detected by the preset algorithm.
- the errors in the recognition link can be further offset by the follow-up verification link, which can reduce the recognition errors caused by multiple character recognition and missing recognition, and make the recognized character sequence meet the format requirements of the issuer and increase the card number Accuracy of recognition.
- Fig. 3 is a block diagram showing a device 300 for identifying a card number according to an exemplary embodiment.
- the device includes the following modules.
- the format obtaining module 301 is configured to obtain the distribution format information of the character bits of the card number sequence, wherein the distribution format information includes the character bit spacing information of the card number sequence.
- the recognition module 302 is configured to recognize the character sequence in the target image through a pre-trained neural network model, and obtain the character bit spacing information of the recognized character sequence.
- the judging module 303 is configured to judge whether the character bit spacing information in the recognized character sequence is consistent with the character bit spacing information in the obtained distribution format information.
- the determining module 304 is configured to determine that the recognized character sequence is the target card number when it is determined that the character bit spacing information in the character sequence is consistent with the character bit spacing information in the distribution format information.
- the format of the recognized character sequence is compared with the distribution format information, and it can be determined whether the format of the recognized character sequence is consistent with the format in the distribution format information, and if they are consistent, the output target
- the card number can reduce the recognition errors caused by multiple character recognition and missing recognition, and improve the accuracy of card number recognition.
- the device further includes: an image acquisition module for acquiring a rectangular card image; a generating module for generating a virtual detection surface covering the card image, wherein the virtual detection surface includes a plurality of The long side of the card image, and the virtual detection strip that runs through the card image; the target determination module is used to determine a target that intersects with characters exceeding the first preset number from the virtual detection strip according to preset image characteristics A virtual detection strip, wherein the preset image features include image features that characterize the intersection of the virtual detection strip and a character; an image interception module is used to detect the target virtual detection strip corresponding to the pixel position of the card image, The target image is intercepted on the card image.
- an image acquisition module for acquiring a rectangular card image
- a generating module for generating a virtual detection surface covering the card image, wherein the virtual detection surface includes a plurality of The long side of the card image, and the virtual detection strip that runs through the card image
- the target determination module is used to determine a target that intersects with characters exceeding the
- the image capture module is configured to select a second preset number of consecutive target virtual test strips as a target virtual test strip group; capture the card image at least including the presets of the target virtual test strip group The size of the image area is the target image.
- the image acquisition module is configured to determine at least three vertex pixel positions from the input image, the vertex pixel positions are used to characterize the card vertex corners; according to the at least three vertex pixel positions
- the input image is determined to represent the image area where the card is located; the image area is corrected to generate a rectangular card image.
- the format acquisition module is configured to determine, in the target image, the pixel position where the target virtual detection strip intersects the character according to the preset image feature; according to at least one of the target virtual detection strip and the character The intersecting pixel position of each character determines the character bit spacing information of the distribution format information.
- the format obtaining module is further configured to obtain category information of the card number; according to the category information of the card number, and the preset correspondence between the card number category and the card number distribution format information, determine the sequence of the card number Distribution format information of character bits.
- the recognition module includes: a sampling sub-module, configured to collect multiple sub-images on the target image through preset multiple sampling windows; and the recognition sub-module, configured to obtain multiple sub-images based on the pre-trained
- the neural network model identifies the character label corresponding to each of the sub-images; the first determining sub-module is used to determine the probability of the character label corresponding to the character label from the multiple sub-images through the non-maximum value suppression algorithm.
- Conditional target sub-image a generating sub-module for generating the character sequence according to the character label corresponding to the target sub-image; a second determining sub-module for determining according to the pixel position of the target sub-image
- the character spacing information in the character sequence is provided.
- the plurality of sampling windows are distributed in the form of an array, each sampling window of each row of the array is distributed along the horizontal direction of the target image, and each sampling window of each row of the array
- the two adjacent sampling windows are separated by a preset step length and partially overlap
- the first determining sub-module is configured to obtain the probability that each sub-image corresponds to the character label
- the line of the sub-image with the highest sum of the determined probabilities is used as the determined line sub-image
- the probability corresponding to the character label is determined The target sub-image that meets the probability condition.
- the classifier labels of the pre-trained neural network model include character class labels corresponding to image features of each digital character in different printing styles and space labels corresponding to image features of non-character regions.
- the device further includes: an update module, configured to: when the recognized character bit spacing information in the character sequence is inconsistent with the character bit spacing information in the acquired distribution format information, then The distribution format information updates the character sequence.
- an update module configured to: when the recognized character bit spacing information in the character sequence is inconsistent with the character bit spacing information in the acquired distribution format information, then The distribution format information updates the character sequence.
- the update module is configured to delete characters in the character sequence that do not conform to the distribution format information; and/or, in the determined line sub-image, determine that the pixel position conforms to the distribution format information For the candidate sub-image of the character bit, the character sequence is updated according to the character tag corresponding to the candidate sub-image.
- the device further includes: a check module, configured to determine whether the character sequence is detected by a preset check algorithm; when the character sequence is not detected by the preset check algorithm, repeat the modification of the distribution Format information, and update the character sequence according to the distribution format information, and perform the step of judging whether the preset verification algorithm passes the detection on the updated character sequence, until the updated character sequence passes the preset calibration Test algorithm detection.
- a check module configured to determine whether the character sequence is detected by a preset check algorithm; when the character sequence is not detected by the preset check algorithm, repeat the modification of the distribution Format information, and update the character sequence according to the distribution format information, and perform the step of judging whether the preset verification algorithm passes the detection on the updated character sequence, until the updated character sequence passes the preset calibration Test algorithm detection.
- the determining module is configured to determine the character sequence detected by the preset verification algorithm as the target card number.
- the above technical solution can at least achieve the following technical effects.
- the card image can be determined to reduce the image that needs to be finely recognized, so that the speed of subsequent recognition can be improved.
- the distribution format information is pre-identified through the virtual detection strip, and the obtained distribution format information conforms to the actual distribution of the card numbers, providing an effective comparison standard for subsequent recognition results.
- the character sequence that does not pass the detection will be updated until the preset algorithm is detected Therefore, it is possible to reduce recognition errors caused by multiple recognition and missing recognition of characters, and make the recognized character sequence meet the format requirements of the issuer, and improve the accuracy of card number recognition.
- the embodiment of the present disclosure also provides a non-volatile computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the method for identifying a card number are realized.
- An embodiment of the present disclosure also provides an electronic device, including: a memory on which a computer program is stored; and a processor for executing the computer program in the memory to implement the steps of the method for identifying a card number.
- Fig. 4 is a block diagram showing an electronic device 400 according to an exemplary embodiment.
- the electronic device 400 can be provided as a smart phone, a smart tablet device, a personal financial management terminal, and so on.
- the electronic device 400 may include: a processor 401 and a memory 402.
- the electronic device 400 may further include one or more of a multimedia component 403, an input/output (I/O) interface 404, and a communication component 405.
- the processor 401 is used to control the overall operation of the electronic device 400 to complete all or part of the steps in the method for identifying a card number described above.
- the memory 402 is used to store various types of data to support operations on the electronic device 400. These data may include, for example, instructions for any application or method to operate on the electronic device 400, and application-related data. For example, pre-trained convolutional neural network model data, card image data to be recognized, and in addition, can also include pre-stored format information.
- the memory 402 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, SRAM for short), electrically erasable programmable read-only memory ( Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-only Memory (Read-Only Memory, ROM for short), magnetic memory, flash memory, magnetic disk or optical disk.
- the multimedia component 403 may include a screen and an audio component.
- the screen may be a touch screen, for example, and the audio component is used to output and/or input audio signals.
- the audio component may include a microphone, which is used to receive external audio signals.
- the received audio signal can be further stored in the memory 402 or sent through the communication component 405.
- the audio component also includes at least one speaker for outputting audio signals.
- the I/O interface 404 provides an interface between the processor 401 and other interface modules.
- the above-mentioned other interface modules may be keyboards, mice, buttons, and so on. These buttons can be virtual buttons or physical buttons.
- the communication component 405 is used for wired or wireless communication between the electronic device 400 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination of one or more of them, so the corresponding communication component 405 may include: Wi-Fi module, Bluetooth module, NFC module.
- the electronic device 400 may be used by one or more application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), digital signal processor (Digital Signal Processor, DSP for short), and digital signal processing equipment (Digital Signal Processor).
- ASIC Application Specific Integrated Circuit
- DSP Digital Signal Processor
- Digital Signal Processor Digital Signal Processor
- DSPD Signal Processing Device
- PLD Programmable Logic Device
- FPGA Field Programmable Gate Array
- controller microcontroller, microprocessor or other electronic components Implementation, used to implement the above method of identifying card numbers.
- a computer-readable storage medium including program instructions, which, when executed by a processor, implement the steps of the above method for identifying a card number.
- the computer-readable storage medium may be the aforementioned memory 402 including program instructions, and the aforementioned program instructions may be executed by the processor 401 of the electronic device 400 to complete the aforementioned method of identifying a card number.
- Fig. 5 is a block diagram showing an electronic device 500 according to another exemplary embodiment.
- the electronic device 500 may be provided as a server. 5
- the electronic device 500 includes a processor 522, the number of which may be one or more, and a memory 532 for storing a computer program executable by the processor 522.
- the computer program stored in the memory 532 may include one or more modules each corresponding to a set of instructions.
- the processor 522 may be configured to execute the computer program to execute the aforementioned method for identifying a card number.
- the electronic device 500 may further include a power supply component 526 and a communication component 550, the power supply component 526 may be configured to perform power management of the electronic device 500, and the communication component 550 may be configured to implement the communication of the electronic device 500, for example, wired Or wireless communication.
- the electronic device 500 may further include an input/output (I/O) interface 558.
- the electronic device 500 can operate based on an operating system stored in the memory 532, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM and so on.
- a computer-readable storage medium including program instructions, which, when executed by a processor, implement the steps of the above method for identifying a card number.
- the computer-readable storage medium may be the aforementioned memory 532 including program instructions, and the aforementioned program instructions may be executed by the processor 522 of the electronic device 500 to complete the aforementioned method of identifying a card number.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Computing Systems (AREA)
- Artificial Intelligence (AREA)
- Health & Medical Sciences (AREA)
- Databases & Information Systems (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Character Input (AREA)
- Character Discrimination (AREA)
Abstract
一种识别***的方法和装置、存储介质及电子设备。所述方法包括:获取***序列的字符位的分布格式信息,其中,所述分布格式信息包括所述***序列的字符位间距信息(S11);通过预先训练的神经网络模型识别目标图像中的字符序列,并获取识别出的所述字符序列的字符位间距信息(S12);判断识别出的所述字符序列中的字符位间距信息与获取的所述分布格式信息中的字符位间距信息是否一致(S13);若所述字符序列中的所述字符位间距信息与获取的所述分布格式信息中的所述字符位间距信息一致,确定识别出的所述字符序列为目标***(S14)。
Description
本公开涉及图像识别领域,具体地,涉及一种识别***的方法和装置、存储介质及电子设备。
随着技术的发展,用户通过网络进行各项业务的场景越来越多。而在通过网络处理业务的过程中不可避免地需要对人们的***进行使用,例如身份证号、银行卡***等。
由于***的数字序列通常较长且难以记忆,手动输入的方式不够快捷并且容易出错,影响了用户办理业务的体验,也增加了网上办理业务的时间。因此,***识别作为缩短用户网上业务办理时间的功能,在网上业务办理的过程中起着重要作用。
发明内容
本公开提供一种识别***的方法和装置、存储介质及电子设备。
本公开的第一方面,提供一种识别***的方法,包括:
获取***序列的字符位的分布格式信息,其中,所述分布格式信息包括所述***序列的字符位间距信息;通过预先训练的神经网络模型识别目标图像中的字符序列,并获取识别出的所述字符序列的字符位间距信息;判断识别出的所述字符序列中的所述字符位间距信息与获取的所述分布格式信息中的所述字符位间距信息是否一致;若所述字符序列中的所述字符位间距信息与获取的所述分布格式信息中的所述字符位间距信息一致,确定识别出的所述字符序列为目标***。
第二方面,本公开提供一种数据处理的装置,所述装置包括:
格式获取模块,用于获取***序列的字符位的分布格式信息,其中,所述分布格式信息包括所述***序列的字符位间距信息;识别模块,用于通过预先训练的神经网络模型识别目标图像中的字符序列,并获取识别出的所述字符序列的字符位间距信息;判断模块,用于判断识别出的所述字符序列中的所述字符位间距信息与获取的所述分布格式信息中的所述字符位间距信息是否一致;确定模块,用于当判断字符序列中的所述字符位间距信息与所述分布格式信息中的所述字符位间距信息一致时,确定识别出的所述字符序列为目标***。
第三方面,本公开提供一种非易失性计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现本公开第一方面中任一项所述方法的步骤。
第四方面,本公开提供一种电子设备,应用于数据库,包括:存储器,其上存储有计算机程序;处理器,用于执行所述存储器中的所述计算机程序,以实本公开第一方面中任一项所述方法的步骤。
通过上述技术方案,至少能够达到以下技术效果。将识别出的字符序列与分布格式信息进行格式对比,可以确定识别出的字符序列的格式与分布格式信息中的格式是否一致,若一致,则输出目标***,从而可以减少因字符多识别、漏识别造成的识别错误,提高了***识别的准确度。
本公开的其他特征和优点将在随后的具体实施方式部分予以详细说明。
附图是用来提供对本公开的进一步理解,并且构成说明书的一部分,与下面的具体实施方式一起用于解释本公开,但并不构成对本公开的限制。
图1A是根据一示例性实施例示出的一种识别***方法的流程图。
图1B是根据一示例性实施例示出的一种识别***方法的示意图。
图2A是根据另一示例性实施例示出的一种识别***方法的流程图。
图2B是根据一示例性实施例示出的一种虚拟检测条示意图。
图2C是根据一示例性实施例示出的一种采样窗口的分布示意图。
图2D是根据一示例性实施例示出的一种通过采样窗口进行图像识别的示意图。
图2E是根据一示例性实施例示出的采样窗口获得的子图像的示意图。
图3是根据一示例性实施例示出的一种识别***的装置框图。
图4是根据一示例性实施例示出的一种识别***的电子设备框图。
图5是根据另一示例性实施例示出的一种识别***的电子设备框图。
以下结合附图对本公开的具体实施方式进行详细说明。应当理解的是,此处所描述的具体实施方式仅用于说明和解释本公开,并不用于限制本公开。
在一个例子中,提出了将***区域划分为多个***子区域并通过卷积神经网络提取各个***子区域的特征、将各个***子区域的特征输入分类器中从而得到当前图像中的***的方法。这一方案中,存在图像裁剪,识别等多个步骤,任一个环节出错有可能影响后续环节的准确度。在该方法中,由于子区域的划分依赖机器算法,子区域与子区域 之间的拼接处可能存在数字,因此可能导致一个数字被多个子区域识别造成的多次识别,或者每个子区域中的数字部分都无法识别造成的漏识别,相应地,识别出的***中可能存在多位、漏位的情况,这种情景产生的识别错误难以被后续环节校验出来,影响了***识别的准确性。
对此,本公开实施例提供一种识别***的方法,能够提升***识别的准确性。
图1A是根据一示例性实施例示出的一种识别***方法的流程图。该方法包括以下步骤。
S11、获取***序列的字符位的分布格式信息,所述分布格式信息包括所述***序列的字符位间距信息。
在本步骤中,可以通过确定***字符位置及字符间距的方式确定***序列的字符位的分布格式信息。本步骤中的分布格式信息可以为当前识别模式下的默认分布格式信息,也可以是预设表格中的分布格式信息,还可以是对卡片图像预处理得到的分布格式信息。
例如,当分布格式信息为当前识别模式下的默认分布格式信息时,当前识别模式可以为身份证图像识别,则该分布格式信息对应地可以是XXXXXXXXXXXXXXXXXX(数字数量及排列规则),数字间距为N像素(字符间距信息),则该字符位间距信息为(N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N)。又例如,当前识别模式也可以为某特定银行的银行卡图像识别,则根据该特定银行的银行卡***格式,该分布格式信息可以为XXX-XXXX-XXXX-XXXX(数字数量及排列规则),相邻数字间距为N1像素,“-”字符处对应间距为N2像素,则该字符位间距信息为(N1,N1,N2,N1,N1,N1,N2,N1,N1,N1,N2,N1,N1,N1)。
字符位间距除了用具体的像素值表示以外,还可以通过单位长度表示,例如,对于格式为XXX-XXXX序列,其在目标图像上的排列方式可能是X-X-X---X-X-X-X,则第1/2/3位数字之间间距为1个单位长度,第3位和第4位数字之间间距为3个单位长度,第4/5/6/7位数字之间间距为1个单位长度。
字符位间距在不同类型的***中可能存在多种变化。例如,有的***主***后还有三位校验码,三位校验码距离主***的位置较远。那么分布格式可以表示为XXX-XXXXXXX-XXXX----xxx(三位校验码),如果用像素值的方式表示,则可以是(4,4,10,4,4,4,4,4,4,10,4,4,4,25,4,4);如果用单位长度表示,其在目标图像上的排列方式可能是X-X-X---X-X-X-X-X-X-X---X-X-X-X--------xxx,则第1/2/3位数字之间的间距为1个单位长度,第3位和第4位数字之间的间距为3个单位长度,……,第14位数字和第15位数字之间的间距为8个单位长度,……。
在一种可能的实现方式中,可以获取所述***的类别信息,并根据所述***的类别 信息,以及预设的***类别与***分布格式信息的对应关系,确定所述***序列的字符位的分布格式信息。
即,可以通过卡片所属的不同卡类、不同银行、不同卡种(即类别信息)来确定相应的***序列的分布格式信息。例如,如果该卡片是身份证号,而身份证号的***分布格式为18位无间隔号,则对应的分布格式信息则可以是(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4),由此确定的序列格式即为XXXXXXXXXXXXXXXXXX;如果该卡片是借记卡,且发卡银行为工商银行,而工商银行的银行借记卡的***分布格式为XXXXXX-XXXXXXXXXXXXX,则对应的分布格式信息则可以是(4,4,4,4,4,10,4,4,4,4,4,4,4,4,4,4,4,4),由此确定的序列格式即为XXXXXX-XXXXXXXXXXXXX;如果该卡片是***,且发卡银行为建设银行,而建设银行的***的***分布格式为XXXX-XXXX-XXXX-XXXX,则对应的分布格式信息可以是(4,4,4,10,4,4,4,10,4,4,4,10,4,4,4),由此确定的序列格式即为XXXX-XXXX-XXXX-XXXX。
值得说明的是,***的类别信息的确定,可以通过识别卡片背景的样式确定,也可以通过办理的业务类型及其进度确定。例如,如果用户正在办理贷款业务,且正处于输入身份证号的进度节点,则可以确定用户输入的卡片图像属于身份证的类别。
S12、通过预先训练的神经网络模型识别目标图像中的字符序列,并获取识别出的所述字符序列的字符位间距信息。
在本步骤中,可以识别出目标图像中的字符序列,并通过字符序列中的字符所在的像素位置确定字符间的间距,从而确定识别出的所述字符序列的字符位间距信息。
例如,识别出的字符序列可以是123-4567-1234-1234,其中,相邻字符间的字符间距为4像素,“-”字符处对应的间距为10像素,则该字符位间距信息为(4,4,10,4,4,4,10,4,4,4,10,4,4,4)。
S13、判断识别出的所述字符序列中的字符位间距信息与获取的所述分布格式信息中的字符位间距信息是否一致。
在本步骤中,可以确定在S12中得到的字符序列中的字符位间距信息与在S11中得到的分布格式信息中的字符位间距信息是否一致。
例如,在分布格式信息中得到的字符位间距信息是(4,4,4,10,4,4,10,4,4,4),代表共有11位数字,且因为第4、5位和7、8位之间间距明显大于其他位置,因此可以确定该序列的格式为XXXX-XXX-XXXX;而在字符序列中得到的字符位间距信息为(4,4,19,4,4,10,4,4,4,),由此确定的序列格式为XXX-XXX-XXXX,第3、4位之间的字符位间距信息明显与分布格式信息中的字符间距信息不一致,因此 说明在第3、4位数字间的识别有误。
值得说明的是,由于卡片拍摄的角度、光照情况等不同,字符位间距信息可能没有完全对应一致,因此,可以预设一个误差范围,若字符序列中的字符位间距信息与分布格式信息中的字符位间距信息间的差异在误差范围内,也可以认为二者一致。
S14、若一致,确定识别出的所述字符序列为目标***。
当字符序列中的字符位间距信息与分布格式信息中的字符位间距信息一致时,该字符序列为正确的可能性较高,可以确定该字符序列为目标***。
在一种可选的实施方式中,若识别出的字符序列中的字符位间距信息与分布格式信息中的字符位间距信息不一致,可以根据分布格式信息更新字符序列。
具体地,可以通过下面的方式更新所述字符序列:将所述字符序列中未符合所述分布格式信息的字符删除,并在目标图像中确定像素位置符合所述分布格式信息的字符位的更新子图像,根据更新子图像的识别结果更新所述字符序列。
例如,如图1B所示,分布格式信息的字符位间距信息表征的字符序列格式为XXX-XXXX-XXXX(第一行),字符序列中的字符位间距信息表征的字符序列格式为XXXX-XXX-XXXX(第二行,数字代表字符的顺序),则可以确定字符序列中的第4字符为多识别,第7、8字符间有漏识别。可以删除字符序列中的第4字符,且在第7、8字符对应的像素位置中间的像素位置上确定更新子图像,并重新识别该更新子图像的内容,确定第7、8字符间的字符结果,并根据该字符结果更新字符序列为XXX-XXXX-XXXX(第三行,数字代表字符的顺序),并将更新后的字符序列确定为目标***。
本公开实施例根据***字符间距判断是否有识别错误,可以识别字符串并利用排列规范的字符串间的间距对字符串进行校正,因此,本公开实施例提供的方法可以应用于具有一定规范的字符串的识别和校正。
上述技术方案,至少能够达到以下技术效果:将识别出的字符序列与分布格式信息进行格式对比,可以确定识别出的字符序列的格式与分布格式信息中的格式是否一致,若一致则输出目标***,从而可以减少因字符多识别、漏识别造成的识别错误,从而提高了***识别的准确度。
图2A是根据另一示例性实施例示出的一种识别***方法的流程图。该方法包括以下步骤。
S201、获取矩形卡片图像。
具体地,可以通过下面方法获取矩形卡片图像:从输入的图像中确定至少三个顶角 像素位置,所述顶角像素位置用于表征卡片顶角;根据所述至少三个顶角像素位置在所述输入的图像中确定用于表征卡片所在的图像区域;对所述图像区域进行校正生成矩形卡片图像。
例如,在从一张用户手持卡片的照片中获取矩形卡片图像的过程中,由于卡片的一角被手指遮盖难以识别,只能识别到卡片图像的三个顶角,所以读取四个顶角并连线确定卡片图像的方法无法识别出此种情况下的卡片图像。在这种情况下,可以将三个顶角的位置的像素点连线,并将连线后的图像区域沿最长边镜面翻转即可得到表征卡片所在的图像区域,对该图像区域的形状进行校正即可生成矩形卡片图像。
识别顶角的方式比识别卡片边缘的方式速度更快,且减少了因为图像拍摄时产生的畸变导致的识别失败,并且,由于可以通过三个顶角确定卡片图像,可以减少卡片边缘和顶角被遮盖导致的识别误差。
进一步还可以通过仿射线变换校正图像的倾斜度。以卡片顶点检测代替边缘提取来提取图像区域,可以有效地减少冗余计算,加快整体流程的运算速度。
S202、生成覆盖所述卡片图像的虚拟检测面,所述虚拟检测面包括多条平行于所述卡片图像长边,且贯穿所述卡片图像的虚拟检测条。
如图2B所示的卡片图像上有多条平行于卡片图像长边且贯穿卡片图像的虚拟检测条(为了方便观察只显示四条,为221至224),所述虚拟检测条的长度(图2B中虚拟检测条的横向长度)与卡片图像的最长边边长相同,所述虚拟检测条的宽度(图2B中虚拟检测条的纵向长度)可以为便于提取图像特征的任意像素,例如,可以为2像素、4像素、5像素、6像素等,本公开实施例对该虚拟检测条的具体宽度不做限制。
S203、根据预设图像特征,确定与超过第一预设数目的字符相交的目标虚拟检测条。
其中,所述预设图像特征包括表征所述虚拟检测条与字符相交的图像特征。所述预设图像特征包括表征所述虚拟检测条与字符相交的图像特征。在本方法中,预先存有虚拟检测条与每一数字的每一部分相交时产生的图像特征,通过对比目标虚拟检测条所在区域的图像是否符合图像特征,可以确定目标虚拟检测条是否与字符相交,如图2B所示的卡片图像上虚拟检测条223和224与字符相交,虚拟检测条221和222未与字符相交。
值得说明的是,在通过目标虚拟检测条确定目标图像时,由于有复杂的背景图案的存在,虚拟检测条与背景图案相交的位置可能会与字符产生相似的图像特征,如果将与一个符合图像特征的字符相交的虚拟检测条确认为目标虚拟检测条,可能会有错误识别目标图像的位置的风险。
因此,可以确定超过第一预设数目的字符相交的虚拟检测条为目标虚拟检测条。根 据要识别的***类型,可以根据***中包括的字符数目预设所述第一数目,该第一预设数目可以为5个、10个、15个等,本公开实施例对此不做限制。
S204、根据所述目标虚拟检测条对应所述卡片图像的像素位置,在所述卡片图像上截取目标图像。
在本步骤中,通过目标虚拟检测条的位置,可以确定字符序列所在的目标图像的位置,从而截取目标图像。
在一种可选的实施方式中,可以通过选取第二预设数目条连续的目标虚拟检测条作为目标虚拟检测条组,并截取卡片图像中至少包括目标虚拟检测条组的、尺寸为预设大小的图像区域,作为目标图像。或者,截取包括目标虚拟检测条组且并未包括其他虚拟检测条的图像区域为目标图像。
例如,该第二预设数目可以是25条,则如果有连续25条目标虚拟检测条,可以将连续25条目标虚拟检测条作为目标虚拟检测条组。该目标虚拟检测条组在卡片图像中的像素大小可以是428×50;该预设大小可以是428×60,则可以选择卡片图像中包括了目标虚拟检测条组所在的区域、尺寸为预设大小的图像为目标图像。
这样,可以通过粗定位***所在区域的方式,减小输入***识别神经网络的图像尺寸,从而提升后续的识别速度。
S205、根据所述预设图像特征,在所述目标图像中确定所述目标虚拟检测条与字符相交的像素位置。
其中,所述预设图像特征包括表征所述虚拟检测条与字符相交的图像特征。在本方法中,预先存有虚拟检测条与每一数字的每一部分相交时产生的图像特征,通过对比虚拟检测条所在区域的图像是否符合图像特征,可以确定虚拟检测条是否与字符相交,如图2B所示的虚拟检测条223、224与字符相交,虚拟检测条221、222未与字符相交。
S206、根据至少一条所述目标虚拟检测条与每一所述字符相交的像素位置获取分布格式信息的字符位间距信息。
在本步骤中,可以通过每一与目标虚拟检测条相交的字符像素之间的间隔,获取分布格式信息的字符位间距信息,所述字符位间距信息可以是一个列表,例如,所述字符位间距信息可以是4,4,4,10,4,4,4,则代表“第一个字符与第二字符之间相隔4像素,……第四个字符与第五个字符之间相隔10像素,……”。由于与字符相交的目标虚拟检测条会有多条,所以该字符位间距信息可以是所有与字符相交的目标虚拟检测条中固定位置的任意目标虚拟检测条(例如位于正中的目标虚拟检测条)上的字符像素之间的间距列表,本公开对此不做限定。
S207、通过预先训练的神经网络模型识别目标图像中的字符序列,并获取识别出的所述字符序列的字符位间距信息。
具体地,可以通过下述可能的实施方式识别目标图像中的字符序列并获取识别出的所述字符序列的字符位间距信息。
首先,通过预设的多个采样窗口在所述目标图像上采集得到多个子图像。
目标图像中的每一位置都可以在至少一个采样窗口中出现,该采样窗口可以以并列且无重叠的方式排列,也可以以阵列的形式分布,相邻的采样窗口间部分重叠。
在一种可能的实现方式中,所述采样窗口可以以阵列的形式分布,所述阵列的每一行所述采样窗口沿所述目标图像的水平方向分布,所述阵列的每一行所述采样窗口中,两相邻所述采样窗口之间相距预设步长且部分重叠。
图2C是采样窗口的分布示意图。该示意图中的目标图像上有15个采样窗口,如虚线框所示,共3行5列,第一行从左往右依次为采样窗口1、采样窗口2、采样窗口3、采样窗口4、采样窗口5,其他行同理。实线框示意的采样窗口依次为采样窗口1、采样窗口3和采样窗口15。如此排列的采样窗口可以覆盖整个目标图像,且在交界处有重叠,可以减少因图像分割的交界处存在字符而导致的识别错误。
在本实施例可选的实施方式中,目标图像的大小为预设像素大小,采样窗口的大小及排列方式也为预设样式,因此,可以根据预设值定制标准的处理流程参数。在处理不同的目标图像时,均可以参照上述标准的处理流程参数实施,减少冗余计算,提升***识别的效率。
其次,根据所述预先训练的神经网络模型识别每一所述子图像对应的字符标签。
其中,所述预先训练的神经网络模型的分类器标签可以包括对应不同印刷样式下的每一数字字符图像特征的字符类标签和对应无字符区域图像特征的空格标签。其中,不同的印刷样式可以指平面印刷、凸字印压、凹字印压等,不同的印刷方式对应的图像特征和字符间距都有很大差异。由于不同字体的数字间也有很大差异,所以还可以在每一分类标签下添加不同字体的数字的图像特征。
例如,可以将分类器的标签设置为21类,分别对应印刷数字0-9、印压凹凸数字0-9、和背景(无数字输出)。每一个数字可以对应两个分类器标签,即印刷数字的标签,和印压凹凸数字的标签。这样,可以更精确地识别数字,可以适用于铸钢标号等存在印压字体的场景。
所述子图像对应所述字符标签,可以是子图像对应的所有可能的分类器字符标签中概率最高的一个字符标签,所述字符标签的概率,可以是子图像与对应的字符标签的模 型相似度。
然后,通过非极大值抑制算法从多个所述子图像中,确定对应所述字符标签的概率符合概率条件的目标子图像。
每一个子图像可以对应目标图像的一个位置上的识别结果,如果目标图像上的一个位置对应了多个子图像,则可以确定字符标签的概率符合概率条件的子图像为目标子图像。该概率条件可以是多个子图像中概率最高,也可以是多个子图像中概率超过概率阈值。
具体地,在一种可能的实现方式中,所述采样窗口以阵列的形式分布,所述阵列的每一行所述采样窗口沿所述目标图像的水平方向分布,所述阵列的每一行所述采样窗口中,两个相邻所述采样窗口之间相距预设步长且部分重叠;在获取子图像对应的字符标签和概率后,可以将这些字符标签和概率按照采样窗口的排列形式排列,例如,如果按照图2D中采样窗口对目标图像进行识别,将得到如图2E中按照1-15依次排列的子图像#1-#15,括号中的前一数字代表字符标签,括号中的后一数字代表字符标签的概率的百分比值。则图2E中的子图像对应的字符标签和概率分别为(2,80),(6,75),(0,85),(7,41),(6,56),(2,90),(0,94),(0,85),(1,98),(9,98),(2,78),(0,40),(6,50),(1,95),(9,80),因此,可以按照和采样窗口相同的排列方式,将识别结果按如下的形式排列:
(2,80),(6,75),(0,85),(7,41),(6,56)
(2,90),(0,94),(0,85),(1,98),(9,98)
(2,78),(0,40),(6,50),(1,95),(9,80)
在将识别结果按照采样窗口的排列顺序排列后,确定多行所述采样窗口采集的多行所述子图像中,概率总和最高的确定行子图像。
可以通过计算每一行的概率值总和,确定总和最高的一行识别结果,并通过该识别结果确定与之对应的一行子图像为确定行子图像,例如,在上述三行识别结果中,由于第二行的识别结果的概率值总和最高,因此,可以得到概率总和最高的确定行子图像为第二行采样窗口采集的子图像,即如图2E所示的第二行子图像。
在确定总和最高的一行识别结果后通过非极大值抑制算法从所述确定行子图像中,确定对应所述字符标签的概率符合概率条件的目标子图像。
该符合概率条件可以为概率最高,也就是说,确定对应所述字符标签的概率符合概率条件的目标子图像,可以是确定字符所在像素位置对应的子图像中,与预设模型最为相似(即概率最高)的子图像为目标子图像。
如图2E所示,在字符0所在的像素位置对应了子图像7和子图像8,在这两个子图像中,由于子图像7的概率最高,则可以确定子图像7为目标子图像。
然后,根据所述目标子图像对应的字符标签生成所述字符序列。
每一字符对应一个目标子图像,将所有目标子图像的识别结果中的字符标签按照目标子图像的排列顺序排列,可以获得字符序列。
例如,如图2E所示的目标图像中确定的目标子图像(子图像6,子图像7,子图像9,子图像10)所生成的字符序列为2019。
最后,根据所述目标子图像所处的像素位置,确定所述字符序列中字符位的间距信息。
可以通过各目标子图像所表征的字符像素之间的间隔,确定所述字符间距,所述字符间距可以是一个列表,例如,所述字符间距可以是4,4,4,10,4,4,4,则代表“第一个字符与第二字符之间相隔4像素,……第四个字符与第五个字符之间相隔10像素,……”。由于字符间距在不同的像素位置上可能会不尽相同,所以该字符间距可以是任意位置(例如目标子图像横向中心线的像素位置)上的字符像素之间的间距列表,本公开对此不做限定。
S208、判断识别出的所述字符序列中的字符位间距信息与获取的所述分布格式信息中的字符位间距信息是否一致。
在本步骤中,可以对比字符序列中的字符位间距信息与分布格式信息中的字符位间距信息,判断识别出的所述字符序列中的字符位间距信息与所述分布格式信息中的字符位间距信息是否一致。
例如,在分布格式信息中得到的字符位间距信息是(4,4,4,10,4,4,10,4,4,4),代表共有11位数字,且因为第4、5位和7、8位之间的间距明显大于其他位置,因此可以确定该序列的格式为XXXX-XXX-XXXX;而在字符序列中得到的字符位间距信息为(4,4,19,4,4,10,4,4,4,),由此确定的序列格式为XXX-XXX-XXXX,第3、4位之间的字符位间距信息明显与分布格式信息中的字符间距信息不一致,因此说明在第3、4位数字间的识别有误。
值得说明的是,除了通过步骤S202至S207中获取到分布格式信息以外,在具体实施时,还可以通过以下方式获取所述分布格式信息:获取所述***的类别信息,并根据所述***的类别信息,以及预设的***类别与***分布格式信息的对应关系,确定所述***序列的字符位的分布格式信息。
若所述字符序列中的字符位间距信息与所述分布格式信息中的字符位间距信息一致, 则执行步骤S210;若所述字符序列中的字符位间距信息与所述分布格式信息中的字符位间距信息不一致,执行步骤S209。
S209、根据所述分布格式信息更新所述字符序列,并执行步骤S210。
具体地,可以通过下面的方式更新所述字符序列:将所述字符序列中未符合所述分布格式信息的字符删除,并在所述确定行子图像中确定像素位置符合所述分布格式信息的字符位的待选子图像,根据所述待选子图像对应的字符标签更新所述字符序列。
例如,如图1B所示,分布格式信息的字符位间距信息表征的字符序列格式为XXX-XXXX-XXXX(图中的第一行),字符序列中的字符位间距信息表征的字符序列格式为XXXX-XXX-XXXX(图中的第二行,数字代表字符的顺序),则可以确定字符序列中的第4字符为多识别,第7、8字符间有漏识别。可以删除字符序列中的第4字符,且在确定行子图像的第7、8字符对应的像素位置中间的像素位置上确定待选子图像,并重新识别该待选子图像的内容,确定第7、8字符间的字符结果,并根据该字符结果更新字符序列为XXX-XXXX-XXXX(图中的第三行,数字代表字符的顺序),再执行步骤S210。
S210、对所述字符序列进行预设校验算法检测,判断是否通过该检测。
由于发卡方在发行***时通常会满足一定的校验算法,因此,可以在获取字符序列后对该字符序列进行相应的预设校验算法检测。
例如,当识别的字符序列为银行***时,可以进行Luhn检测(又称模10检测)。Luhn检测可以检测到单码的错误以及相邻数字换位的错误,可以用于银行***码、身份证号码的检测。除此以外,所述预设校验算法还可以是费尔赫夫算法等其他校验算法,本公开实施例对预设校验算法的具体算法不作限制。
S211、若所述预设校验算法检测未通过,则重复执行修改所述分布格式信息,并根据所述分布格式信息更新所述字符序列,并对更新的所述字符序列进行预设校验算法检测的步骤,直至更新的所述字符序列通过所述预设校验算法检测。
如果预设校验算法未通过,说明字符序列不符合发行规则,即字符序列不正确。由于已经在S209中对多识别、漏识别进行过纠正了,故而在本步骤中字符序列不正确的原因可能是由于在S206中确定的分布格式信息中的字符位间隔信息不正确,拍摄卡片照片时的角度、光照等环境因素干扰了对分布格式信息的识别。
因此,可以在多个预存的***格式里依次进行格式匹配,即在多个预存的***格式里确定任一预设格式,根据该预设格式修改分布格式信息,并执行S209中更新字符序列的步骤,并再次进行S210中预设校验算法检测的步骤,如果不通过,再在多个预存的***格式里确定另一预设格式,重复执行上述更新并检测的步骤,直到更新的字 符序列可以通过预设校验算法。
S212、将通过所述预设校验算法检测的字符序列确定为目标***。
上述技术方案,至少能够达到以下技术效果。可以通过确定卡片图像以减小需要进行精细识别的图像,从而可以提升后续的识别的速度。进而,通过虚拟检测条对分布格式信息进行预先识别,得到的分布格式信息符合卡片数字实际分布情况,为后续识别结果提供有效的比对标准。预识别分布格式信息并将识别出的字符序列与分布格式信息进行格式对比,更新不一致的位置的字符,再进行预设算法检测,不通过检测的字符序列会更新直至通过预设算法检测,提升了***识别的纠错能力。在本方案中,识别环节出现的错误可以被后续检验环节进一步抵消,从而可以减少因字符多识别、漏识别等造成的识别错误,并使识别出字符序列满足发行方的格式要求,提高了***识别的准确度。
图3是根据一示例性实施例示出的一种识别***的装置300的框图,该装置包括以下模块。
格式获取模块301,用于获取***序列的字符位的分布格式信息,其中,所述分布格式信息包括所述***序列的字符位间距信息。
识别模块302,用于通过预先训练的神经网络模型识别目标图像中的字符序列,并获取识别出的所述字符序列的字符位间距信息。
判断模块303,用于判断识别出的所述字符序列中的字符位间距信息与获取的所述分布格式信息中的字符位间距信息是否一致。
确定模块304,用于当判断字符序列中的字符位间距信息与所述分布格式信息中的字符位间距信息一致时,确定识别出的所述字符序列为目标***。
通过上述技术方案,至少能够达到以下技术效果:将识别出的字符序列与分布格式信息进行格式对比,可以确定识别出的字符序列的格式与分布格式信息中的格式是否一致,若一致则输出目标***,从而可以减少因字符多识别、漏识别造成的识别错误,提高了***识别的准确度。
可选地,所述装置还包括:图像获取模块,用于获取矩形卡片图像;生成模块,用于生成覆盖所述卡片图像的虚拟检测面,其中,所述虚拟检测面包括多条平行于所述卡片图像的长边,且贯穿所述卡片图像的虚拟检测条;目标确定模块,用于根据预设图像特征,从所述虚拟检测条中确定与超过第一预设数目的字符相交的目标虚拟检测条,其中,所述预设图像特征包括表征所述虚拟检测条与字符相交的图像特征;图像截取模块,用于根据所述目标虚拟检测条对应所述卡片图像的像素位置,在所述卡片图像上截取所述目标图像。
可选地,所述图像截取模块,用于选取第二预设数目条连续的目标虚拟检测条作为目标虚拟检测条组;截取所述卡片图像中至少包括所述目标虚拟检测条组的预设大小的图像区域为所述目标图像。
可选地,所述图像获取模块,用于从输入的图像中确定至少三个顶角像素位置,所述顶角像素位置用于表征卡片顶角;根据所述至少三个顶角像素位置在所述输入的图像中确定用于表征卡片所在的图像区域;对所述图像区域进行校正以生成矩形卡片图像。
可选地,所述格式获取模块,用于根据所述预设图像特征,在所述目标图像中确定所述目标虚拟检测条与字符相交的像素位置;根据至少一条所述目标虚拟检测条与每一所述字符相交的像素位置,确定分布格式信息的所述字符位间距信息。
可选地,所述格式获取模块,还用于获取所述***的类别信息;根据所述***的类别信息,以及预设的***类别与***分布格式信息的对应关系,确定所述***序列的字符位的分布格式信息。
可选地,所述识别模块,包括:采样子模块,用于通过预设的多个采样窗口,在所述目标图像上采集得到多个子图像;识别子模块,用于根据所述预先训练的神经网络模型,识别每一所述子图像对应的字符标签;第一确定子模块,用于通过非极大值抑制算法从多个所述子图像中,确定对应所述字符标签的概率符合概率条件的目标子图像;生成子模块,用于根据所述目标子图像对应的字符标签,生成所述字符序列;第二确定子模块,用于根据所述目标子图像所处的像素位置,确定所述字符序列中字符位间距信息。
可选地,所述多个采样窗口以阵列的形式分布,所述阵列的每一行的各个所述采样窗口沿所述目标图像的水平方向分布,所述阵列的每一行的所述各个采样窗口中,两相邻所述采样窗口之间相距预设步长且部分重叠;所述第一确定子模块,用于获取每一所述子图像对应所述字符标签的概率;从多行所述采样窗口采集的多行所述子图像中,确定概率总和最高的一行子图像作为确定行子图像;通过非极大值抑制算法从所述确定行子图像中,确定对应所述字符标签的概率符合概率条件的目标子图像。
可选地,所述预先训练的神经网络模型的分类器标签包括对应不同印刷样式下每一数字字符图像特征的字符类标签和对应无字符区域图像特征的空格标签。
可选地,所述装置还包括:更新模块,用于当识别出的所述字符序列中的字符位间距信息与所述获取的所述分布格式信息中的字符位间距信息不一致时,则根据所述分布格式信息更新所述字符序列。
可选地,所述更新模块,用于将所述字符序列中未符合所述分布格式信息的字符删除;和/或,在所述确定行子图像中确定像素位置符合所述分布格式信息的字符位的 待选子图像,根据所述待选子图像对应的字符标签更新所述字符序列。
可选地,所述装置还包括:校验模块,用于判断所述字符序列是否通过预设校验算法检测;当未通过所述预设校验算法检测时,则重复执行修改所述分布格式信息,并根据所述分布格式信息更新所述字符序列,并对更新的所述字符序列进行判断预设校验算法是否通过检测的步骤,直至更新的所述字符序列通过所述预设校验算法检测。
所述确定模块,用于将通过所述预设校验算法检测的字符序列确定为目标***。
上述技术方案,至少能够达到以下技术效果。可以通过确定卡片图像以减小需要进行精细识别的图像,从而可以提升后续的识别的速度。进而,通过虚拟检测条对分布格式信息进行预先识别,得到的分布格式信息符合卡片数字实际分布情况,为后续识别结果提供有效的比对标准。并且,预识别分布格式信息并将识别出的字符序列与分布格式信息进行格式对比,更新不一致的位置的字符,再进行预设算法检测,不通过检测的字符序列会更新直至通过预设算法检测,从而可以减少因字符多识别、漏识别造成的识别错误,并使识别出字符序列满足发行方的格式要求,提高了***识别的准确度。
本领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能单元(模块)的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元(模块)完成,即将装置的内部结构划分成不同的功能单元(模块),以完成以上描述的全部或者部分功能。上述描述功能单元(模块)的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
本公开实施例还提供一种非易失性计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现所述识别***的方法的步骤。
本公开实施例还提供一种电子设备,包括:存储器,其上存储有计算机程序;处理器,用于执行所述存储器中的所述计算机程序,以实现所述识别***的方法的步骤。
图4是根据一示例性实施例示出的一种电子设备400的框图。该电子设备400可以被提供为智能手机,智能平板设备,个人理财终端等等。如图4所示,该电子设备400可以包括:处理器401,存储器402。该电子设备400还可以包括多媒体组件403,输入/输出(I/O)接口404,以及通信组件405中的一者或多者。
其中,处理器401用于控制该电子设备400的整体操作,以完成上述的识别***的方法中的全部或部分步骤。存储器402用于存储各种类型的数据以支持在该电子设备400的操作,这些数据例如可以包括用于在该电子设备400上操作的任何应用程序或方法的指令,以及应用程序相关的数据,例如预先训练的卷积神经网络模型数据,待识别的卡片图像数据,此外,还可以包括预存的格式信息等。该存储器402可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,例如静态随机存取存储器(Static Random Access Memory,简称SRAM),电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,简称EEPROM),可擦除可编程只读存储器(Erasable Programmable Read-Only Memory,简称EPROM),可编程只读存储器(Programmable Read-Only Memory,简称PROM),只读存储器(Read-Only Memory,简称ROM),磁存储器,快闪存储器,磁盘或光盘。多媒体组件403可以包括屏幕和音频组件。其中屏幕例如可以是触摸屏,音频组件用于输出和/或输入音频信号。例如,音频组件可以包括一个麦克风,麦克风用于接收外部音频信号。所接收的音频信号可以被进一步存储在存储器402或通过通信组件405发送。音频组件还包括至少一个扬声器,用于输出音频信号。I/O接口404为处理器401和其他接口模块之间提供接口,上述其他接口模块可以是键盘,鼠标,按钮等。这些按钮可以是虚拟按钮或者实体按钮。通信组件405用于该电子设备400与其他设备之间进行有线或无线通信。无线通信,例如Wi-Fi,蓝牙,近场通信(Near Field Communication,简称NFC),2G、3G或4G,或它们中的一种或几种的组合,因此相应的该通信组件405可以包括:Wi-Fi模块,蓝牙模块,NFC模块。
在一示例性实施例中,电子设备400可以被一个或多个应用专用集成电路(Application Specific Integrated Circuit,简称ASIC)、数字信号处理器(Digital Signal Processor,简称DSP)、数字信号处理设备(Digital Signal Processing Device,简称DSPD)、可编程逻辑器件(Programmable Logic Device,简称PLD)、现场可编程门阵列(Field Programmable Gate Array,简称FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述的识别***的方法。
在另一示例性实施例中,还提供了一种包括程序指令的计算机可读存储介质,该程序指令被处理器执行时实现上述的识别***的方法的步骤。例如,该计算机可读存储介质可以为上述包括程序指令的存储器402,上述程序指令可由电子设备400的处理器401执行以完成上述的识别***的方法。
图5是根据另一示例性实施例示出的一种电子设备500的框图。例如,电子设备500可以被提供为一服务器。参照图5,电子设备500包括处理器522,其数量可以为一个或多个,以及存储器532,用于存储可由处理器522执行的计算机程序。存储器532中存储的计算机程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理器522可以被配置为执行该计算机程序,以执行上述的识别***的方法。
另外,电子设备500还可以包括电源组件526和通信组件550,该电源组件526可以被配置为执行电子设备500的电源管理,该通信组件550可以被配置为实现电子设备500的通信,例如,有线或无线通信。此外,该电子设备500还可以包括输入/输出(I/O)接口558。电子设备500可以操作基于存储在存储器532的操作***,例如Windows Server
TM,Mac OS X
TM,Unix
TM,Linux
TM等等。
在另一示例性实施例中,还提供了一种包括程序指令的计算机可读存储介质,该程序指令被处理器执行时实现上述的识别***的方法的步骤。例如,该计算机可读存储介质可以为上述包括程序指令的存储器532,上述程序指令可由电子设备500的处理器522执行以完成上述的识别***的方法。
以上结合附图详细描述了本公开的优选实施方式,但是,本公开并不限于上述实施方式中的具体细节,在本公开的技术构思范围内,可以对本公开的技术方案进行多种简单变型,这些简单变型均属于本公开的保护范围。
另外需要说明的是,在上述具体实施方式中所描述的各个具体技术特征,在不矛盾的情况下,可以通过任何合适的方式进行组合,为了避免不必要的重复,本公开对各种可能的组合方式不再另行说明。
此外,本公开的各种不同的实施方式之间也可以进行任意组合,只要其不违背本公开的思想,其同样应当视为本公开所公开的内容。
Claims (15)
- 一种识别***的方法,其特征在于,所述方法包括:获取***序列的字符位的分布格式信息,其中,所述分布格式信息包括所述***序列的字符位间距信息;通过预先训练的神经网络模型识别目标图像中的字符序列,并获取识别出的所述字符序列的字符位间距信息;判断识别出的所述字符序列中的所述字符位间距信息与获取的所述分布格式信息中的所述字符位间距信息是否一致;若所述字符序列中的所述字符位间距信息与获取的所述分布格式信息中的所述字符位间距信息一致,确定识别出的所述字符序列为目标***。
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:获取矩形卡片图像;生成覆盖所述卡片图像的虚拟检测面,其中,所述虚拟检测面包括多条平行于所述卡片图像的长边,且贯穿所述卡片图像的虚拟检测条;根据预设图像特征,从所述虚拟检测条中确定与超过第一预设数目的字符相交的目标虚拟检测条,其中,所述预设图像特征包括表征所述虚拟检测条与所述字符相交的图像特征;根据所述目标虚拟检测条对应所述卡片图像的像素位置,在所述卡片图像上截取所述目标图像。
- 根据权利要求2所述的方法,其特征在于,截取所述目标图像,包括:选取第二预设数目条连续的目标虚拟检测条作为目标虚拟检测条组;截取所述卡片图像中至少包括所述目标虚拟检测条组的预设大小的图像区域为所述目标图像。
- 根据权利要求2所述的方法,其特征在于,获取所述矩形卡片图像,包括:从输入的图像中确定至少三个顶角像素位置,所述顶角像素位置用于表征卡片顶角;根据所述至少三个顶角像素位置,在所述输入的图像中确定用于表征卡片所在的图像区域;对所述图像区域进行校正以生成所述矩形卡片图像。
- 根据权利要求2所述的方法,其特征在于,获取所述***序列的所述字符位的所述分布格式信息,包括:根据所述预设图像特征,在所述目标图像中确定所述目标虚拟检测条与所述字符相 交的所述像素位置;根据至少一条所述目标虚拟检测条与每一所述字符相交的像素位置,确定所述分布格式信息的所述字符位间距信息。
- 根据权利要求1所述的方法,其特征在于,获取所述***序列的所述字符位的所述分布格式信息,包括:获取所述***的类别信息;根据所述***的所述类别信息,以及预设的***类别与***分布格式信息的对应关系,确定所述***序列的所述字符位的所述分布格式信息。
- 根据权利要求1-6任一项所述的方法,其特征在于,通过所述预先训练的神经网络模型识别所述目标图像中的所述字符序列,并获取识别出的所述字符序列的所述字符位间距信息,包括:通过预设的多个采样窗口,在所述目标图像上采集得到多个子图像;根据所述预先训练的神经网络模型,识别每一所述子图像对应的字符标签;通过非极大值抑制算法从多个所述子图像中,确定对应所述字符标签的概率符合概率条件的目标子图像;根据所述目标子图像对应的字符标签,生成所述字符序列;根据所述目标子图像所处的像素位置,确定所述字符序列中所述字符位间距信息。
- 根据权利要求7所述的方法,其特征在于,所述多个采样窗口以阵列的形式分布,所述阵列的每一行的各个所述采样窗口沿所述目标图像的水平方向分布,所述阵列的每一行的所述各个采样窗口中,两相邻所述采样窗口之间相距预设步长且部分重叠;确定所述目标子图像,包括:获取每一所述子图像对应所述字符标签的概率;从多行所述采样窗口采集的多行所述子图像中,确定概率总和最高的一行所述子图像作为确定行子图像;通过所述非极大值抑制算法从所述确定行子图像中,确定对应所述字符标签的概率符合所述条件的所述目标子图像。
- 根据权利要求7所述的方法,其特征在于,所述预先训练的神经网络模型的分类器标签包括:对应不同印刷样式下每一数字字符图像特征的字符类标签;对应无字符区域图像特征的空格标签。
- 根据权利要求8所述的方法,其特征在于,所述方法还包括:若识别出的所述字符序列中的字符位间距信息与所述分布格式信息中的字符位间距信息不一致,则根据所述分布格式信息更新所述字符序列。
- 根据权利要求10所述的方法,其特征在于,根据所述分布格式信息更新所述字符序列,包括:将所述字符序列中未符合所述分布格式信息的字符删除;和/或在所述确定行子图像中确定像素位置符合所述分布格式信息的字符位的待选子图像,根据所述待选子图像对应的字符标签更新所述字符序列。
- 根据权利要求10或11所述的方法,其特征在于,所述方法还包括:在确定识别出的所述字符序列为所述目标***前,所述方法还包括:判断所述字符序列是否通过预设校验算法检测;若未通过所述预设校验算法检测,则重复执行修改所述分布格式信息,并根据所述分布格式信息更新所述字符序列,并对更新的所述字符序列进行判断所述预设校验算法是否通过检测的步骤,直至更新的所述字符序列通过所述预设校验算法检测;确定识别出的所述字符序列为所述目标***,包括:将通过所述预设校验算法检测的字符序列确定为所述目标***。
- 一种识别***的装置,其特征在于,所述装置包括:格式获取模块,用于获取***序列的字符位的分布格式信息,其中,所述分布格式信息包括所述***序列的字符位间距信息;识别模块,用于通过预先训练的神经网络模型识别目标图像中的字符序列,并获取识别出的所述字符序列的字符位间距信息;判断模块,用于判断识别出的所述字符序列中的所述字符位间距信息与获取的所述分布格式信息中的所述字符位间距信息是否一致;确定模块,用于当判断字符序列中的所述字符位间距信息与所述分布格式信息中的所述字符位间距信息一致时,确定识别出的所述字符序列为目标***。
- 一种非易失性计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时,促使所述处理器实现权利要求1-12中任一项所述方法的步骤。
- 一种电子设备,其特征在于,包括:存储器,其上存储有计算机程序;处理器,用于执行所述存储器中的所述计算机程序,以实现权利要求1-12中任一项所述方法的步骤。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US17/473,897 US20230215201A1 (en) | 2019-03-14 | 2019-11-26 | Identify card number |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910195326.7A CN110197179B (zh) | 2019-03-14 | 2019-03-14 | 识别***的方法和装置、存储介质及电子设备 |
CN201910195326.7 | 2019-03-14 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020181834A1 true WO2020181834A1 (zh) | 2020-09-17 |
Family
ID=67751747
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/121053 WO2020181834A1 (zh) | 2019-03-14 | 2019-11-26 | 识别*** |
Country Status (3)
Country | Link |
---|---|
US (1) | US20230215201A1 (zh) |
CN (1) | CN110197179B (zh) |
WO (1) | WO2020181834A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112733858A (zh) * | 2021-01-08 | 2021-04-30 | 北京匠数科技有限公司 | 基于字符区域检测的图像文字快速识别方法及装置 |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110197179B (zh) * | 2019-03-14 | 2020-11-10 | 北京三快在线科技有限公司 | 识别***的方法和装置、存储介质及电子设备 |
CN110796146A (zh) * | 2019-10-11 | 2020-02-14 | 上海上湖信息技术有限公司 | 一种银行卡***识别方法、模型训练方法及装置 |
CN112488108A (zh) * | 2020-12-11 | 2021-03-12 | 广州小鹏自动驾驶科技有限公司 | 一种车位号识别方法、装置、电子设备及存储介质 |
CN114610681A (zh) * | 2022-03-16 | 2022-06-10 | 阿里巴巴(中国)有限公司 | 信息录入方法以及装置 |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150347860A1 (en) * | 2014-05-30 | 2015-12-03 | Apple Inc. | Systems And Methods For Character Sequence Recognition With No Explicit Segmentation |
CN106156712A (zh) * | 2015-04-23 | 2016-11-23 | 信帧电子技术(北京)有限公司 | 一种基于自然场景下的身份证号码识别方法与装置 |
US20170068867A1 (en) * | 2015-09-08 | 2017-03-09 | Sk Planet Co., Ltd. | System and method for recognizing credit card number and expiration date using terminal device |
CN107742120A (zh) * | 2017-10-17 | 2018-02-27 | 北京小米移动软件有限公司 | 银行卡***的识别方法及装置 |
CN108764230A (zh) * | 2018-05-30 | 2018-11-06 | 上海建桥学院 | 一种基于卷积神经网络的银行***自动识别方法 |
CN109460767A (zh) * | 2018-10-23 | 2019-03-12 | 福州大学 | 基于规则的凸印银行卡***分割与识别方法 |
CN110197179A (zh) * | 2019-03-14 | 2019-09-03 | 北京三快在线科技有限公司 | 识别***的方法和装置、存储介质及电子设备 |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4746743B2 (ja) * | 2000-12-22 | 2011-08-10 | Necインフロンティア株式会社 | 磁気カード |
CN202523078U (zh) * | 2012-03-30 | 2012-11-07 | 中南大学 | 一种基于钢铁板坯编码图像的板坯自动识别与跟踪*** |
US10346797B2 (en) * | 2016-09-26 | 2019-07-09 | Cybernet Systems, Inc. | Path and load localization and operations supporting automated warehousing using robotic forklifts or other material handling vehicles |
CN106991422B (zh) * | 2017-05-02 | 2020-03-27 | 北京京东金融科技控股有限公司 | 字符切割方法、装置及计算机可读存储介质和电子设备 |
CN108304761A (zh) * | 2017-09-25 | 2018-07-20 | 腾讯科技(深圳)有限公司 | 文本检测方法、装置、存储介质和计算机设备 |
CN111144399B (zh) * | 2018-11-06 | 2024-03-05 | 富士通株式会社 | 处理图像的装置和方法 |
US11138423B2 (en) * | 2019-07-29 | 2021-10-05 | Intuit Inc. | Region proposal networks for automated bounding box detection and text segmentation |
-
2019
- 2019-03-14 CN CN201910195326.7A patent/CN110197179B/zh active Active
- 2019-11-26 US US17/473,897 patent/US20230215201A1/en active Pending
- 2019-11-26 WO PCT/CN2019/121053 patent/WO2020181834A1/zh active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150347860A1 (en) * | 2014-05-30 | 2015-12-03 | Apple Inc. | Systems And Methods For Character Sequence Recognition With No Explicit Segmentation |
CN106156712A (zh) * | 2015-04-23 | 2016-11-23 | 信帧电子技术(北京)有限公司 | 一种基于自然场景下的身份证号码识别方法与装置 |
US20170068867A1 (en) * | 2015-09-08 | 2017-03-09 | Sk Planet Co., Ltd. | System and method for recognizing credit card number and expiration date using terminal device |
CN107742120A (zh) * | 2017-10-17 | 2018-02-27 | 北京小米移动软件有限公司 | 银行卡***的识别方法及装置 |
CN108764230A (zh) * | 2018-05-30 | 2018-11-06 | 上海建桥学院 | 一种基于卷积神经网络的银行***自动识别方法 |
CN109460767A (zh) * | 2018-10-23 | 2019-03-12 | 福州大学 | 基于规则的凸印银行卡***分割与识别方法 |
CN110197179A (zh) * | 2019-03-14 | 2019-09-03 | 北京三快在线科技有限公司 | 识别***的方法和装置、存储介质及电子设备 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112733858A (zh) * | 2021-01-08 | 2021-04-30 | 北京匠数科技有限公司 | 基于字符区域检测的图像文字快速识别方法及装置 |
Also Published As
Publication number | Publication date |
---|---|
CN110197179A (zh) | 2019-09-03 |
US20230215201A1 (en) | 2023-07-06 |
CN110197179B (zh) | 2020-11-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020181834A1 (zh) | 识别*** | |
CN107785021B (zh) | 语音输入方法、装置、计算机设备和介质 | |
CN110569341B (zh) | 配置聊天机器人的方法、装置、计算机设备和存储介质 | |
WO2018166116A1 (zh) | 车损识别方法、电子装置及计算机可读存储介质 | |
KR101199747B1 (ko) | 단어 인식 방법 및 단어 인식용 프로그램의 기록매체 및 정보 처리 장치 | |
CN112052781A (zh) | 特征提取模型训练方法、人脸识别方法、装置、设备及介质 | |
CN111615702B (zh) | 一种从图像中提取结构化数据的方法、装置和设备 | |
JP6527410B2 (ja) | 文字認識装置、文字認識方法、及びプログラム | |
CN110807455A (zh) | 基于深度学习的票据检测方法、装置、设备及存储介质 | |
JP2018523188A (ja) | 抽出されたユーザ名と記憶されたユーザデータとの比較 | |
CN109766483B (zh) | 正则表达式生成方法、装置、计算机设备和存储介质 | |
CN111126098B (zh) | 证件图像采集方法、装置、设备及存储介质 | |
CN111191568A (zh) | 翻拍图像识别方法、装置、设备及介质 | |
US20220130160A1 (en) | Object recognition method and apparatus, and electronic device and storage medium | |
CN112396047B (zh) | 训练样本生成方法、装置、计算机设备和存储介质 | |
CN111401322A (zh) | 进出站识别方法、装置、终端及存储介质 | |
WO2021151319A1 (zh) | 卡片边框检测方法、装置、设备及可读存储介质 | |
CN111553241B (zh) | 掌纹的误匹配点剔除方法、装置、设备及存储介质 | |
CN114429636B (zh) | 图像扫描识别方法、装置及电子设备 | |
CN111858977A (zh) | 票据信息采集方法、装置、计算机设备和存储介质 | |
CN111178310A (zh) | 手掌特征识别方法、装置、计算机设备和存储介质 | |
CN111144407A (zh) | 一种目标检测方法、***、装置及可读存储介质 | |
CN112163110A (zh) | 图像分类方法、装置、电子设备和计算机可读存储介质 | |
CN110147785A (zh) | 图像识别方法、相关装置和设备 | |
CN114049686A (zh) | 签名识别模型训练方法、装置及电子设备 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19919115 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19919115 Country of ref document: EP Kind code of ref document: A1 |