A method and device for obtaining verification code parameters
By preprocessing the verification code image and identifying matching text images, and obtaining verification code parameters, the limitations of character segmentation in the existing verification code recognition methods are solved, and the recognition accuracy of verification code is improved.
Patent Information
- Application Number
- CN202010914216.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-02
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2040-09-02
AI Technical Summary
In the existing verification code recognition methods, the character segmentation method requires that there is no overlap or adhesion between characters in the vertical direction, resulting in reduced usage limitations and recognition accuracy.
By obtaining the verification code image, preprocessing is performed to obtain the preprocessed image, obtain the information text image, and match the matching text image corresponding to the information text image in the preprocessed image, and finally obtain the position of the matching text image in the preprocessed image. Coordinate parameters.
This avoids the limitations in the verification code identification process, improves the recognition accuracy of the verification code, and ensures the accuracy and efficiency of the verification code extraction process.
Smart Images

Figure CN112070092B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for obtaining verification code parameters. Background Art
[0002] At present, verification codes are a kind of public fully automatic program that can effectively distinguish between users and computers. The use of verification codes can effectively prevent others from continuously logging into websites with specific programs, thereby cracking user accounts and passwords and other malicious behaviors. At present, verification codes include character images, voice recognition, video verification codes, etc. Because character images are easy to transmit, they are widely used. Generally, after the user enters the verification code when logging in, the website needs to verify whether the verification code characters entered by the user are correct. First, the verification code needs to be automatically recognized, and then the recognized verification code is compared with the verification code characters entered by the user to ensure the normal login of the user. However, in practice, it is found that the current verification code recognition method usually uses a character segmentation method, and the use of this character segmentation method requires that there should be no overlap and adhesion between characters in the vertical direction, which leads to certain usage limitations and reduces the recognition accuracy of the verification code. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a method and device for obtaining verification code parameters, which can avoid the limitations of verification code recognition and thus improve the recognition accuracy of the verification code.
[0004] A first aspect of an embodiment of the present application provides a method for obtaining verification code parameters, which may include:
[0005] Get the verification code image;
[0006] Preprocessing the verification code image to obtain a preprocessed image;
[0007] Acquire an information text image in the preprocessed image;
[0008] matching a matching text image corresponding to the information text image in the preprocessed image;
[0009] Obtain the position coordinate parameters of the matching text image in the preprocessed image.
[0010] In the above implementation process, the method can give priority to obtaining the verification code image, and after obtaining the verification code image, preprocess the verification code image to obtain the preprocessed image; when the preprocessed image is obtained, the information text image is obtained in the preprocessed image; and further the matching text image corresponding to the information text image is matched in the preprocessed image; finally, the position coordinate parameters of the matching text image in the preprocessed image are obtained. It can be seen that by implementing this implementation method, self-identification can be performed according to the verification code image, thereby avoiding the process of text recognition of the verification code, and thus avoiding the limitations of use caused by verification code recognition; on the other hand, by implementing this implementation method, the verification code parameters can be extracted through the verification code image itself, so that the verification code extraction process will not be interfered by the verification code recognition process, and will not produce verification code recognition errors, thereby improving the recognition accuracy of the verification code.
[0011] Furthermore, the step of preprocessing the verification code image to obtain a preprocessed image includes:
[0012] Performing grayscale processing on the verification code image to obtain a grayscale image;
[0013] The grayscale image is binarized to obtain a preprocessed image.
[0014] In the above implementation process, in the process of preprocessing the verification code image to obtain the preprocessed image, the method can preferentially grayscale the verification code image to obtain the grayscale image; and then binarize the grayscale image to obtain the preprocessed image. It can be seen that by implementing this implementation method, a black-and-white preprocessed image can be obtained through grayscale processing and binarization processing, so that the subsequent processing of the verification code image is based on a simple black-and-white preprocessed image, which improves the overall verification code image processing efficiency; at the same time, the desired information text image can be accurately obtained based on the black-and-white preprocessed image, so that the recognition of the black-and-white information text image is higher, and the accuracy of obtaining the verification code parameters can be improved.
[0015] Furthermore, the step of obtaining the information text image from the preprocessed image includes:
[0016] Dividing the preprocessed image into regions to obtain a prompt information region and a verification information region;
[0017] In the prompt information area, an information text image is obtained.
[0018] In the above implementation process, in the process of obtaining the information text image from the pre-processed image, the method can preferentially divide the pre-processed image into regions to obtain the prompt information region and the verification information region; and then obtain the information text image in the prompt information region. It can be seen that by implementing this implementation method, the pre-processed image can be divided into regions to obtain the prompt information region and the verification information region, so that the prompt information and the verification information can be clearly separated, and the information text image can be accurately obtained, and the relevant information content in the verification information region will not be obtained.
[0019] Furthermore, the step of matching the matching text image corresponding to the information text image in the pre-processed image includes:
[0020] A matching text image corresponding to the information text image is matched in the verification information area.
[0021] In the above implementation process, the method can specifically match the matching text image corresponding to the information text image in the verification information area in the process of matching the matching text image corresponding to the information text image in the preprocessed image. It can be seen that by implementing this implementation method, the matching text image corresponding to the information text image can be obtained in the verification information area, so that the matching text image can be accurately obtained and will no longer be obtained in the prompt information area, thereby avoiding the occurrence of false detection, thereby improving the accuracy of matching text image detection.
[0022] Furthermore, the step of obtaining the position coordinate parameters of the matching text image in the pre-processed image includes:
[0023] In the preprocessed image, obtaining the center point coordinates of each matching character in the matching character image;
[0024] Generate position coordinate parameters according to the center point coordinates.
[0025] In the above implementation process, in the process of obtaining the position coordinate parameters of the matching text image in the preprocessed image, the method can preferentially obtain the center point coordinates of each matching text in the matching text image in the preprocessed image; and then generate the position coordinate parameters based on the center point coordinates. It can be seen that by implementing this implementation method, the center point coordinates of each matching text can be obtained based on the preprocessed image, so that the final position coordinate parameters are determined based on the coordinate system of the preprocessed image, thereby ensuring the correlation between the position coordinate parameters and the preprocessed image, and further ensuring the accuracy of obtaining the verification code parameters.
[0026] A second aspect of an embodiment of the present application provides a device for obtaining verification code parameters, and the device for obtaining verification code parameters includes:
[0027] A first acquisition unit, used to acquire a verification code image;
[0028] A processing unit, used for preprocessing the verification code image to obtain a preprocessed image;
[0029] A second acquisition unit, used for acquiring an information text image from the pre-processed image;
[0030] A matching unit, used for matching a matching text image corresponding to the information text image in the preprocessed image;
[0031] The third acquisition unit is used to acquire the position coordinate parameters of the matching text image in the pre-processed image.
[0032] In the above implementation process, the verification code parameter acquisition device can acquire the verification code image through the first acquisition unit; preprocess the verification code image through the processing unit to obtain the preprocessed image; acquire the information text image in the preprocessed image through the second acquisition unit; match the matching text image corresponding to the information text image in the preprocessed image through the matching unit; and acquire the position coordinate parameters of the matching text image in the preprocessed image through the third acquisition unit. It can be seen that by implementing this embodiment, self-identification can be performed based on the verification code image, thereby avoiding the process of text recognition of the verification code, and thus avoiding the use limitations caused by verification code recognition; on the other hand, by implementing this embodiment, verification code parameters can be extracted through the verification code image itself, so that the verification code extraction process will not be interfered by the verification code recognition process, and will not produce verification code recognition errors, thereby improving the recognition accuracy of the verification code.
[0033] Furthermore, the processing unit includes:
[0034] A first processing subunit, configured to perform grayscale processing on the verification code image to obtain a grayscale image;
[0035] The second processing subunit is used to perform binarization processing on the grayscale image to obtain a preprocessed image.
[0036] In the above implementation process, the processing unit can perform grayscale processing on the verification code image through the first processing subunit to obtain a grayscale image; and perform binarization processing on the grayscale image through the second processing subunit to obtain a preprocessed image. It can be seen that by implementing this embodiment, a preprocessed image in black and white can be obtained through grayscale processing and binarization processing, so that the subsequent processing of the verification code image is based on a simple black and white preprocessed image, which improves the overall verification code image processing efficiency; at the same time, the desired information text image can be accurately obtained based on the black and white preprocessed image, so that the recognition of the information text image based on black and white is higher, and then the accuracy of obtaining the verification code parameters can be improved.
[0037] Furthermore, the second acquiring unit includes:
[0038] A division subunit, used for dividing the pre-processed image into regions to obtain a prompt information region and a verification information region;
[0039] The first acquisition subunit is used to acquire the information text image in the prompt information area.
[0040] In the above implementation process, the second acquisition unit can divide the pre-processed image into regions through the division sub-unit to obtain the prompt information region and the verification information region; and obtain the information text image in the prompt information region through the first acquisition sub-unit. It can be seen that by implementing this embodiment, the pre-processed image can be divided into regions to obtain the prompt information region and the verification information region, so that the prompt information and the verification information can be clearly separated, and then the information text image can be accurately obtained, and the relevant information content in the verification information region will not be obtained.
[0041] A third aspect of an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the method for obtaining verification code parameters described in any one of the first aspect of the embodiments of the present application.
[0042] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium storing computer program instructions. When the computer program instructions are read and executed by a processor, the method for obtaining verification code parameters described in any one of the first aspect of the embodiment of the present application is executed. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 A flowchart of a method for obtaining verification code parameters provided in an embodiment of the present application;
[0045] Figure 2 A flowchart of another method for obtaining verification code parameters provided in an embodiment of the present application;
[0046] Figure 3 A schematic diagram of the structure of a device for obtaining verification code parameters provided in an embodiment of the present application;
[0047] Figure 4 A schematic diagram of the structure of another device for obtaining verification code parameters provided in an embodiment of the present application;
[0048] Figure 5 An exemplary schematic diagram of a method for obtaining verification code parameters provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0050] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0051] Example 1
[0052] Please see Figure 1 , Figure 1 A flowchart of a method for obtaining verification code parameters is provided for an embodiment of the present application. The method can be applied to the verification code verification process in any software. Specifically, the method can be used to automatically obtain verification code parameters to facilitate verification of the verification code input by the user; the method can also be used to automatically obtain verification code parameters to facilitate automatic completion of verification code verification. Among them, the method for obtaining verification code parameters includes:
[0053] S101, obtaining a verification code image.
[0054] As an alternative implementation, the steps of obtaining the verification code image may include:
[0055] Access the verification code picture interface and obtain the verification code picture.
[0056] Implementing this implementation can directly obtain the verification code image through the verification code image interface, thereby avoiding the participation and interference of other processes, and further making the accuracy of the verification code image closest to the original accuracy, and further ensuring the acquisition accuracy of the verification code parameters.
[0057] S102. Preprocess the verification code image to obtain a preprocessed image.
[0058] In this embodiment, the preprocessing performed on the verification code image can include many types, which can include image grayscale processing, image binarization processing, text stroke processing, text edge optimization processing, and so on.
[0059] S103. Obtain the information text image in the preprocessed image.
[0060] In this embodiment, the information text image is an instruction image for instructing the user to find an object in the verification code image.
[0061] For example, the verification code image includes the words "Please click on 'fire','study', 'hope'" and some scattered Chinese characters of 'fire','study', 'hope'. It can be seen that this verification code image requires the user to click on the three characters 'fire','study', 'hope' in sequence among the scattered Chinese characters of 'fire','study', 'hope' to enable the user to complete the verification process. Among them, the three characters 'fire','study', 'hope' in the words "Please click on 'fire','study', 'hope'" are the information text images.
[0062] S104. Match the matching text image corresponding to the information text image in the preprocessed image.
[0063] In this embodiment, the matching text image is an image corresponding to the information text image.
[0064] In this embodiment, the text in the matching text image corresponds to the text in the information text image.
[0065] For example, the matching text image is the image information obtained by matching the above-mentioned scattered 'fire','study', 'hope'.
[0066] S105. Obtain the position coordinate parameters of the matching text image in the preprocessed image.
[0067] In this embodiment, the position coordinate parameters are verification code parameters.
[0068] In this embodiment, because the verification code recognition device recognizes the coordinates of the position clicked by the user during the verification code recognition process, if the position coordinate parameters are obtained in this step, it is convenient to compare the coordinates of the position clicked by the user, thereby completing the verification code comparison and recognition.
[0069] In this embodiment, the execution subject of the method may be a computing device such as a computer or a server, and no limitation is made in this embodiment.
[0070] In this embodiment, the execution subject of the method may also be a smart device such as a smart phone and a tablet, which is not limited in this embodiment.
[0071] It can be seen that implementation Figure 1 The described method for obtaining verification code parameters can self-identify based on the verification code image, thereby avoiding the process of text recognition of the verification code, and further avoiding the use limitations caused by verification code recognition; on the other hand, by implementing this embodiment, verification code parameters can be extracted through the verification code image itself, so that the verification code extraction process will not be interfered by the verification code recognition process, and verification code recognition errors will not be generated, thereby improving the recognition accuracy of the verification code. .
[0072] Example 2
[0073] Please see Figure 2 , Figure 2 A flowchart of another method for obtaining verification code parameters provided in an embodiment of the present application. Figure 2 The flowchart of the method for obtaining the verification code parameters described is based on Figure 1 The flowchart of the method for obtaining verification code parameters described above is improved. The method for obtaining verification code parameters includes:
[0074] S201, obtaining a verification code image.
[0075] In this embodiment, the acquired verification code image is used to further acquire verification code parameters.
[0076] In this embodiment, the verification code parameters are coordinate parameters of the text image to be verified in the verification code image.
[0077] For example, when the coordinate parameters input by the user match the coordinate parameters of the text image to be verified, it means that the user has correctly completed the verification.
[0078] S202: grayscale processing is performed on the verification code image to obtain a grayscale image.
[0079] In this embodiment, the grayscale processing can normalize the multiple colors included in the verification code image, thereby facilitating recognition.
[0080] S203. Binarize the grayscale image to obtain a preprocessed image.
[0081] Please refer to Figure 5 , Figure 5 which provides an example schematic diagram of a method for obtaining verification code parameters. As Figure 5 shown, Figure 5 it specifically provides an image schematic diagram of a preprocessed image after binarization. In this preprocessed image schematic diagram, the area of "Click: Huoxuewang" constitutes the prompt information area, and "Huo, Zi, Xue, Wang" below it constitutes the verification information area.
[0082] In this example process, the main purpose of this method is to obtain the coordinate parameters of the three Chinese characters "Huo", "Xue", and "Wang" in the verification information area.
[0083] S204. Divide the preprocessed image into regions to obtain a prompt information area and a verification information area.
[0084] In this embodiment, the region division is to facilitate obtaining the information text image and the matching text image.
[0085] In this embodiment, the verification information area is obtained by intercepting the preprocessed image, and this verification information area is a part of the preprocessed image after removing the content in the prompt information area.
[0086] S205. In the prompt information area, obtain the information text image.
[0087] In this embodiment, the information text image includes multiple information text images.
[0088] For example, just like Figure 5 the three information text sub-images of "Huo", "Xue", and "Wang" shown in
[0089] In this embodiment, this method does not recognize the three information texts of "Huo", "Xue", and "Wang", that is, it only obtains the image within the smallest rectangle (or circle) including "Huo", "Xue", or "Wang", and takes the three obtained information text sub-images as templates for matching.
[0090] S206. In the verification information area, match the matching text image corresponding to the information text image.
[0091] In this embodiment, the matching text image is the image information corresponding to the above information text image.
[0092] In this embodiment, the information text image includes multiple information text sub-images, and the matching text image includes the corresponding number of matching text sub-images. The quantities of the two are the same.
[0093] As an optional implementation, the step of matching the matching text image corresponding to the information text image in the verification information area includes:
[0094] Obtaining an image sequence of a plurality of information text sub-images in the information text image;
[0095] Matching the text sub-images in the verification information area in sequence according to the image order to obtain a plurality of matching text sub-images;
[0096] Combine the image sequence and the matching text sub-image to obtain the matching text image.
[0097] As an optional implementation, if there is a difference in font size between the information text sub-image and the matching text sub-image, the above matching operation may be performed by scaling the information text sub-image to a certain extent.
[0098] S207: In the pre-processed image, obtain the center point coordinates of each matching character in the matching character image.
[0099] In this embodiment, the matching text image includes a plurality of matching text sub-images, and each matching text sub-image includes corresponding matching text.
[0100] In this embodiment, the center point coordinates can be understood as the center coordinates of each matching text (or the center coordinates of each matching text sub-image).
[0101] S208. Generate position coordinate parameters according to the center point coordinates.
[0102] In this embodiment, the location coordinate parameter is a verification code parameter.
[0103] In this embodiment, the verification code parameter is used to assist in determining whether the input parameter information is correct and valid.
[0104] In this embodiment, the above steps can be implemented through some code instructions of the Opencv-python module.
[0105] In this implementation method, the text in the verification code image will not be recognized during the whole process, thereby avoiding the error and workload caused by the recognition. In addition, the whole process of the method is completed by processing the image, which makes the verification code parameter acquisition process start from the image and end at the image, thereby ensuring the acquisition accuracy of the position coordinate parameters.
[0106] It can be seen that implementation Figure 2The described method for obtaining verification code parameters can self-identify based on the verification code image, thereby avoiding the process of text recognition of the verification code, and further avoiding the use limitations caused by verification code recognition; on the other hand, by implementing this embodiment, verification code parameters can be extracted through the verification code image itself, so that the verification code extraction process will not be interfered by the verification code recognition process, and verification code recognition errors will not be generated, thereby improving the recognition accuracy of the verification code. .
[0107] Example 3
[0108] Please see Figure 3 , Figure 3 A schematic diagram of a device for obtaining verification code parameters provided in an embodiment of the present application. The device for obtaining verification code parameters includes:
[0109] A first acquisition unit 310 is used to acquire a verification code image;
[0110] The processing unit 320 is used to pre-process the verification code image to obtain a pre-processed image;
[0111] The second acquisition unit 330 is used to acquire the information text image in the pre-processed image;
[0112] A matching unit 340, configured to match a matching text image corresponding to the information text image in the preprocessed image;
[0113] The third acquisition unit 350 is used to acquire position coordinate parameters of the matching text image in the pre-processed image.
[0114] In this embodiment, the explanation of the verification code parameter acquisition device can refer to the description in Embodiment 1 or Embodiment 2, and will not be further elaborated in this embodiment.
[0115] It can be seen that implementation Figure 3 The described device for acquiring verification code parameters can self-identify based on the verification code image, thereby avoiding the process of text recognition of the verification code, and further avoiding the use limitations caused by verification code recognition; on the other hand, by implementing this embodiment, verification code parameters can be extracted through the verification code image itself, so that the verification code extraction process will not be interfered by the verification code recognition process, and verification code recognition errors will not be generated, thereby improving the recognition accuracy of the verification code. .
[0116] Example 4
[0117] Please see Figure 4 , Figure 4 A schematic diagram of the structure of another device for obtaining verification code parameters provided in an embodiment of the present application. Figure 4The structural diagram of the verification code parameter acquisition device described is based on Figure 3 The processing unit 320 is improved by improving the structural diagram of the device for obtaining verification code parameters described above.
[0118] The first processing subunit 321 is used to perform grayscale processing on the verification code image to obtain a grayscale image;
[0119] The second processing subunit 322 is used to perform binarization processing on the grayscale image to obtain a pre-processed image.
[0120] As an optional implementation manner, the second obtaining unit 330 includes:
[0121] The division subunit 331 is used to divide the pre-processed image into regions to obtain a prompt information region and a verification information region;
[0122] The first acquisition subunit 332 is used to acquire the information text image in the prompt information area.
[0123] As an optional implementation, the matching unit 340 is specifically configured to match a matching text image corresponding to the information text image in the verification information area.
[0124] As an optional implementation manner, the third obtaining unit 350 includes:
[0125] The second acquisition subunit 351 is used to acquire the center point coordinates of each matching character in the matching character image in the pre-processed image;
[0126] The generating subunit 352 is used to generate position coordinate parameters according to the center point coordinates.
[0127] In this embodiment, the explanation of the verification code parameter acquisition device can refer to the description in Embodiment 1 or Embodiment 2, and will not be further elaborated in this embodiment.
[0128] It can be seen that implementation Figure 4 The described device for acquiring verification code parameters can self-identify based on the verification code image, thereby avoiding the process of text recognition of the verification code, and further avoiding the use limitations caused by verification code recognition; on the other hand, by implementing this embodiment, verification code parameters can be extracted through the verification code image itself, so that the verification code extraction process will not be interfered by the verification code recognition process, and verification code recognition errors will not be generated, thereby improving the recognition accuracy of the verification code. .
[0129] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute any method for obtaining verification code parameters in Embodiment 1 or Embodiment 2 of the present application.
[0130] An embodiment of the present application provides a computer-readable storage medium storing computer program instructions. When the computer program instructions are read and executed by a processor, the method for obtaining verification code parameters in any one of Embodiment 1 or Embodiment 2 of the present application is executed.
[0131] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0132] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0133] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0134] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0135] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0136] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
Claims
1. A method for obtaining verification code parameters, characterized in that: include: Get the verification code image; Preprocessing the verification code image to obtain a preprocessed image; Acquire an information text image in the preprocessed image; matching a matching text image corresponding to the information text image in the preprocessed image; Obtaining position coordinate parameters of the matching text image in the preprocessed image; Wherein, the step of obtaining the information text image in the pre-processed image comprises: Dividing the preprocessed image into regions to obtain a prompt information region and a verification information region; In the prompt information area, obtaining an information text image; Wherein, the step of matching the matching text image corresponding to the information text image in the pre-processed image comprises: matching a matching text image corresponding to the information text image in the verification information area; The step of obtaining the position coordinate parameters of the matching text image in the pre-processed image includes: In the preprocessed image, obtaining the center point coordinates of each matching character in the matching character image; Generate position coordinate parameters according to the center point coordinates.
2. The method for obtaining verification code parameters according to claim 1, characterized in that: The step of preprocessing the verification code image to obtain a preprocessed image comprises: Performing grayscale processing on the verification code image to obtain a grayscale image; The grayscale image is binarized to obtain a preprocessed image.
3. A device for obtaining verification code parameters, characterized in that: The verification code parameter acquisition device includes: A first acquisition unit, used to acquire a verification code image; A processing unit, used for preprocessing the verification code image to obtain a preprocessed image; A second acquisition unit, used for acquiring an information text image from the pre-processed image; A matching unit, used for matching a matching text image corresponding to the information text image in the preprocessed image; A third acquisition unit, used to acquire position coordinate parameters of the matching text image in the pre-processed image; Wherein, the second acquisition unit includes: A division subunit, used for dividing the pre-processed image into regions to obtain a prompt information region and a verification information region; A first acquisition subunit is used to acquire an information text image in the prompt information area; Wherein, the matching unit is specifically used to match a matching text image corresponding to the information text image in the verification information area; Wherein, the third acquisition unit includes: A second acquisition subunit is used to acquire the center point coordinates of each matching character in the matching character image in the preprocessed image; The generating subunit is used to generate position coordinate parameters according to the center point coordinates.
4. The device for obtaining verification code parameters according to claim 3, characterized in that: The processing unit comprises: A first processing subunit, configured to perform grayscale processing on the verification code image to obtain a grayscale image; The second processing subunit is used to perform binarization processing on the grayscale image to obtain a preprocessed image.
5. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the method for obtaining verification code parameters according to any one of claims 1 to 2.
6. A readable storage medium, characterized in that: The readable storage medium stores computer program instructions, and when the computer program instructions are read and executed by a processor, the method for obtaining verification code parameters according to any one of claims 1 to 2 is executed.
Citation Information
Patent Citations
Method and system for cracking Chinese character verification code, electronic equipment and storage medium
CN111160369A