Verification code recognition method and device, computer-readable storage medium, and electronic device

By determining the character area and position in character verification code recognition, and generating prompt images for recognition, the problems of high computer performance and low generalization ability in the prior art are solved, and efficient and accurate verification code recognition is achieved.

CN114299501BActive Publication Date: 2025-09-02PATSNAP LIMITED
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111610758.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-27
Publication Date
2025-09-02
Estimated Expiration
2041-12-27

AI Technical Summary

Technical Problem

In the prior art, character verification code recognition has high requirements for computer performance and low generalization capabilities, resulting in a rapid decrease in the accuracy of deep learning models as the verification code changes.

Method used

By determining the character area and position based on the image to be identified and the background image, generating a prompt image, and using the verification code prompt information to perform verification code recognition, reducing the calculation amount and improving generalization ability.

Benefits of technology

It improves the efficiency and accuracy of verification code recognition, reduces the requirements for computer performance, and enhances the generalization ability of recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114299501B_ABST
    Figure CN114299501B_ABST
Patent Text Reader

Abstract

The present application relates to the field of data processing technology, and specifically to a verification code recognition method and device, as well as a computer-readable storage medium and an electronic device, which solves the problem that the recognition of character-type verification codes requires high computer performance and has low generalization ability. The verification code recognition method first determines the character area and character position of each of the M characters to be recognized in the image to be recognized based on the image to be recognized and the background image corresponding to the image to be recognized, and then generates N prompt images based on the verification code prompt information corresponding to the image to be recognized. Finally, based on the character area, character position and N prompt images of each of the M characters to be recognized, the verification code recognition result of the image to be recognized is determined. The amount of calculation is small, which improves the efficiency of verification code recognition. In addition, compared with the current deep learning method, the verification code recognition method of the present application is more targeted and improves the generalization ability and accuracy of verification code recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a verification code recognition method and device, as well as a computer-readable storage medium and an electronic device. Background Art

[0002] CAPTCHA is a type of Turing test (Completely Automated Public Turing Test to Tell Computers and Humans Apart, or CAPTCHA). In a CAPTCHA, a server or computer automatically generates a question and presents it to the user, who must answer it to pass the test. Generally, machine-generated questions are only human-solvable, preventing malicious user behavior.

[0003] Captchas come in a variety of forms, including character recognition (Chinese and English), slider puzzles, word selection, and scene recognition. However, character-based captchas remain the most widely used. Currently, deep learning models can be used to recognize character-based captchas. However, these models place high demands on computer configurations, and character-based captchas often change and update quickly. Deep learning models have low generalization capabilities, and the accuracy of trained deep learning models decreases rapidly as captchas change, rendering them unusable. Summary of the Invention

[0004] In view of this, the embodiments of the present application provide a verification code recognition method and verification code recognition device, as well as a computer-readable storage medium and an electronic device, which solve the problem that recognizing character-type verification codes requires high computer performance and has low generalization ability.

[0005] In a first aspect, an embodiment of the present application provides a verification code recognition method, comprising: determining the character areas of the M characters to be recognized and the character positions of the M characters to be recognized in the image to be recognized based on the image to be recognized including M characters to be recognized and the background image corresponding to the image to be recognized; generating N prompt images based on the verification code prompt information corresponding to the image to be recognized, wherein each prompt image includes a target verification character; determining the verification code recognition result of the image to be recognized based on the character areas of the M characters to be recognized, the character positions of the M characters to be recognized and the N prompt images.

[0006] In combination with the first aspect of the present application, in some embodiments, based on an image to be recognized including M characters to be recognized and a background image corresponding to the image to be recognized, character areas of each of the M characters to be recognized in the image to be recognized and character positions of each of the M characters to be recognized are determined, including: determining a difference image based on the image to be recognized and the background image corresponding to the image to be recognized; and determining character areas of each of the M characters to be recognized in the image to be recognized and character positions of each of the M characters to be recognized based on the difference image.

[0007] In combination with the first aspect of the present application, in some embodiments, a difference image is determined based on the image to be identified and the background image corresponding to the image to be identified, including: performing a grayscale conversion operation on the image to be identified and the background image corresponding to the image to be identified to obtain a grayscale image to be identified corresponding to the image to be identified and a background grayscale image corresponding to the background image; performing an algorithmic subtraction operation on the grayscale image to be identified and the background grayscale image to determine the difference image.

[0008] In combination with the first aspect of the present application, in some embodiments, the character areas of M characters to be recognized and the character positions of M characters to be recognized in the image to be recognized are determined based on the difference image, including: using the connected domain algorithm to calculate the difference image, determining the outer frame coordinates of the M characters to be recognized and the center coordinates of the M characters to be recognized; determining the character areas of the M characters to be recognized based on the outer frame coordinates of the M characters to be recognized; and determining the character positions of the M characters to be recognized based on the center coordinates of the M characters to be recognized.

[0009] In combination with the first aspect of the present application, in some embodiments, N prompt images are generated based on the verification code prompt information corresponding to the image to be identified, including: determining P target verification characters based on the verification code prompt information corresponding to the image to be identified; generating N prompt images based on the P target verification characters, a preset font, and the character areas of the M characters to be identified, where N≥P.

[0010] In combination with the first aspect of the present application, in some embodiments, N prompt images are generated based on P target verification characters, a preset font, and the character areas of M characters to be recognized, including: determining the area of ​​the character area of ​​each of the M characters to be recognized based on the character area of ​​each of the M characters to be recognized; determining Q types of areas based on the area of ​​the character area of ​​each of the M characters to be recognized, where Q is a positive integer; generating Q prompt images corresponding to each of the P target verification characters based on the P target verification characters, the preset font, and the Q types of areas; determining N prompt images based on the Q prompt images corresponding to each of the P target verification characters, where N=P*Q.

[0011] In combination with the first aspect of the present application, in some embodiments, N prompt images include P groups of prompt images, each group of prompt images includes Q prompt images, and based on the character areas of the M characters to be recognized, the character positions of the M characters to be recognized and the N prompt images, the verification code recognition result of the image to be recognized is determined, including: for each prompt image in the Q prompt images included in each group of prompt images in the P groups of prompt images, based on the area of ​​the character areas of the M characters to be recognized, the character areas of the M1 characters to be recognized that have the same area as the prompt image; and calculating the similarity between the prompt image and the character areas of the M1 characters to be recognized, to determine the similarity corresponding to the M1 characters to be recognized; for each group of prompt images in the P groups of prompt images, based on the similarity corresponding to the M characters to be recognized, to determine the recognition result corresponding to each group of prompt images, wherein the recognition result corresponding to each group of prompt images is one character area in the character areas of the M characters to be recognized; and determining the verification code recognition result of the image to be recognized based on the recognition results corresponding to the P groups of prompt images, the verification code recognition result including the character areas of the P characters to be recognized in the character areas of the M characters to be recognized.

[0012] In combination with the first aspect of the present application, in some embodiments, the recognition priority of the P group prompt images is from high to low; wherein, the recognition results corresponding to each of the P group prompt images are integrated to determine the verification code recognition result of the image to be recognized, including: based on the recognition priority of the P group prompt images and the recognition results corresponding to each of the P group prompt images, determining the recognition order of the recognition results corresponding to each of the P group prompt images; based on the recognition results corresponding to each of the P group prompt images and the character positions of the M characters to be recognized, determining the recognition position coordinates corresponding to the recognition results corresponding to each of the P group prompt images in the image to be recognized; based on the recognition results corresponding to each of the P group prompt images, the recognition order of the recognition results corresponding to each of the P group prompt images, and the recognition position coordinates corresponding to the recognition results corresponding to each of the P group prompt images in the image to be recognized, determining the verification code recognition result of the image to be recognized, and the verification code recognition result includes the recognition order of each recognition position coordinate.

[0013] In combination with the first aspect of the present application, in some embodiments, after determining the verification code recognition result of the image to be recognized based on the recognition results corresponding to each of the P groups of prompt images, the recognition order of the recognition results corresponding to each of the P groups of prompt images, and the position coordinates of the recognition results corresponding to each of the P groups of prompt images, it also includes: based on the recognition order of each recognition position coordinate, clicking operations are performed on the positions corresponding to the recognition position coordinates of the image to be recognized in turn.

[0014] In combination with the first aspect of the present application, in some embodiments, after performing a click operation on the positions corresponding to the recognition position coordinates of the image to be recognized based on the recognition order of each recognition position coordinate, it also includes: receiving a verification result corresponding to the click operation; based on the verification result, determining whether the verification is passed; if the verification fails, performing a click operation on any position on the image to be recognized to refresh the image to be recognized.

[0015] In the second aspect, an embodiment of the present application provides a verification code recognition device, including: a determination module, configured to determine the character areas of the M characters to be recognized and the character positions of the M characters to be recognized in the image to be recognized based on the image to be recognized including the M characters to be recognized and the background image corresponding to the image to be recognized; a generation module, configured to generate N prompt images based on the verification code prompt information corresponding to the image to be recognized, wherein each prompt image contains a target verification character; and a recognition module, configured to determine the verification code recognition result of the image to be recognized based on the character areas of the M characters to be recognized, the character positions of the M characters to be recognized and the N prompt images.

[0016] In a third aspect, an embodiment of the present application provides a computer-readable storage medium storing instructions. When the instructions are executed by a processor of an electronic device, the electronic device can execute the verification code recognition method mentioned in the first aspect above.

[0017] In a fourth aspect, an embodiment of the present application provides an electronic device, which includes: a processor; a memory for storing computer-executable instructions; and a processor for executing computer-executable instructions to implement the verification code recognition method mentioned in the first aspect above.

[0018] The embodiment of the present application provides a verification code recognition method, which first determines the character areas and character positions of the M characters to be recognized in the image to be recognized based on the image to be recognized including M characters to be recognized and the background image corresponding to the image to be recognized, then generates N prompt images based on the verification code prompt information corresponding to the image to be recognized, and finally determines the verification code recognition result of the image to be recognized based on the character areas, character positions and N prompt images of the M characters to be recognized. The computational complexity is small, which improves the efficiency of verification code recognition. In addition, the verification code recognition method of the present application performs verification code recognition based on the image to be recognized, the background image and the verification code prompt information. Compared with the current deep learning method, it is more targeted and improves the generalization ability and accuracy of verification code recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 The figure shows an application scenario diagram of the verification code recognition method provided by an embodiment of the present application.

[0020] Figure 2 FIG2 is a flow chart of a verification code recognition method provided in an embodiment of the present application.

[0021] Figure 2a Shown is an image to be identified provided by an embodiment of the present application.

[0022] Figure 2b Shown is a background image corresponding to the image to be identified provided by an embodiment of the present application.

[0023] Figure 3 FIG2 is a flow chart of a verification code recognition method provided in another embodiment of the present application.

[0024] Figure 4 FIG2 is a flow chart of a verification code recognition method provided in another embodiment of the present application.

[0025] Figure 4a Shown is a difference image obtained by algorithm subtraction provided by an embodiment of the present application.

[0026] Figure 4b Shown is a difference image after opening and closing operations provided by an embodiment of the present application.

[0027] Figure 4c Shown is a difference image after binarization processing provided by an embodiment of the present application.

[0028] Figure 5 FIG2 is a flow chart of a verification code recognition method provided in another embodiment of the present application.

[0029] Figure 5a Shown is a difference image after determining the character area provided by an embodiment of the present application.

[0030] Figure 6 FIG2 is a flow chart of a verification code recognition method provided in another embodiment of the present application.

[0031] Figure 6a Shown is a prompt image provided by an embodiment of the present application.

[0032] Figure 6b Shown is another prompt image provided by an embodiment of the present application.

[0033] Figure 6c Shown is another prompt image provided by an embodiment of the present application.

[0034] Figure 7 FIG2 is a flow chart of a verification code recognition method provided in another embodiment of the present application.

[0035] Figure 8FIG2 is a flow chart of a verification code recognition method provided in another embodiment of the present application.

[0036] Figure 9 FIG2 is a flow chart of a verification code recognition method provided in another embodiment of the present application.

[0037] Figure 10 FIG2 is a flow chart of a verification code recognition method provided in another embodiment of the present application.

[0038] Figure 11 FIG2 is a flow chart of a verification code recognition method provided in another embodiment of the present application.

[0039] Figure 12 FIG2 is a schematic diagram of the structure of a verification code recognition device provided in one embodiment of the present application.

[0040] Figure 13 Shown is a structural diagram of a verification code recognition device provided in another embodiment of the present application.

[0041] Figure 14 Shown is a structural diagram of a verification code recognition device provided in another embodiment of the present application.

[0042] Figure 15 Shown is a structural diagram of a verification code recognition device provided in another embodiment of the present application.

[0043] Figure 16 Shown is a structural diagram of a verification code recognition device provided in another embodiment of the present application.

[0044] Figure 17 Shown is a structural diagram of a verification code recognition device provided in another embodiment of the present application.

[0045] Figure 18 Shown is a structural diagram of a verification code recognition device provided in another embodiment of the present application.

[0046] Figure 19 Shown is a structural diagram of a verification code recognition device provided in another embodiment of the present application.

[0047] Figure 20 Shown is a structural diagram of a verification code recognition device provided in another embodiment of the present application.

[0048] Figure 21 Shown is a structural diagram of a verification code recognition device provided in another embodiment of the present application.

[0049] Figure 22 Shown is a structural schematic diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0050] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.

[0051] Example scenarios

[0052] Figure 1 The figure shows a schematic diagram of an application scenario of a verification code recognition method provided by an embodiment of the present application. Figure 1 The shown scenario includes a server 110 and a client terminal 120 communicatively connected to the server 110. Specifically, the client terminal 120 is configured to determine, based on a to-be-recognized image including M to-be-recognized characters and a background image corresponding to the to-be-recognized image, the character regions and character positions of each of the M to-be-recognized characters in the to-be-recognized image; generate N prompt images based on the verification code prompt information corresponding to the to-be-recognized image, where each prompt image includes a target verification character; and determine the verification code recognition result of the to-be-recognized image based on the character regions of each of the M to-be-recognized characters, the character positions of each of the M to-be-recognized characters, and the N prompt images. The server 110 is configured to provide the to-be-recognized image including M to-be-recognized characters, the background image corresponding to the to-be-recognized image, and the verification code prompt information corresponding to the to-be-recognized image, so that the client terminal

[120] can perform the above operations.

[0053] Exemplary Methods

[0054] Figure 2 The figure shows a flowchart of a verification code recognition method provided by an embodiment of the present application. As Figure 2 shown, the verification code recognition method includes the following steps.

[0055] Step 210, based on a to-be-recognized image including M to-be-recognized characters and a background image corresponding to the to-be-recognized image, determine the character regions and character positions of each of the M to-be-recognized characters in the to-be-recognized image.

[0056] Specifically, Figure 2a The figure shows a to-be-recognized image provided by an embodiment of the present application. As Figure 2a shown, the characters "国", "洼", "阳", "兰" in the figure are to-be-recognized characters. The to-be-recognized characters can be Chinese characters, English characters, or other symbols. For example, "%", "#", etc. The present application does not make specific limitations on the types of to-be-recognized characters. M is a positive integer.

[0057] Specifically, Figure 2bThe figure shows a background image corresponding to an image to be recognized provided by an embodiment of the present application. Figure 2a The difference from Figure 2b is the M characters to be recognized. Therefore, based on Figure 2a and Figure 2b the character regions and character positions of each of the M characters to be recognized in the image to be recognized can be obtained.

[0058] In practical applications, the image to be recognized and the background image corresponding to the image to be recognized can be color images.

[0059] Step 220: Generate N prompt images based on the verification code prompt information corresponding to the image to be recognized.

[0060] Specifically, the verification code prompt information corresponding to the image to be recognized can be a piece of prompt text. Each prompt image contains a target verification character. The target verification character is the character that needs to be recognized. For example, the verification code prompt information can be: Please click on "Wa", "Yang", "Lan" in sequence. The target verification characters are "Wa", "Yang", "Lan".

[0061] Exemplarily, N can be less than M. For example, M is equal to 4, the 4 characters to be recognized are "Wa", "Yang", "Lan", "Guo" respectively, the areas of the character regions of each of the 4 characters to be recognized are the same, and the verification code prompt information is: Please click on "Wa", "Yang", "Lan" in sequence. Therefore, only 3 prompt images need to be generated, that is, N is equal to 3.

[0062] Exemplarily, N can be equal to M. For example, M is equal to 4, the 4 characters to be recognized are "Wa", "Yang", "Lan", "Guo" respectively, the areas of the character regions of each of the 4 characters to be recognized are the same, and the verification code prompt information is: Please click on "Wa", "Yang", "Lan", "Guo" in sequence. Therefore, 4 prompt images need to be generated, that is, N is equal to 4.

[0063] Exemplarily, N can be greater than M. For example, M is equal to 4, the 4 characters to be recognized are "Wa", "Yang", "Lan", "Guo" respectively, there are 2 sizes for the areas of the character regions of each of the 4 characters to be recognized, which are the first area and the second area respectively, and the verification code prompt information is: Please click on "Wa", "Yang", "Lan", "Guo" in sequence. In order to facilitate the comparison between the character regions of each of the M characters to be recognized and the N prompt images, the area of the prompt image can be set to be the same as the character region of the character to be recognized. Therefore, 4 prompt images with the same size as the first area and 4 prompt images with the same size as the second area can be generated, that is, N is equal to 8.

[0064] Step 230 : determining a verification code recognition result of the image to be recognized based on the character areas of the M characters to be recognized, the character positions of the M characters to be recognized, and the N prompt images.

[0065] Specifically, the N prompt images may be compared with each character region in the image to be recognized, thereby determining the verification code recognition result of the image to be recognized.

[0066] The embodiment of the present application provides a verification code recognition method, which first determines the character areas and character positions of the M characters to be recognized in the image to be recognized based on the image to be recognized including M characters to be recognized and the background image corresponding to the image to be recognized, then generates N prompt images based on the verification code prompt information corresponding to the image to be recognized, and finally determines the verification code recognition result of the image to be recognized based on the character areas, character positions and N prompt images of the M characters to be recognized. The computational complexity is small, which improves the efficiency of verification code recognition. In addition, the verification code recognition method of the present application performs verification code recognition based on the image to be recognized, the background image and the verification code prompt information. Compared with the current deep learning method, it is more targeted and improves the generalization ability and accuracy of verification code recognition.

[0067] Figure 3 FIG. 1 is a flow chart of a verification code recognition method provided by another embodiment of the present application. Figure 2 Based on the embodiment shown Figure 3 The embodiment shown is described below in detail. Figure 3 The embodiment shown and Figure 2 The differences and similarities between the illustrated embodiments are not described in detail.

[0068] like Figure 3 As shown, in an embodiment of the present application, based on an image to be recognized including M characters to be recognized and a background image corresponding to the image to be recognized, the steps of determining the character areas of the M characters to be recognized and the character positions of the M characters to be recognized in the image to be recognized include the following steps.

[0069] Step 310 : Determine a difference image based on the image to be recognized and a background image corresponding to the image to be recognized.

[0070] In practical applications, the image to be recognized is composed of a background image and M characters to be recognized. Therefore, by calculating the difference between the image to be recognized and the background image, a difference image can be obtained. The difference image can be an image containing M characters to be recognized on a monochrome background.

[0071] Step 320 : determining the character regions and character positions of the M characters to be recognized in the image to be recognized based on the difference image.

[0072] Specifically, since the difference image can be an image containing M characters to be recognized with a monochrome background, without the interference of complex background images, the character areas and character positions of the M characters to be recognized in the image to be recognized can be obtained by methods such as connected domain calculation.

[0073] By first determining the difference image between the image to be recognized and the background image, and then determining the character areas and character positions of the M characters to be recognized in the image to be recognized based on the difference image, the calculation is simple and efficient.

[0074] Figure 4 FIG. 1 is a flow chart of a verification code recognition method provided by another embodiment of the present application. Figure 3 Based on the embodiment shown Figure 4 The embodiment shown is described below in detail. Figure 4 The embodiment shown and Figure 3 The differences and similarities between the illustrated embodiments are not described in detail.

[0075] like Figure 4 As shown, in the embodiment of the present application, the step of determining the difference image based on the image to be identified and the background image corresponding to the image to be identified includes the following steps.

[0076] Step 410 , performing a grayscale conversion operation on the image to be recognized and the background image corresponding to the image to be recognized, to obtain a grayscale image to be recognized corresponding to the image to be recognized and a background grayscale image corresponding to the background image.

[0077] Specifically, since the image to be recognized and the background image corresponding to the image to be recognized may be color images, the color image may be subjected to a grayscale conversion operation to be converted into a grayscale image.

[0078] Step 420 : performing an algorithmic subtraction operation on the grayscale image to be identified and the background grayscale image to determine a difference image.

[0079] Specifically, the algorithmic subtraction operation is performed on the grayscale image to be identified and the background grayscale image, and the background grayscale image may be subtracted from the grayscale image to be identified, thereby obtaining a difference image. Figure 4a Shown is a difference image obtained by algorithm subtraction provided by an embodiment of the present application.

[0080] By performing grayscale conversion operations on the image to be identified and the background image corresponding to the image to be identified, a grayscale image to be identified corresponding to the image to be identified and a background grayscale image corresponding to the background image are obtained, and an algorithmic subtraction operation is performed on the grayscale image to be identified and the background grayscale image to determine the difference image, which further reduces the amount of calculation and improves the efficiency of verification code recognition.

[0081] In one embodiment of the present application, an opening operation and a closing operation may be performed on the difference image to remove point noise in the difference image and to remove burrs on the edge of the character to be recognized. Figure 4b Shown is a difference image after opening and closing operations provided by an embodiment of the present application.

[0082] In one embodiment of the present application, the difference image may be binarized to convert the difference image into an image consisting of only black and white colors, thereby providing a data basis for subsequent calculations and reducing the amount of subsequent calculations. Figure 4c Shown is a difference image after binarization processing provided by an embodiment of the present application.

[0083] Figure 5 FIG. 1 is a flow chart of a verification code recognition method provided by another embodiment of the present application. Figure 3 Based on the embodiment shown Figure 5 The embodiment shown is described below in detail. Figure 5 The embodiment shown and Figure 3 The differences and similarities between the illustrated embodiments are not described in detail.

[0084] like Figure 5 As shown, in an embodiment of the present application, the step of determining the character areas of M characters to be recognized and the character positions of M characters to be recognized in the image to be recognized based on the difference image includes the following steps.

[0085] Step 510 : Calculate the difference image using the connected component algorithm to determine the outer frame coordinates of the M characters to be recognized and the center coordinates of the M characters to be recognized.

[0086] Specifically, the connected component algorithm is used to calculate the difference image, which yields the coordinates of the bounding box of each character to be recognized and the center coordinates of each of the M characters to be recognized. Both the bounding box coordinates and the center coordinates are in the image coordinate system of the difference image, meaning the vertex coordinates of the top left corner of the difference image are (0, 0).

[0087] Step 520 : Determine the character areas of the M characters to be recognized based on the outer frame coordinates of the M characters to be recognized.

[0088] Figure 5a The figure shows a difference image after determining the character area provided by one embodiment of the present application. The character area of ​​the character to be recognized is the area surrounded by the outer frame. The character area of ​​the character to be recognized can include coordinate information of the character area of ​​the character to be recognized and area information of the character area of ​​the character to be recognized.

[0089] Step 530 : Determine the character position of each of the M characters to be recognized based on the center coordinates of each of the M characters to be recognized.

[0090] Specifically, the character position of the character to be recognized can be represented by the center coordinates, or the coordinates of other positions of the character area of ​​the character to be recognized can be calculated based on the center coordinates and then represented by the coordinates of other positions of the character area.

[0091] By using the connected domain algorithm to calculate the difference image, the outer frame coordinates of M characters to be recognized and the center coordinates of M characters to be recognized are determined. Based on the outer frame coordinates of M characters to be recognized, the character area of ​​M characters to be recognized is determined. Based on the center coordinates of M characters to be recognized, the character position of M characters to be recognized is determined. The method has small calculation amount and high efficiency, and provides a data basis for subsequent verification code recognition.

[0092] Figure 6 FIG. 1 is a flow chart of a verification code recognition method provided by another embodiment of the present application. Figure 2 Based on the embodiment shown Figure 6 The embodiment shown is described below in detail. Figure 6 The embodiment shown and Figure 2 The differences and similarities between the illustrated embodiments are not described in detail.

[0093] like Figure 6 As shown, in the embodiment of the present application, the step of generating N prompt images based on the verification code prompt information corresponding to the image to be identified includes the following steps.

[0094] Step 610: Determine P target verification characters based on the verification code prompt information corresponding to the image to be recognized.

[0095] For example, the verification code prompt message may be: Please click "wa", "yang", and "lan" in sequence. The determined P target verification characters are "wa", "yang", and "lan". N and P are both positive integers, and N≥P.

[0096] Step 620 : Generate N prompt images based on the P target verification characters, the preset font, and the character areas of the M characters to be recognized.

[0097] In practical applications, the characters to be recognized in the image to be recognized are generally bold. Therefore, the preset font can be set to bold to facilitate the subsequent comparison of the prompt image with the characters to be recognized. The preset font can also be Kaiti, Songti, etc. The preset font can be selected according to actual needs and is not specifically limited in this application. Figure 6a Shown is a prompt image provided by an embodiment of the present application. Figure 6b Shown is another prompt image provided by an embodiment of the present application. Figure 6c Shown is another prompt image provided by an embodiment of the present application.

[0098] Figure 7 FIG. 1 is a flow chart of a verification code recognition method provided by another embodiment of the present application. Figure 2 Based on the embodiment shown Figure 7 The embodiment shown is described below in detail. Figure 7 The embodiment shown and Figure 2 The differences and similarities between the illustrated embodiments are not described in detail.

[0099] like Figure 7 As shown, in an embodiment of the present application, the step of generating N prompt images based on P target verification characters, a preset font, and the character areas of M characters to be recognized includes the following steps.

[0100] Step 710 : determining the area of ​​each character region of the M characters to be recognized based on each character region of the M characters to be recognized.

[0101] Step 720: Determine Q areas based on the areas of the character regions of the M characters to be recognized.

[0102] Specifically, Q is a positive integer. The areas of the character regions of the M characters to be recognized can be the same or different. If the areas of the character regions of the M characters to be recognized are the same, Q is equal to 1. If the character region of one of the M characters to be recognized is different from the others, Q is equal to 2. If the character regions of two of the M characters to be recognized are different from the others, Q is equal to 3, and so on. That is, the areas of the character regions of the M characters to be recognized have Q sizes.

[0103] Step 730 : Based on the P target verification characters, the preset font, and the Q areas, Q prompt images corresponding to the P target verification characters are generated.

[0104] Specifically, each target verification character corresponds to Q prompt images. The areas of the Q prompt images are different, and the areas of the Q prompt images are the same as the areas of the character regions of the M characters to be recognized.

[0105] Step 740 : Determine N prompt images based on the Q prompt images corresponding to the P target verification characters.

[0106] Specifically, N=P*Q.

[0107] Exemplarily, M can be equal to 4, and the 4 characters to be recognized are "洼", "阳", "兰", and "国" respectively. Q can be equal to 2, that is, the areas of the character regions of the 4 characters to be recognized have 2 sizes. For example, the 2 sizes are 1 square centimeter and 2 square centimeters respectively. P can be equal to 3, and the verification code prompt information is: Please click on "洼", "阳", and "兰" in sequence. 3 prompt images with an area of 1 square centimeter and 3 prompt images with an area of 2 square centimeters can be generated, that is, N is equal to 6. The image contents of the 3 prompt images with an area of 1 square centimeter are "洼", "阳", and "兰" respectively. The image contents of the 3 prompt images with an area of 2 square centimeters are "洼", "阳", and "兰" respectively. That is, N = P * Q.

[0108] Specifically, parameters such as the height, width, and diagonal length of the character regions of the M characters to be recognized can also be used to replace the areas of the character regions of the M characters to be recognized.

[0109] By referring to the areas of the character regions of the M characters to be recognized, Q prompt images with the same areas as the character regions of the M characters to be recognized are generated, which is convenient for subsequent comparison between the character regions of the characters to be recognized and the prompt images.

[0110] Figure 8 The following shows a schematic flowchart of the verification code recognition method provided by another embodiment of the present application. On the basis of Figure 2 the shown embodiment, an embodiment Figure 8 is extended as follows. The following focuses on Figure 8 the differences between the shown embodiment and Figure 2 the shown embodiment, and the same parts will not be described again.

[0111] As Figure 8 shown, in the embodiment of the present application, the steps of determining the verification code recognition result of the image to be recognized based on the character regions of the M characters to be recognized, the character positions of the M characters to be recognized, and the N prompt images include the following steps.

[0112] Step 810, for each of the Q prompt images included in each group of the P groups of prompt images, based on the areas of the character regions of the M characters to be recognized, determine M1 character regions of the M characters to be recognized that have the same area as the prompt image; and calculate the similarity between the prompt image and each of the M1 character regions of the M characters to be recognized, and determine the similarity corresponding to each of the M1 characters to be recognized.

[0113] Exemplarily, Q can be equal to 2, M can be equal to 4, and M1 can be equal to 2. For each prompt image, M1 similarities can be calculated, that is, for the 2 prompt images, 4 similarities can be calculated.

[0114] Exemplarily, Q can be equal to 1. For Figure 6a the indicated prompt image, compare it with Figure 5a the character regions in the indicated difference image, and the recognition result corresponding to Figure 6a the indicated prompt image can be obtained as Figure 5a the similarity of the character region where the character "洼" in Figure 6a the indicated prompt image, compare it with Figure 5a the character regions in the indicated difference image, and the recognition result corresponding to Figure 6a the indicated prompt image can be obtained as Figure 5a the similarity of the character region where the character "阳" in Figure 6a the indicated prompt image, compare it with Figure 5a the character regions in the indicated difference image, and the recognition result corresponding to Figure 6a the indicated prompt image can be obtained as Figure 5a the similarity of the character region where the character "兰" in Figure 6a the indicated prompt image, compare it with Figure 5a the character regions in the indicated difference image, and the recognition result corresponding to Figure 6a the indicated prompt image can be obtained as Figure 5a the similarity of the character region where the character "国" in

[0115] Step 820: For each group of prompt images in the P groups of prompt images, based on the similarities corresponding to each of the M characters to be recognized, determine the recognition result corresponding to each group of prompt images.

[0116] Specifically, the recognition result corresponding to each group of prompt images can be the character region corresponding to the similarity with the largest similarity value among the similarities corresponding to each of the M characters to be recognized in each group of prompt images. In practical applications, by sorting the similarities corresponding to each of the M characters to be recognized in each group of prompt images, the similarity with the largest similarity value among the similarities corresponding to each of the M characters to be recognized in each group of prompt images can be obtained.

[0117] Specifically, the recognition result corresponding to each group of prompt images is one of the character regions of the M characters to be recognized.

[0118] Exemplarily, for Figure 6a the indicated prompt image, compare it with Figure 5a the character regions in the indicated difference image, and the recognition result corresponding to Figure 6a the indicated prompt image can be obtained as Figure 5a the character region where the character "洼" in

[0119] Step 830: Based on the recognition results corresponding to each of the P groups of prompt images, determine the verification code recognition result of the image to be recognized.

[0120] Specifically, the verification code recognition result includes the character regions of the P characters to be recognized in the character regions of each of the M characters to be recognized.

[0121] By using the method of separate comparison to select the character regions of the P characters to be recognized that correspond one by one to the P groups of prompt images, the method is simple, reliable, and efficient.

[0122] Figure 9 The following shows a schematic flowchart of the verification code recognition method provided by another embodiment of the present application. On the basis of the Figure 7 shown embodiment, an embodiment Figure 9 is extended. The following focuses on describing Figure 9 the differences between the shown embodiment and Figure 7 the shown embodiment, and the same parts will not be elaborated.

[0123] As Figure 9 shown, in the embodiment of the present application, the step of determining the verification code recognition result of the image to be recognized based on the recognition results corresponding to each of the P groups of prompt images includes the following steps.

[0124] Step 910: Based on the recognition priorities of the P groups of prompt images and the recognition results corresponding to each of the P groups of prompt images, determine the recognition order of the recognition results corresponding to each of the P groups of prompt images.

[0125] Specifically, the recognition priorities of the P groups of prompt images are from high to low. Therefore, the recognition order priorities of the recognition results corresponding to each of the P groups of prompt images are from high to low. For example, Figure 6a 、 Figure 6b and Figure 6c the priorities of the shown prompt images are from high to low as the prompt image shown in Figure 6a , the prompt image shown in Figure 6b , and the prompt image shown in Figure 6c . Therefore, Figure 6a 、 Figure 6b and Figure 6c the recognition order of the recognition results corresponding to each of the shown prompt images is the character region where the character "洼" is located, the character region where the character "阳" is located, and the character region where the character "兰" is located in Figure 5a .

[0126] Step 920: Based on the recognition results corresponding to each of the P groups of prompt images and the character positions of each of the M characters to be recognized, determine the recognition position coordinates corresponding to the recognition results corresponding to each of the P groups of prompt images in the image to be recognized.

[0127] Specifically, each character to be recognized corresponds to a character position, and the recognition result corresponding to each group of prompt images is the character region of a character to be recognized. Therefore, according to the character position of the character to be recognized, the recognition position coordinates corresponding to the recognition result of each group of prompt images in the image to be recognized can be obtained.

[0128] Exemplarily, Figure 5a in the character to be recognized, the character "洼" corresponds to a character position, Figure 6a and the recognition result corresponding to the shown prompt image is Figure 5a the character region where the character "洼" in is located. Therefore, Figure 6a the recognition position coordinates corresponding to the recognition result of the shown prompt image in the image to be recognized are the coordinates of the character position corresponding to the character "洼" to be recognized in Figure 5a .

[0129] Step 930: Determine the verification code recognition result of the image to be recognized based on the recognition results corresponding to the P groups of prompt images, the recognition order of the recognition results corresponding to the P groups of prompt images, and the recognition position coordinates corresponding to the recognition results of the P groups of prompt images in the image to be recognized.

[0130] Specifically, the verification code recognition result includes the recognition order of each recognition position coordinate. That is, the verification code recognition result includes the character region corresponding to each prompt image, the recognition position coordinates of the character region, and the recognition order of the recognition position coordinates of the character region, thereby providing a data basis for subsequent clicking on the characters to be recognized in sequence.

[0131] Figure 10 The figure shows a schematic flowchart of a verification code recognition method provided by another embodiment of the present application. Based on the embodiment shown in Figure 9 an embodiment is extended, Figure 10 and the embodiment shown below is emphasized. Figure 10 The differences between the embodiment shown in and Figure 9 the embodiment shown in are described below, and the same parts will not be elaborated.

[0132] As Figure 10 shown, in the embodiment of the present application, after the step of determining the verification code recognition result of the image to be recognized based on the recognition results corresponding to the P groups of prompt images, the recognition order of the recognition results corresponding to the P groups of prompt images, and the position coordinates of the recognition results of the P groups of prompt images, the following steps are further included.

[0133] Step 1010: Perform click operations on the positions corresponding to the recognition position coordinates of the image to be recognized in sequence based on the recognition order of each recognition position coordinate.

[0134] Specifically, after determining the recognition order, you can click on the locations corresponding to the recognition position coordinates of the image to be recognized in sequence to verify whether the recognition result is correct. After clicking, if you jump to the next screen or the current screen displays "Verification Success", the recognition result is correct and the verification has passed. After clicking, if the current screen displays "Verification Failure" or remains unchanged on the current screen, the recognition result is incorrect and the verification has failed.

[0135] Figure 11 FIG. 1 is a flow chart of a verification code recognition method provided by another embodiment of the present application. Figure 10 Based on the embodiment shown Figure 11 The embodiment shown is described below in detail. Figure 11 The embodiment shown and Figure 10 The differences and similarities between the illustrated embodiments are not described in detail.

[0136] like Figure 11 As shown, in the embodiment of the present application, after the step of sequentially clicking the positions corresponding to the recognition position coordinates of the image to be recognized based on the recognition order of each recognition position coordinate, the following steps are also included.

[0137] Step 1110: Receive the verification result corresponding to the click operation.

[0138] Step 1120: Based on the verification result, determine whether the verification is passed.

[0139] Step 1130: If the verification fails, click anywhere on the image to be recognized to refresh the image to be recognized.

[0140] Specifically, after clicking on the image to be recognized, a verification result can be received. The verification result can be either passed or failed. If the verification fails, click anywhere on the image to be recognized to refresh the image to be recognized, and then re-execute steps 210 to 230, i.e., perform verification code recognition on the refreshed image to be recognized, to increase the probability of successful verification code recognition.

[0141] Combined with the above Figures 1 to 11 , describes the method embodiment of the present application in detail, and the following is combined with Figures 12 to 22 , the device embodiment of the present application is described in detail. It should be understood that the description of the method embodiment corresponds to the description of the device embodiment, so for parts not described in detail, reference can be made to the previous method embodiment.

[0142] Exemplary devices

[0143] Figure 12 FIG. 1 is a schematic diagram of the structure of a data processing device provided by an embodiment of the present application. Figure 9 As shown, the verification code recognition device 1200 of the embodiment of the present application includes a determination module 1210 , a generation module 1220 , and an identification module 1230 .

[0144] Specifically, the determination module 1210 is configured to determine the character areas and character positions of the M characters to be recognized in the image to be recognized based on the image to be recognized including the M characters to be recognized and the background image corresponding to the image to be recognized. The generation module 1220 is configured to generate N prompt images based on the verification code prompt information corresponding to the image to be recognized, wherein each prompt image contains the target verification character. The recognition module 1230 is configured to determine the verification code recognition result of the image to be recognized based on the character areas, character positions and N prompt images of the M characters to be recognized.

[0145] Figure 13 The figure shows a schematic diagram of the structure of a verification code recognition device provided by another embodiment of the present application. Figure 12 Based on the embodiment shown Figure 13 The embodiment shown is described below in detail. Figure 13 The embodiment shown and Figure 12 The differences and similarities between the illustrated embodiments are not described in detail.

[0146] like Figure 13 As shown, the determination module 1210 of the embodiment of the present application includes: a difference image determination unit 1211 and a character determination unit 1212.

[0147] Specifically, the difference image determining unit 1211 is configured to determine a difference image based on the image to be recognized and the background image corresponding to the image to be recognized. The character determining unit 1212 is configured to determine the character areas and character positions of the M characters to be recognized in the image to be recognized based on the difference image.

[0148] Figure 14 The figure shows a schematic diagram of the structure of a verification code recognition device provided by another embodiment of the present application. Figure 13 Based on the embodiment shown Figure 14 The embodiment shown is described below in detail. Figure 14 The embodiment shown and Figure 13 The differences and similarities between the illustrated embodiments are not described in detail.

[0149] like Figure 14 As shown, the difference image determination unit 1211 of the embodiment of the present application includes: a grayscale conversion subunit 1410 and an algorithm subtraction subunit 1420.

[0150] Specifically, the grayscale conversion subunit 1410 is configured to perform a grayscale conversion operation on the image to be identified and the background image corresponding to the image to be identified, thereby obtaining a grayscale image to be identified corresponding to the image to be identified and a background grayscale image corresponding to the background image. The algorithm subtraction subunit 1420 is configured to perform an algorithm subtraction operation on the grayscale image to be identified and the background grayscale image to determine a difference image.

[0151] Figure 15 The figure shows a schematic diagram of the structure of a verification code recognition device provided by another embodiment of the present application. Figure 13 Based on the embodiment shown Figure 15 The embodiment shown is described below in detail. Figure 15 The embodiment shown and Figure 13 The differences and similarities between the illustrated embodiments are not described in detail.

[0152] like Figure 15 As shown, the character determination unit 1212 of the embodiment of the present application includes: a connected domain calculation subunit 1510, a character area determination subunit 1520, and a character position determination subunit 1530.

[0153] Specifically, the connected domain calculation subunit 1510 is configured to calculate a difference image using a connected domain algorithm to determine the outer frame coordinates and center coordinates of each of the M characters to be recognized. The character region determination subunit 1520 is configured to determine the character region of each of the M characters to be recognized based on the outer frame coordinates of each of the M characters to be recognized. The character position determination subunit 1530 is configured to determine the character position of each of the M characters to be recognized based on the center coordinates of each of the M characters to be recognized.

[0154] Figure 16 The figure shows a schematic diagram of the structure of a verification code recognition device provided by another embodiment of the present application. Figure 12 Based on the embodiment shown Figure 16 The embodiment shown is described below in detail. Figure 16 The embodiment shown and Figure 12 The differences and similarities between the illustrated embodiments are not described in detail.

[0155] like Figure 16 As shown, the generation module 1220 of the embodiment of the present application includes: a target verification character determination unit 1221 and a prompt image generation unit 1222.

[0156] Specifically, the target verification character determination unit 1221 is configured to determine P target verification characters based on the verification code prompt information corresponding to the image to be recognized. The prompt image generation unit 1222 is configured to generate N prompt images based on the P target verification characters, a preset font, and the character areas of the M characters to be recognized, where N≥P.

[0157] Figure 17 The figure shows a schematic diagram of the structure of a verification code recognition device provided by another embodiment of the present application. Figure 16 Based on the embodiment shown Figure 17 The embodiment shown is described below in detail. Figure 17 The embodiment shown and Figure 16 The differences and similarities between the illustrated embodiments are not described in detail.

[0158] like Figure 17 As shown, the prompt image generation unit 1222 of the embodiment of the present application includes: a character region area determination subunit 1710 , an area type determination subunit 1720 , Q prompt image determination subunits 1730 and N prompt image determination subunits 1740 .

[0159] Specifically, the character area determination subunit 1710 is configured to determine the area of ​​each character area of ​​the M characters to be recognized based on their respective character areas. The area type determination subunit 1720 is configured to determine Q types of areas based on the areas of each character area of ​​the M characters to be recognized, where Q is a positive integer. The Q prompt image determination subunit 1730 is configured to generate Q prompt images corresponding to each of the P target verification characters based on P target verification characters, a preset font, and Q types of areas. The N prompt image determination subunit 1730 is configured to determine N prompt images based on the Q prompt images corresponding to each of the P target verification characters, where N = P*Q.

[0160] Figure 18 The figure shows a schematic diagram of the structure of a verification code recognition device provided by another embodiment of the present application. Figure 12 Based on the embodiment shown Figure 18 The embodiment shown is described below in detail. Figure 18 The embodiment shown and Figure 12 The differences and similarities between the illustrated embodiments are not described in detail.

[0161] like Figure 18 As shown, the recognition module 1230 of the embodiment of the present application includes: a similarity determination unit 1231, a recognition unit 1232 and an integration unit 1233.

[0162] Specifically, the N prompt images include P groups of prompt images, each group of prompt images including Q prompt images. The similarity determination unit 1231 is configured to, for each of the Q prompt images included in each group of prompt images in the P groups of prompt images, determine, based on the areas of the character areas of the M characters to be recognized, character areas of M1 characters to be recognized that have the same area as the prompt image; and calculate the similarity between the prompt image and the character areas of the M1 characters to be recognized, to determine the similarity corresponding to each of the M1 characters to be recognized. The recognition unit 1232 is configured to, for each group of prompt images in the P groups of prompt images, determine, based on the similarity corresponding to the M characters to be recognized, a recognition result corresponding to each group of prompt images, wherein the recognition result corresponding to each group of prompt images is one character area within the character areas of the M characters to be recognized. The integration unit 1233 is configured to integrate the recognition results corresponding to the P groups of prompt images to determine a verification code recognition result for the image to be recognized, where the verification code recognition result includes the character areas of the P characters to be recognized within the character areas of the M characters to be recognized.

[0163] Figure 19 The figure shows a schematic diagram of the structure of a verification code recognition device provided by another embodiment of the present application. Figure 18 Based on the embodiment shown Figure 19 The embodiment shown is described below in detail. Figure 19 The embodiment shown and Figure 18 The differences and similarities between the illustrated embodiments are not described in detail.

[0164] like Figure 19 As shown, the integration unit 1233 of the embodiment of the present application includes: an identification order determination subunit 1910, an identification position determination subunit 1920 and an identification subunit 1930.

[0165] Specifically, the recognition priority of the P group prompt images is from high to low. The recognition order determination subunit 1910 is configured to determine the recognition order of the recognition results corresponding to the P group prompt images based on the recognition priority of the P group prompt images and the recognition results corresponding to the P group prompt images. The recognition position determination subunit 1920 is configured to determine the recognition position coordinates corresponding to the recognition results corresponding to the P group prompt images in the image to be recognized based on the recognition results corresponding to the P group prompt images and the character positions of the M characters to be recognized. The recognition subunit 1930 is configured to determine the verification code recognition result of the image to be recognized based on the recognition results corresponding to the P group prompt images, the recognition order of the recognition results corresponding to the P group prompt images, and the recognition position coordinates corresponding to the recognition results corresponding to the P group prompt images in the image to be recognized. The verification code recognition result includes the recognition order of each recognition position coordinate.

[0166] Figure 20The figure shows a schematic diagram of the structure of a verification code recognition device provided by another embodiment of the present application. Figure 19 Based on the embodiment shown Figure 20 The embodiment shown is described below in detail. Figure 20 The embodiment shown and Figure 19 The differences and similarities between the illustrated embodiments are not described in detail.

[0167] like Figure 20 As shown, the verification code recognition device of the embodiment of the present application further includes: a click module 1240.

[0168] Specifically, the click module 1240 is configured to perform click operations on the positions corresponding to the recognition position coordinates of the image to be recognized in sequence based on the recognition order of each recognition position coordinate.

[0169] Figure 21 The figure shows a schematic diagram of the structure of a verification code recognition device provided by another embodiment of the present application. Figure 20 Based on the embodiment shown Figure 21 The embodiment shown is described below in detail. Figure 21 The embodiment shown and Figure 20 The differences and similarities between the illustrated embodiments are not described in detail.

[0170] like Figure 21 As shown, the verification code recognition device of the embodiment of the present application further includes: a receiving module 1250 , a judgment module 1260 and a refresh module 1270 .

[0171] Specifically, the receiving module 1250 is configured to receive a verification result corresponding to the click operation. The judging module 1260 is configured to determine whether the verification is successful based on the verification result. The refreshing module 1270 is configured to, if the verification fails, perform a click operation on any position on the image to be recognized to refresh the image to be recognized.

[0172] Exemplary electronic devices

[0173] Figure 22 The figure shows a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 22 As shown, the electronic device 2200 includes: one or more processors 2201 and a memory 2202; and computer program instructions stored in the memory 2202. When the computer program instructions are executed by the processor 2201, the processor 2201 executes the verification code recognition method as any of the above embodiments.

[0174] The processor 2201 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.

[0175] Memory 2202 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), a hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and processor 2201 may execute the program instructions to implement the steps of the verification code recognition method of each embodiment of the present application described above and / or other desired functions.

[0176] In one example, the electronic device 2200 may further include: an input device 2203 and an output device 2204, these components are connected via a bus system and / or other forms of connection mechanisms ( Figure 22 (not shown) interconnected.

[0177] In addition, the input device 2203 may also include, for example, a keyboard, a mouse, a microphone, etc.

[0178] The output device 2204 can output various information to the outside, and can include, for example, a display, a speaker, a printer, a communication network and its connected remote output device, etc.

[0179] Of course, to simplify, Figure 22 Only some of the components related to the present application in the electronic device 2200 are shown, and components such as a bus, an input device / output interface, etc. are omitted. In addition, the electronic device 2200 may further include any other appropriate components according to specific application conditions.

[0180] Exemplary computer-readable storage media

[0181] In addition to the above methods and devices, embodiments of the present application may also be computer program products, including computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the verification code recognition method of any of the above embodiments.

[0182] The computer program product may be written in any combination of one or more programming languages ​​to implement the program code for performing the operations of the embodiments of the present application, including object-oriented programming languages ​​such as Java, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0183] In addition, an embodiment of the present application may also be a computer-readable storage medium having computer program instructions stored thereon. When the computer program instructions are executed by a processor, the processor executes the steps of the verification code recognition method according to various embodiments of the present application described in the above “Exemplary Method” section of this specification.

[0184] Computer-readable storage media can take the form of any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0185] The basic principles of the present application have been described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, and effects mentioned in this application are merely illustrative and not restrictive, and it should not be assumed that these advantages, strengths, and effects are required of each embodiment of this application. In addition, the specific details disclosed above are merely illustrative and facilitating understanding, and are not restrictive. The above details do not limit this application to necessarily being implemented using the above specific details.

[0186] The block diagrams of the devices, devices, equipment, and systems involved in this application are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, devices, equipment, and systems can be connected, arranged, or configured in any manner. Words such as "include," "comprise," "have," and the like are open-ended words, meaning "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or" and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.

[0187] It should also be noted that in the apparatus, device, and method of the present application, each component or each step can be decomposed and / or recombined, and such decomposition and / or recombination should be regarded as equivalent solutions of the present application.

[0188] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present application. Therefore, the present application is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0189] The above description has been provided for the purpose of illustration and description. Furthermore, this description is not intended to limit the embodiments of the present application to the forms disclosed herein. Although a number of example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.

[0190] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.

Claims

1. A verification code recognition method, characterized in that: include: Determining, based on an image to be recognized including M characters to be recognized and a background image corresponding to the image to be recognized, character regions of the M characters to be recognized and character positions of the M characters to be recognized in the image to be recognized; Based on the verification code prompt information corresponding to the image to be recognized, generating N prompt images, wherein each prompt image includes a target verification character; determining a verification code recognition result of the image to be recognized based on the character areas of the respective M characters to be recognized, the character positions of the respective M characters to be recognized, and the N prompt images; The N prompt images include P groups of prompt images, each group of prompt images includes Q prompt images, and determining a verification code recognition result of the image to be recognized based on the character areas of the M characters to be recognized, the character positions of the M characters to be recognized, and the N prompt images, includes: For each of the Q prompt images included in each group of prompt images in the P groups of prompt images, determining, based on the areas of the character areas of the M characters to be recognized, respective character areas of M1 characters to be recognized having the same area as the prompt image; and calculating similarities between the prompt image and the character areas of the M1 characters to be recognized, to determine the similarities corresponding to the M1 characters to be recognized; For each group of prompt images in the P groups of prompt images, determining a recognition result corresponding to each group of prompt images based on the similarities corresponding to the M characters to be recognized, wherein the recognition result corresponding to each group of prompt images is a character region in each character region of the M characters to be recognized; The recognition results corresponding to the P groups of prompt images are combined to determine the verification code recognition result of the image to be recognized, and the verification code recognition result includes the character areas of the P characters to be recognized in the character areas of the M characters to be recognized.

2. The verification code recognition method according to claim 1, characterized in that: The determining, based on an image to be recognized including M characters to be recognized and a background image corresponding to the image to be recognized, character regions of the M characters to be recognized and character positions of the M characters to be recognized in the image to be recognized, includes: determining a difference image based on the image to be identified and a background image corresponding to the image to be identified; The character areas of the M characters to be recognized and the character positions of the M characters to be recognized in the image to be recognized are determined based on the difference image.

3. The verification code recognition method according to claim 2, characterized in that: The determining of a difference image based on the image to be recognized and a background image corresponding to the image to be recognized includes: Performing a grayscale conversion operation on the image to be recognized and a background image corresponding to the image to be recognized to obtain a grayscale image to be recognized corresponding to the image to be recognized and a background grayscale image corresponding to the background image; An algorithmic subtraction operation is performed on the grayscale image to be identified and the background grayscale image to determine the difference image.

4. The verification code recognition method according to claim 2, characterized in that: The determining, based on the difference image, the character regions of the M characters to be recognized and the character positions of the M characters to be recognized in the image to be recognized, includes: Calculating the difference image using a connected component algorithm to determine the outer frame coordinates of each of the M characters to be recognized and the center coordinates of each of the M characters to be recognized; Determining the character areas of the M characters to be recognized based on the outer frame coordinates of the M characters to be recognized; Based on the center coordinates of the M characters to be recognized, the character positions of the M characters to be recognized are determined.

5. The verification code recognition method according to claim 1, wherein: The generating N prompt images based on the verification code prompt information corresponding to the image to be identified includes: Determining P target verification characters based on the verification code prompt information corresponding to the image to be recognized; The N prompt images are generated based on the P target verification characters, the preset font, and the character areas of the M characters to be recognized, where N≥P.

6. The verification code recognition method according to claim 5, characterized in that: The generating of the N prompt images based on the P target verification characters, the preset font, and the character areas of the M characters to be recognized includes: Determining the area of ​​each character region of the M characters to be recognized based on the character regions of each of the M characters to be recognized; Determine Q areas based on the areas of the character regions of the M characters to be recognized, where Q is a positive integer; Based on the P target verification characters, the preset font, and the Q areas, generating Q prompt images corresponding to each of the P target verification characters; Based on the Q prompt images corresponding to the P target verification characters, N prompt images are determined, where N=P*Q.

7. The verification code recognition method according to claim 1, wherein: The recognition priorities of the P groups of prompt images are from high to low; wherein, the step of synthesizing the recognition results corresponding to the P groups of prompt images to determine the verification code recognition result of the image to be recognized includes: determining a recognition order of the recognition results corresponding to the P groups of prompt images based on the recognition priorities of the P groups of prompt images and the recognition results corresponding to the P groups of prompt images; Determine, based on the recognition results corresponding to the P groups of prompt images and the character positions of the M characters to be recognized, the recognition position coordinates corresponding to the recognition results corresponding to the P groups of prompt images in the image to be recognized; Based on the recognition results corresponding to each of the P groups of prompt images, the recognition order of the recognition results corresponding to each of the P groups of prompt images, and the recognition position coordinates corresponding to the recognition results corresponding to each of the P groups of prompt images in the image to be recognized, the verification code recognition result of the image to be recognized is determined, and the verification code recognition result includes the recognition order of each of the recognition position coordinates.

8. The verification code recognition method according to claim 7, characterized in that: After determining the verification code recognition result of the image to be recognized based on the recognition results corresponding to the P groups of prompt images, the recognition order of the recognition results corresponding to the P groups of prompt images, and the position coordinates of the recognition results corresponding to the P groups of prompt images, the method further includes: Based on the recognition order of each recognition position coordinate, click operations are sequentially performed on positions corresponding to the recognition position coordinates of the image to be recognized.

9. The verification code recognition method according to claim 8, characterized in that: After clicking the positions corresponding to the recognition position coordinates of the image to be recognized in sequence based on the recognition order of each recognition position coordinate, the method further includes: Receive a verification result corresponding to the click operation; Based on the verification result, determining whether the verification is passed; If the verification fails, the click operation is performed on any position on the image to be identified to refresh the image to be identified.

10. A verification code recognition device, characterized in that: include: a determination module configured to determine, based on an image to be recognized including M characters to be recognized and a background image corresponding to the image to be recognized, character regions of the M characters to be recognized and character positions of the M characters to be recognized in the image to be recognized; A generating module configured to generate N prompt images based on the verification code prompt information corresponding to the image to be recognized, wherein each prompt image includes a target verification character; a recognition module configured to determine a verification code recognition result of the image to be recognized based on the character areas of the respective M characters to be recognized, the character positions of the respective M characters to be recognized, and the N prompt images; The N prompt images include P groups of prompt images, each group of prompt images includes Q prompt images, and determining a verification code recognition result of the image to be recognized based on the character areas of the M characters to be recognized, the character positions of the M characters to be recognized, and the N prompt images, includes: For each of the Q prompt images included in each group of prompt images in the P groups of prompt images, determining, based on the areas of the character areas of the M characters to be recognized, respective character areas of M1 characters to be recognized having the same area as the prompt image; and calculating similarities between the prompt image and the character areas of the M1 characters to be recognized, to determine the similarities corresponding to the M1 characters to be recognized; For each group of prompt images in the P groups of prompt images, determining a recognition result corresponding to each group of prompt images based on the similarities corresponding to the M characters to be recognized, wherein the recognition result corresponding to each group of prompt images is a character region in each character region of the M characters to be recognized; The recognition results corresponding to the P groups of prompt images are combined to determine the verification code recognition result of the image to be recognized, and the verification code recognition result includes the character areas of the P characters to be recognized in the character areas of the M characters to be recognized.

11. A computer-readable storage medium, characterized in that The storage medium stores instructions, and when the instructions are executed by a processor of an electronic device, the electronic device is enabled to execute the verification code recognition method according to any one of claims 1 to 9.

12. An electronic device, characterized in that: The electronic device comprises: processor; memory for storing computer-executable instructions; The processor is configured to execute the computer-executable instructions to implement the verification code recognition method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Verification code parameter obtaining method and device

    CN112070092A