CN114067324A - Identifying method, device, equipment and storage medium for identifying verification code picture - Google Patents

Identifying method, device, equipment and storage medium for identifying verification code picture Download PDF

Info

Publication number
CN114067324A
CN114067324A CN202111263901.6A CN202111263901A CN114067324A CN 114067324 A CN114067324 A CN 114067324A CN 202111263901 A CN202111263901 A CN 202111263901A CN 114067324 A CN114067324 A CN 114067324A
Authority
CN
China
Prior art keywords
character
effective
preset
sticky
candidate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111263901.6A
Other languages
Chinese (zh)
Inventor
魏永
罗鸣飞
李萌萌
吴迪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Youwei Technology Co ltd
Original Assignee
Xiamen Youwei Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiamen Youwei Technology Co ltd filed Critical Xiamen Youwei Technology Co ltd
Priority to CN202111263901.6A priority Critical patent/CN114067324A/en
Publication of CN114067324A publication Critical patent/CN114067324A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Character Input (AREA)

Abstract

Provided are a verification code picture identification method, device, equipment and storage medium, wherein the method comprises the following steps: carrying out binarization processing on the picture to be identified to obtain effective pixel points of the picture; clustering the effective pixel points to obtain mutually separated effective character areas; determining a single character area and a sticky character area in all the effective character areas according to the effective character areas and a preset character attribute set, wherein the preset character attribute set comprises preset attribute characteristics of all characters; obtaining a plurality of effective characters through a preset cutting rule according to the sticky character area; and obtaining the recognition result of the picture to be recognized by combining a recognition model which is trained in advance according to the single character corresponding to the single character area and the plurality of effective characters in the sticky character area, wherein the recognition accuracy of the verification code can be improved by accurately cutting the picture to be recognized and combining a machine recognition model.

Description

Identifying method, device, equipment and storage medium for identifying verification code picture
Technical Field
The present disclosure relates to verification code technology, and more particularly, to a verification code picture identification method, apparatus, device, and storage medium.
Background
Verification code picture technology is part of modern network security technology, and programs require users to input verification codes to verify whether real operations are performed or not in the scenes of user login, sensitive information inquiry and the like.
With the development of image recognition technology, it is not a problem for the picture recognition of simply arranged numbers and letters, in some prior art, characters in an image are distorted, rotated and overlapped, which often increases the difficulty of user recognition by means of interference lines, interference points and the like, but an image with too high difficulty is not beneficial to the user recognition (such as character color change, character deformation and the like), and the original intention of manual operation of a verification person is verified through a verification code, so that great trouble is brought to the user, and therefore, auxiliary recognition can be performed on the user through an automatic recognition technology, and the efficiency and the accuracy of the verification code of the user are violated. In the prior art, the efficiency of identifying the verification code image by a machine is not high, for example, it is difficult to accurately judge the overlapped characters, so how to improve the accuracy of automatic identification of the verification code becomes a technical problem which needs to be solved at present.
Disclosure of Invention
In view of the foregoing problems in the prior art, it is an object of the present invention to provide a method, an apparatus, a device and a storage medium for identifying an identifying code picture, which can improve the accuracy of automatic identifying the identifying code picture.
In order to solve the technical problems, the specific technical scheme is as follows:
in one aspect, provided herein is a captcha picture identification method, the method comprising:
carrying out binarization processing on the picture to be identified to obtain effective pixel points of the picture;
clustering the effective pixel points to obtain mutually separated effective character areas;
determining a single character area and a sticky character area in all the effective character areas according to the effective character areas and a preset character attribute set, wherein the preset character attribute set comprises preset attribute characteristics of all characters;
obtaining a plurality of effective characters through a preset cutting rule according to the sticky character area;
and obtaining the recognition result of the picture to be recognized by combining a recognition model which is trained in advance according to the single character corresponding to the single character area and the plurality of effective characters in the sticky character area.
Further, the preset attribute features comprise character height, character width and number of character pixel points;
determining a single character area and a sticky character area in all the effective character areas according to the effective character areas and a preset character attribute set, wherein the method comprises the following steps:
for each valid character area, the following steps are performed:
acquiring character features in the effective character area;
judging whether the character features in the effective character area fall within the range of preset attribute features in the preset character attribute set or not;
if yes, determining the effective character area as a single character area;
and if not, determining the effective character area as a sticky character area.
Further, the determining whether the character features in the valid character region fall within the range of the preset attribute features in the preset character attribute set further includes:
judging whether the width of the effective character area exceeds the maximum value of the character width in the preset character attribute set or not;
if yes, determining the effective character area as a sticky character area;
if not, judging whether the ratio of the width to the height of the effective character area exceeds the maximum value of the ratio of the character width to the character height of a single character in the preset character attribute set;
if the ratio of the width to the height of the effective character area exceeds the maximum value of the ratio of the character width to the character height of a single character in the preset character attribute set, determining the effective character area as a sticky character area;
and if the ratio of the width to the height of the effective character area does not exceed the maximum value of the ratio of the character width to the character height of the single character in the preset character attribute set, determining the effective character area as the single character area.
Further, if the ratio of the width to the height of the valid character area does not exceed the maximum value of the ratio of the character width to the character height of a single character in the preset character attribute set, determining the valid character area as a single character area, further comprising:
judging whether the number of pixel points in the effective character area exceeds the maximum value of the number of pixel points of a single character in the preset character attribute set;
if the number of pixel points in the effective character area exceeds the maximum value of the number of pixel points of a single character in the preset character attribute set, determining the effective character area as a sticky character area;
and if the number of pixel points in the effective character area does not exceed the maximum value of the number of pixel points of the single character in the preset character attribute set, determining the effective character area as the single character area.
Further, according to the sticky character area, obtaining a plurality of effective characters through a preset cutting rule, including:
for each sticky character area the following steps are performed:
according to a vertical projection method, counting the number of pixel points in a preset unit interval of the sticky character area in the horizontal direction in sequence;
determining candidate cutting points of the sticky character area according to the variation trend of the number of pixel points in a preset unit interval of the sticky character area in the horizontal direction;
when the candidate cutting point is one, taking the candidate cutting point as a target cutting point;
when the candidate cutting points are multiple, obtaining multiple character features of a candidate region obtained by the multiple candidate cutting points, and screening a target cutting point from the multiple candidate cutting points through the multiple character features and a preset screening rule;
and cutting the sticky character area according to the target cutting point to obtain a plurality of cut effective characters.
Further, according to the vertical projection method, count in proper order the pixel number in the unit interval is predetermine to the adhesion character region on the horizontal direction, include:
determining a minimum character width from the preset character attribute set, and taking the minimum character width as an initial width of a designated window, wherein the designated window comprises a fixed end and a movable end;
placing a fixed end of the designated window on one side of the sticky character area and placing a moving end of the designated window on the other side of the sticky character area by the initial width;
moving the moving end towards one side far away from the fixed end in sequence by a preset unit interval;
and obtaining the number of pixel points of the sticky character area in the moving range of the mobile terminal.
Further, according to the trend of change of the number of pixels in the horizontal direction in the preset unit interval of the sticky character area, determining the candidate cutting point of the sticky character area includes:
generating a change curve of the number of the pixel points according to the number of the pixel points in a unit interval preset in the horizontal direction in the sticky character area;
calculating to obtain the change slope of the pixel points in the change curve according to the change curve;
and determining the position of the pixel point change slope exceeding a preset value as a candidate cutting point of the sticky character area.
Further, according to the trend of change of the number of pixels in the horizontal direction in the preset unit interval of the sticky character region, determining the candidate cutting point of the sticky character region further includes:
generating a change curve of the number of the pixel points according to the number of the pixel points in a unit interval preset in the horizontal direction in the sticky character area;
determining the positions of wave crests and wave troughs in the change curve according to the change curve;
and determining the valley position as a candidate cutting point of the sticky character area.
Further, when the candidate cut points are multiple, obtaining multiple character features of a candidate region obtained from the multiple candidate cut points, and screening a target cut point from the multiple candidate cut points by combining the multiple character features with a preset screening rule, including:
determining a cutting position combination aiming at the sticky character area according to a plurality of candidate cutting points, wherein each cutting position in the cutting position combination comprises at least one candidate cutting point;
cutting the sticky character area according to the cutting position combination and the candidate cutting points in each cutting position to obtain a plurality of candidate areas corresponding to each cutting position;
counting character features in a plurality of candidate regions corresponding to each cutting position, wherein the character features at least comprise character width and the number of character pixel points;
determining the number of the candidate regions corresponding to each cutting position according to the character features, wherein the number of the candidate regions corresponds to a single character feature;
and determining candidate cutting points in the cutting positions corresponding to the plurality of candidate areas with the maximum number of the character features as target cutting points.
Further, the determining, according to the character features, the number of the candidate regions corresponding to each cutting position that meet a single character feature includes:
sequentially carrying out the following steps on a plurality of candidate regions corresponding to each cutting position:
judging whether the number of character pixel points in the candidate region exceeds the minimum value of the number of single character pixel points in the preset character attribute set or not;
if yes, continuing to judge that the character width in the candidate area is between the minimum value and the maximum value of the character width of a single character in the preset character attribute set;
if the character width in the candidate region is between the minimum value and the maximum value of the character width of a single character in the preset character attribute set, the candidate region conforms to the characteristic of the single character;
and determining the number of candidate areas which accord with the characteristics of the single character.
Further, the clustering the effective pixels to obtain mutually separated effective character regions includes:
counting the number of pixels of the effective pixels in the picture to be identified in the vertical direction;
determining the position with the number of the pixel points being zero, and taking the position as a clustering segmentation point;
and according to the clustering partition points, the effective pixel points in the picture to be identified are partitioned to obtain mutually separated effective character areas.
In another aspect, this document also provides a captcha picture identification apparatus, the apparatus comprising:
the preprocessing module is used for carrying out binarization processing on the picture to be identified to obtain effective pixel points of the picture;
the effective character region generation module is used for clustering the effective pixel points to obtain mutually separated effective character regions;
the processing module is used for determining a single character area and a sticky character area in all the effective character areas according to the effective character areas and a preset character attribute set, wherein the preset character attribute set comprises preset attribute characteristics of all characters;
the cutting module is used for obtaining a plurality of effective characters according to the sticky character area through a preset cutting rule;
and the recognition module is used for obtaining a recognition result of the picture to be recognized by combining a recognition model which is trained in advance according to the single character corresponding to the single character area and the plurality of effective characters in the sticky character area.
In another aspect, a computer device is also provided herein, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the method as described above when executing the computer program.
Finally, a computer-readable storage medium is also provided herein, which stores a computer program that, when executed by a processor, implements the method as described above.
By adopting the technical scheme, the verification code picture identification method, the verification code picture identification device, the verification code picture identification equipment and the storage medium can obtain mutually separated effective character areas by carrying out binarization processing and clustering processing on a picture to be identified, further determine a single character area and a sticky character area in all the effective character areas according to a preset character attribute set, then carry out cutting processing on the sticky character area through a preset cutting rule to obtain a plurality of effective characters, finally input the single character corresponding to the single character area and the plurality of effective characters obtained by cutting into a pre-trained identification model to obtain an identification result of the picture to be identified, and improve the identification accuracy of the verification code by accurately cutting the picture to be identified and combining with a machine identification model.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments or technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 shows a schematic representation of an implementation environment for a method provided by embodiments herein;
fig. 2 is a schematic diagram illustrating steps of a verification code image recognition method according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram illustrating a process for recognizing valid character regions in an embodiment of the present disclosure;
FIG. 4 is a schematic diagram illustrating a process for identifying valid character regions in another embodiment herein;
FIG. 5 is a schematic diagram illustrating a step of cutting the sticky character region according to an embodiment of the present disclosure;
FIG. 6 shows a schematic illustration of verification code cutting in an embodiment herein;
FIG. 7 is a diagram illustrating a variation curve of the number of pixels in the embodiment of the present disclosure;
fig. 8 is a schematic structural diagram illustrating an apparatus for identifying an authentication code picture according to an embodiment of the present disclosure;
fig. 9 shows a schematic structural diagram of a computer device provided in an embodiment herein.
Description of the symbols of the drawings:
10. a user;
20. a service terminal;
30. a processing device;
40. an identification device;
100. a preprocessing module;
200. an effective character area generating module;
300. a processing module;
400. a cutting module;
500. an identification module;
902. a computer device;
904. a processor;
906. a memory;
908. a drive mechanism;
910. an input/output module;
912. an input device;
914. an output device;
916. a presentation device;
918. a graphical user interface;
920. a network interface;
922. a communication link;
924. a communication bus.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments herein without making any creative effort, shall fall within the scope of protection.
It should be noted that the terms "first," "second," and the like in the description and claims herein and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments herein described are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, apparatus, article, or device that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or device.
In the prior art, as the difficulty of generating the verification code is increased, the normal identification of the user is influenced, the normal service processing (such as login verification, payment verification and other scenes) of the user is further influenced, and great troubles are brought to the user, the user can be identified in an auxiliary manner through an automatic identification technology, and the efficiency and the accuracy of identifying the verification code of the user are improved. In the prior art, the efficiency of identifying the verification code image by a machine is not high, for example, the accurate judgment of the overlapped characters is difficult to be carried out.
In order to solve the above problem, embodiments of the present specification provide a method for identifying an identifying code picture, which can improve accuracy of automatically identifying an identifying code, thereby efficiently assisting a user. As shown in fig. 1, the implementation environment of the method is schematically illustrated, and may include a user 10, a service terminal 20, a processing device 30, and an identification device 40, where the service terminal 20, the processing device 30, and the identification device 40 establish a communication connection therebetween. The user 10 performs corresponding service transactions through the service terminal 20, which may relate to the conditions of account login or payment service, and the like, and needs to input an authentication code to verify the authenticity of the user 10, so as to prevent malicious password cracking, thereby improving the security of data or funds. The processing device 30 obtains a plurality of valid characters and a single recognizable character by acquiring a verification code picture appearing on the service terminal 20, performing binarization, clustering, cutting and other processing, and sends the processed character to the recognition device 40, the recognition device 40 stores a recognition model which is trained in advance, a character result of the verification code in the service terminal 20 can be obtained by inputting the plurality of valid characters and the single recognizable character into the recognition model, and the recognized character is sent to the service terminal 20 through the processing device 30, a corresponding result is realized on a display interface of the service terminal 20, so that a user can conveniently and correctly input the verification code, the accuracy of verification code recognition is improved through automatic recognition of the verification code, and the correct verification code input of the user is effectively assisted, the use experience of the user is improved.
The identification device 40 may be a server, which may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a CDN (Content Delivery Network), a big data and an artificial intelligence platform.
In an alternative embodiment, the functions of the processing device 30 may be implemented in the identification device 40, that is, the identification device 40 may implement binarization, clustering and segmentation processes on the pictures to be identified, and push the identification result directly to the service terminal 20. Specifically, the service terminal 20 and the processing device 30 may include, but are not limited to, electronic devices of smart phones, desktop computers, tablet computers, notebook computers, smart speakers, digital assistants, Augmented Reality (AR)/Virtual Reality (VR) devices, smart wearable devices, and the like. Optionally, the operating system running on the electronic device may include, but is not limited to, an android system, an IOS system, Linux, Windows, and the like.
In addition, it should be noted that fig. 1 shows only one application environment provided by the present disclosure, and in practical applications, other application environments may also be included, for example, training of a target image segmentation model may also be implemented on the processing device 30.
Specifically, the embodiments herein provide a verification code image identification method, which can improve accuracy of automatic verification code identification, thereby improving an auxiliary effect on a user. Fig. 2 is a schematic diagram of steps of a verification code image recognition method provided in an embodiment herein, and the present specification provides the method operation steps as described in the embodiment or the flowchart, but more or less operation steps may be included based on conventional or non-inventive labor. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an actual system or apparatus product executes, it can execute sequentially or in parallel according to the method shown in the embodiment or the figures. Specifically, as shown in fig. 2, the method may include:
s101: carrying out binarization processing on the picture to be identified to obtain effective pixel points of the picture;
s102: clustering the effective pixel points to obtain mutually separated effective character areas;
s103: determining a single character area and a sticky character area in all the effective character areas according to the effective character areas and a preset character attribute set, wherein the preset character attribute set comprises preset attribute characteristics of all characters;
s104: obtaining a plurality of effective characters through a preset cutting rule according to the sticky character area;
s105: and obtaining the recognition result of the picture to be recognized by combining a recognition model which is trained in advance according to the single character corresponding to the single character area and the plurality of effective characters in the sticky character area.
The effective character areas which are separated from each other can be obtained by preprocessing and cutting the image to be recognized, a single character area and a sticky character area in all the effective character areas can be determined by combining with a preset character attribute set, then a plurality of effective characters can be obtained by cutting the sticky character area, then a single character corresponding to the single character area and a plurality of effective characters in the sticky character area are input into a recognition model which is trained in advance to obtain a recognition result, the text can be automatically cut into the sticky character area, and then the accuracy and the reliability of recognition of the verification code can be improved by combining with a machine learning model.
In this specification embodiment, after step S105, the method may further include:
and sending the identification result to a service terminal so that the service terminal displays the identification result, thereby facilitating the user to input a corresponding verification code according to the displayed identification result and improving the accuracy of inputting the verification code of the user.
The process of performing binarization on the picture to be identified may be understood as preprocessing the picture to be identified, and the specific steps may be to perform grayscale processing on the picture to obtain a grayscale map of the picture, for example, each pixel point in the picture to be identified may be traversed, and a grayscale value corresponding to the pixel point is calculated by combining pixel values of the three channels R, G, B with a corresponding operation formula, so as to obtain the grayscale map of the picture, where the operation formula is set according to an actual situation, for example, may be Gray ═ R0.299 + G0.587 + B0.114. After the gray scale image is obtained, each pixel point in the gray scale image is subjected to binarization processing by setting a gray scale threshold value, the pixel value of the pixel point exceeding the gray scale threshold value is reassigned to 255, and the pixel value of the pixel point not exceeding the gray scale threshold value is reassigned to 0, wherein the gray scale threshold value can also be set according to the actual situation, for example, can be determined by an OTSU algorithm.
It can be understood that the effective pixel point is a pixel point whose pixel value is 255 after reassignment, that is, a pixel point having practical significance and capable of representing a real character characteristic. However, in the verification code generation process, interference lines or interference points may also be generated at other positions of the picture, in order to improve the reliability of character recognition in the effective character region, noise reduction processing may also be performed on the effective character region, and interference pixel points therein are removed, for example, the interference pixel points therein are determined by using an 8-neighborhood denoising algorithm, and are then removed, the 8-neighborhood denoising algorithm is a common technical means for interference point recognition, and the specific recognition process is not limited in the embodiments of the present specification.
In this embodiment of the present specification, the clustering the effective pixels to obtain mutually separated effective character regions includes:
counting the number of pixels of the effective pixels in the picture to be identified in the vertical direction;
determining the position with the number of the pixel points being zero, and taking the position as a clustering segmentation point;
and according to the clustering partition points, the effective pixel points in the picture to be identified are partitioned to obtain mutually separated effective character areas.
Specifically, the number of pixels of the effective pixel point in each pixel point size in the horizontal direction can be counted by taking one pixel point size as a counting interval, that is, the number of pixels of the effective pixel point in the vertical direction is counted by a vertical projection mode, and the position where the pixel point is zero indicates that the effective pixel point is divided into two independent areas by the position, so that the position where the pixel point is zero is sequentially determined, and the effective pixel point can be divided into different effective character areas which are separated from each other.
In an embodiment of the present specification, the preset character attribute set includes preset attribute features of all standard characters; the preset characters may be all standard characters, such as 0-9, a-Z, and in some other embodiments, may also include chinese characters, which may be chinese characters commonly used in verification codes, or may also be chinese characters randomly extracted by a preset number, such as 100, 500, 1000, and so on. The preset attribute features are attribute features of corresponding characters, such as character height, character width and number of character pixels, and may also include other attribute features, such as character perimeter, character area, and the like, in some other embodiments, which are not limited in the embodiments of the present specification.
It should be noted that the preset character attribute set is an attribute feature of a standard character, different fonts have different attribute features, and optionally, a Times New Roman font may be selected, and of course, the selected font is used on the basis of obtaining a related copyright, and the preset character attribute set may be adapted to the verification code identification process in various scenes.
In an embodiment of this specification, as shown in fig. 3, the determining, according to the valid character area and the preset character attribute set, a single character area and a sticky character area in all valid character areas includes:
for each valid character area, the following steps are performed:
s201: acquiring character features in the effective character area;
s202: judging whether the character features in the effective character area fall within the range of preset attribute features in the preset character attribute set or not;
s203: if yes, determining the effective character area as a single character area;
s204: and if not, determining the effective character area as a sticky character area.
It can be understood that, on the basis of dividing different valid character regions, since the characters in the verification code picture may be deformed, distorted, and rotated, the attribute features of a single character and the attribute features of a standard character are difficult to be completely consistent, and therefore, by analyzing whether the character features in each valid character region fall within the range of the preset attribute features of the characters in the preset character attribute set, it is possible to judge whether the valid character region is a single character region or a sticky character region at a coarse granularity.
Optionally, the determining whether the character feature in the valid character region falls within a range of a preset attribute feature in the preset character attribute set further includes:
judging whether the width of the effective character area exceeds the maximum value of the character width in the preset character attribute set or not;
if yes, determining the effective character area as a sticky character area;
if not, judging whether the ratio of the width to the height of the effective character area exceeds the maximum value of the ratio of the character width to the character height of a single character in the preset character attribute set;
if the ratio of the width to the height of the effective character area exceeds the maximum value of the ratio of the character width to the character height of a single character in the preset character attribute set, determining the effective character area as a sticky character area;
and if the ratio of the width to the height of the effective character area does not exceed the maximum value of the ratio of the character width to the character height of the single character in the preset character attribute set, determining the effective character area as the single character area.
It can be understood that whether the valid character area is within the range of the standard character size is judged by the size of the valid character area, the sticky character area can be a character area formed by overlapping characters, in general, the verification code cannot be completely overlapped (namely 100%), otherwise, the identification of a user is greatly influenced, when partial overlapping occurs, the width of the overlapped characters is obviously larger and further exceeds the maximum width value in the standard character, and therefore, whether the valid character area belongs to the sticky character area can be judged by analyzing the width in the valid character area. Further, in some character regions with a large overlap width, the width of the character may not exceed the maximum value of the standard character width, and in the overlapped character, in the case of increasing the width, the width/height value inevitably increases, so that whether the character belongs to the sticky character region or not can be judged by the width/height value.
In a further embodiment, due to the fact that a distortion rotation or the like exists in the captcha character, it is also difficult to directly distinguish the single character region from the sticky character region by the character width and the ratio of the character width to the character height, and optionally, if the ratio of the width to the height of the valid character region does not exceed the maximum value of the ratio of the character width to the character height of the single character in the preset character attribute set, the valid character region is determined as the single character region, further comprising:
judging whether the number of pixel points in the effective character area exceeds the maximum value of the number of pixel points of a single character in the preset character attribute set;
if the number of pixel points in the effective character area exceeds the maximum value of the number of pixel points of a single character in the preset character attribute set, determining the effective character area as a sticky character area;
and if the number of pixel points in the effective character area does not exceed the maximum value of the number of pixel points of the single character in the preset character attribute set, determining the effective character area as the single character area.
It can be understood that the condition that the size of the character changes due to means such as character deformation and distortion can be effectively avoided by taking the number of the pixel points as a further judgment condition of the single character, and the reliability and the accuracy of the judgment of the single character can be further improved. For example, when a character is distorted, the width of the character is changed, when the distorted width exceeds the maximum value of the standard character width, the effective character region cannot be identified through the values of the character width and the character width/height, and when the character is distorted, only the shape is changed, the number of the pixel points of the character itself is not changed, or the change amplitude is very small, so that the effective character region can be further identified through the number of the pixel points of the character.
Illustratively, as shown in fig. 4, an exemplary schematic diagram of effective character region recognition in an embodiment of this specification may include the following steps:
step 1.1: and acquiring character features in the effective character area. In this step, the character features include character width, character height and number of character pixel points;
step 1.2: it is determined whether the character width of the valid character region exceeds a single character width maximum value. In this step, if yes, go to step 1.3, if no, go to step 1.6, wherein the maximum value of the width of a single character can be the maximum value of all the widths in the standard character;
step 1.3: it is determined whether the character aspect ratio of the valid character region exceeds a single character aspect ratio maximum. In this step, if yes, go to step 1.4, if no, go to step 1.6, wherein the maximum value of the aspect ratio of a single character can be the maximum value of all aspect ratios in the standard character;
step 1.4: and judging whether the number of the character pixel points in the effective character area exceeds the maximum value of the number of the single character pixel points. In the step, if yes, entering step 1.5, and if not, entering step 1.6, wherein the maximum value of the number of the pixel points of the single character is the maximum value of the number of all the pixel points in the standard character;
step 1.5: determining the valid character area as a single character area;
step 1.6: and determining the effective character area as a sticky character area.
The effective character region type can be efficiently identified through the steps, the size characteristics of the effective character region are firstly used as identification conditions, then the pixel point characteristics of the effective character region are further identified, and the type of the effective character region can be judged with sufficient reliability.
In an embodiment of the present disclosure, as shown in fig. 5, obtaining a plurality of valid characters according to the sticky character region by a preset cutting rule includes:
for each sticky character area the following steps are performed:
s301: according to a vertical projection method, counting the number of pixel points in a preset unit interval of the sticky character area in the horizontal direction in sequence;
s302: determining candidate cutting points of the sticky character area according to the variation trend of the number of pixel points in a preset unit interval of the sticky character area in the horizontal direction;
s303: when the candidate cutting point is one, taking the candidate cutting point as a target cutting point;
s304: when the candidate cutting points are multiple, obtaining multiple character features of a candidate region obtained by the multiple candidate cutting points, and screening a target cutting point from the multiple candidate cutting points through the multiple character features and a preset screening rule;
s305: and cutting the sticky character area according to the target cutting point to obtain a plurality of cut effective characters.
It can be understood that when the valid character region is a single character region, then need not cut it apart and handle, when the valid character region is a sticky character region, then need cut the sticky character region to obtain a plurality of valid characters that contain therein, wherein predetermine the unit interval and can be a pixel interval, just so can obtain in proper order sticky character region pixel number in the horizontal direction, and then confirm the candidate cut point according to the trend of change of pixel number, can improve the efficiency that the candidate cut point was confirmed.
When the candidate cutting point is one, the sticky character area is formed by overlapping two characters, so that a cutting position exists, and the position (namely, the candidate cutting point) is determined as the target cutting point.
When the candidate cut point is multiple, it may indicate that the sticky character region is formed by overlapping two or more characters, or the characters are distorted and overlapped, and in this embodiment of the present specification, only the sticky character region formed by overlapping two or more characters may be considered, so as to determine whether to determine the candidate cut point as the target cut point through the cut character region.
In an embodiment of the present specification, the sequentially counting, according to a vertical projection method, the number of pixels in a preset unit interval in a horizontal direction in the sticky character region includes:
determining a minimum character width from the preset character attribute set, and taking the minimum character width as an initial width of a designated window, wherein the designated window comprises a fixed end and a movable end;
placing a fixed end of the designated window on one side of the sticky character area and placing a moving end of the designated window on the other side of the sticky character area by the initial width;
moving the moving end towards one side far away from the fixed end in sequence by a preset unit interval;
and obtaining the number of pixel points of the sticky character area in the moving range of the mobile terminal.
Illustratively, the character width of "I or I" is taken as the minimum character width, and the character width is taken as the initial width of the designated window, wherein the initial width of the designated window can be understood as the minimum window for identifying characters, when the initial width is smaller than the minimum window, effective characters cannot be identified, and the efficiency of identifying effective characters can be improved by setting the designated window, so that the speed of identifying the verification code is improved.
As shown in fig. 6, the character is a sticky character region formed by overlapping three characters "a", "B", and "C", x0And x1The composed window is the initial position of the designated window, where x0To designate the fixed end of the window, x1For moving end of designated window, the designated window is arranged in the area of said sticky characterLeft side, x1And moving a preset unit interval to the right side in sequence, and counting all the vertical numbers of the pixel points in the preset unit interval, so that the number of a plurality of pixel points can be obtained for multiple times in sequence until the moving end moves to the rightmost side of the sticky character area. Of course, the designated window may also be disposed at the rightmost side of the sticky character region, so that the moving end moves leftward to obtain the number of pixels in each preset unit interval.
On the basis of obtaining the number of the pixel points at different positions, the candidate cutting points of the sticky character region can be determined according to the variation trend of the number of the pixel points, and optionally, the method can comprise the following steps:
generating a change curve of the number of the pixel points according to the number of the pixel points in a unit interval preset in the horizontal direction in the sticky character area;
calculating to obtain the change slope of the pixel points in the change curve according to the change curve;
and determining the position of the pixel point change slope exceeding a preset value as a candidate cutting point of the sticky character area.
It can be understood that, for a single character, the variation trends of the number of pixel points in the horizontal direction (i.e. the number of pixel points in the vertical direction of the character counted in sequence from the horizontal direction) are substantially consistent, that is, the number of pixel points rarely changes greatly, when the character is overlapped, the number of pixel points at the overlapped part changes greatly relative to the previous position, so that the curve at the overlapped starting part tends to rise suddenly on a continuous change curve, and therefore, the candidate cut point can be determined by the slope of the curve change. The preset value may be set according to an actual situation, such as 2, 5, and the like, and is not limited in the embodiment of the present specification.
It should be noted that, determining candidate cut points through the slope of curve change is a manner with a high success rate, but for some special characters, there may be a case where the curve change rate of the number of pixel points of a single character exceeds a preset value, which is not within the scope of this specification.
In some other embodiments, in addition to determining the candidate cut point by the slope, the candidate cut point may be determined as follows:
generating a change curve of the number of the pixel points according to the number of the pixel points in a unit interval preset in the horizontal direction in the sticky character area;
determining the positions of wave crests and wave troughs in the change curve according to the change curve;
and determining the valley position as a candidate cutting point of the sticky character area.
It can be understood that the change characteristics of the number of pixel points after character overlapping and the curve change trend can be effectively combined together by judging the candidate cutting points through the trough positions, after the characters are overlapped, the positions which are overlapped are inevitably at the trough positions, as shown in fig. 7, the change curves of the number of the pixel points can be seen as two trough positions at the m and n positions, so that the m and the n can be used as the candidate cutting points, the candidate cutting points can be visually and intuitively found out, and the efficiency and the reliability of determining the candidate cutting points are improved.
In an embodiment of this specification, when the candidate cut points are multiple, obtaining multiple character features of a candidate region obtained from the multiple candidate cut points, and screening a target cut point from the multiple candidate cut points by using the multiple character features in combination with a preset screening rule, includes:
determining a cutting position combination aiming at the sticky character area according to a plurality of candidate cutting points, wherein each cutting position in the cutting position combination comprises at least one candidate cutting point;
cutting the sticky character area according to the cutting position combination and the candidate cutting points in each cutting position to obtain a plurality of candidate areas corresponding to each cutting position;
counting character features in a plurality of candidate regions corresponding to each cutting position, wherein the character features at least comprise character width and the number of character pixel points;
determining the number of the candidate regions corresponding to each cutting position according to the character features, wherein the number of the candidate regions corresponds to a single character feature;
and determining candidate cutting points in the cutting positions corresponding to the plurality of candidate areas with the maximum number of the character features as target cutting points.
It can be understood that different cutting positions correspond to different candidate cutting point combinations, so that a cutting position combination can be obtained, then a cutting position with the best cutting effect is selected from the cutting position combination, and then the candidate cutting point corresponding to the best cutting position is taken as a target cutting point, wherein the best cutting effect is that the single character area obtained by cutting is the most, exemplarily, as shown in fig. 7, a and b are determined to be two candidate cutting points through the above steps, so that three cutting positions, which are a, b, a and b respectively, can be formed, so that a cutting position combination consisting of the three cutting positions is obtained, three different candidate area combinations can be obtained through the three cutting positions, the number of single character features of the side song in the candidate area is obtained through calculating each cutting position in sequence, the cutting position corresponding to the candidate area combination with the largest number of the single character features is taken as the target cutting position, accordingly, the candidate cut points in the target cut position are all regarded as target cut points. The points in which the sticky character region is effectively segmented can be quickly determined by the combination of different candidate cut points, thereby avoiding multiple cuts and few cuts.
In a further embodiment, the determining, according to the character features, the number of candidate regions corresponding to each cutting position that meet a single character feature includes:
sequentially carrying out the following steps on a plurality of candidate regions corresponding to each cutting position:
judging whether the number of character pixel points in the candidate region exceeds the minimum value of the number of single character pixel points in the preset character attribute set or not;
if yes, continuing to judge that the character width in the candidate area is between the minimum value and the maximum value of the character width of a single character in the preset character attribute set;
if the character width in the candidate region is between the minimum value and the maximum value of the character width of a single character in the preset character attribute set, the candidate region conforms to the characteristic of the single character;
and determining the number of candidate areas which accord with the characteristics of the single character.
It can be understood that character features, such as character width, number of character pixel points, and the like, in each candidate region are extracted, and then the character features are compared with features of standard characters to determine whether the character features satisfy a single character feature, because the cut candidate regions may also have a phenomenon of twisting rotation or even partial overlapping, the character features of the candidate regions are difficult to keep consistent with the character features of the standard characters, and the type of the candidate regions can be identified to a great extent by comparing the character features of the candidate regions with the character feature range of the standard characters, thereby improving the reliability of identifying the type to which the candidate regions belong.
It should be noted that, in the embodiment of the present specification, whether a candidate region meets a single character feature may be determined by the number of pixel points and the character width, and in some other embodiments, other determination conditions or criteria may also be provided, which is not limited in the embodiment of the present specification.
In this embodiment, the recognition model trained in advance may be obtained by:
step 2.1: acquiring training set data, wherein the training set data comprises a verification code picture labeled in advance, and optionally acquiring the training set data through a verification code generation program;
step 2.2: preprocessing the training set data to obtain a plurality of effective characters corresponding to each verification code picture;
step 2.3: inputting a plurality of effective characters corresponding to each verification code picture into an initial training model to obtain a prediction result;
step 2.4: and training the initial training model according to the preset result and the marking result of the verification code picture to obtain an identification model aiming at the verification code picture.
The identification model for the verification code picture can be quickly obtained through the model training process, and the model training process is a conventional training process, wherein the identification model may be a Convolutional Neural Network (CNN) model, and in some other embodiments, other machine learning models may also be provided, which are not limited in the embodiments of the present specification.
Wherein the preprocessing of the verification code picture in step 2.2 may include the steps of:
step 2.2.1: carrying out binarization processing on a verification code picture in training set data to obtain effective pixel points of the picture;
step 2.2.2: clustering the effective pixel points to obtain mutually separated effective character areas;
step 2.2.3: determining a single character area and a sticky character area in all the effective character areas according to the effective character areas and a preset character attribute set, wherein the preset character attribute set comprises preset attribute characteristics of all characters;
step 2.2.4: obtaining a plurality of effective characters through a preset cutting rule according to the sticky character area;
step 2.2.5: and determining a single character corresponding to the single character area and a plurality of valid characters in the sticky character area as a plurality of valid characters corresponding to the verification code picture.
It can be understood that the preprocessing process of the training set data is consistent with the processing process of the picture to be recognized in the recognition process, so that the effective characters in the verification code picture can be determined quickly and efficiently, and the speed and the accuracy of subsequent model training are improved.
Based on the same inventive concept, an embodiment of the present specification further provides an apparatus for identifying a verification code picture, as shown in fig. 8, the apparatus includes:
the preprocessing module 100 is configured to perform binarization processing on a picture to be identified to obtain effective pixel points of the picture;
an effective character region generating module 200, configured to perform clustering on the effective pixel points to obtain mutually separated effective character regions;
a processing module 300, configured to determine a single character region and a sticky character region in all valid character regions according to the valid character regions and a preset character attribute set, where the preset character attribute set includes preset attribute features of all characters;
a cutting module 400, configured to obtain a plurality of valid characters according to the sticky character region by using a preset cutting rule;
the recognition module 500 is configured to obtain a recognition result of the picture to be recognized according to the single character corresponding to the single character region and the plurality of valid characters in the sticky character region in combination with a recognition model that is trained in advance.
The advantages obtained by the device are consistent with those obtained by the method, and the embodiments of the present description are not repeated.
As shown in fig. 9, for a computer device provided in this embodiment, the apparatus in this embodiment may be a computer device in this embodiment, and performs the method in this embodiment, and the computer device 902 may include one or more processors 904, such as one or more Central Processing Units (CPUs), each of which may implement one or more hardware threads. The computer device 902 may also include any memory 906 for storing any kind of information, such as code, settings, data, etc. For example, and without limitation, memory 906 may include any one or more of the following in combination: any type of RAM, any type of ROM, flash memory devices, hard disks, optical disks, etc. More generally, any memory may use any technology to store information. Further, any memory may provide volatile or non-volatile retention of information. Further, any memory may represent fixed or removable components of computer device 902. In one case, when the processor 904 executes the associated instructions, which are stored in any memory or combination of memories, the computer device 902 can perform any of the operations of the associated instructions. The computer device 902 also includes one or more drive mechanisms 908, such as a hard disk drive mechanism, an optical disk drive mechanism, etc., for interacting with any memory.
Computer device 902 may also include an input/output module 910(I/O) for receiving various inputs (via input device 912) and for providing various outputs (via output device 914)). One particular output mechanism may include a presentation device 916 and an associated Graphical User Interface (GUI) 918. In other embodiments, input/output module 910(I/O), input device 912, and output device 914 may also be excluded, acting as only one computer device in a network. Computer device 902 may also include one or more network interfaces 920 for exchanging data with other devices via one or more communication links 922. One or more communication buses 924 couple the above-described components together.
Communication link 922 may be implemented in any manner, such as over a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. Communication link 922 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.
Corresponding to the methods in fig. 2-5, the embodiments herein also provide a computer-readable storage medium having stored thereon a computer program, which, when executed by a processor, performs the steps of the above-described method.
Embodiments herein also provide computer readable instructions, wherein when executed by a processor, a program thereof causes the processor to perform the method as shown in fig. 2-5.
It should be understood that, in various embodiments herein, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments herein.
It should also be understood that, in the embodiments herein, the term "and/or" is only one kind of association relation describing an associated object, meaning that three kinds of relations may exist. For example, a and/or B, may represent: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided herein, it should be understood that the disclosed system, apparatus, and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments herein.
In addition, functional units in the embodiments herein may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present invention may be implemented in a form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The principles and embodiments of this document are explained herein using specific examples, which are presented only to aid in understanding the methods and their core concepts; meanwhile, for the general technical personnel in the field, according to the idea of this document, there may be changes in the concrete implementation and the application scope, in summary, this description should not be understood as the limitation of this document.

Claims (14)

1. A verification code picture identification method is characterized by comprising the following steps:
carrying out binarization processing on the picture to be identified to obtain effective pixel points of the picture;
clustering the effective pixel points to obtain mutually separated effective character areas;
determining a single character area and a sticky character area in all the effective character areas according to the effective character areas and a preset character attribute set, wherein the preset character attribute set comprises preset attribute characteristics of all characters;
obtaining a plurality of effective characters through a preset cutting rule according to the sticky character area;
and obtaining the recognition result of the picture to be recognized by combining a recognition model which is trained in advance according to the single character corresponding to the single character area and the plurality of effective characters in the sticky character area.
2. The method of claim 1, wherein the predetermined attribute characteristics include character height, character width, and number of character pixels;
determining a single character area and a sticky character area in all the effective character areas according to the effective character areas and a preset character attribute set, wherein the method comprises the following steps:
for each valid character area, the following steps are performed:
acquiring character features in the effective character area;
judging whether the character features in the effective character area fall within the range of preset attribute features in the preset character attribute set or not;
if yes, determining the effective character area as a single character area;
and if not, determining the effective character area as a sticky character area.
3. The method of claim 2, wherein the determining whether the character feature in the valid character region falls within a range of a preset attribute feature in the preset character attribute set further comprises:
judging whether the width of the effective character area exceeds the maximum value of the character width in the preset character attribute set or not;
if yes, determining the effective character area as a sticky character area;
if not, judging whether the ratio of the width to the height of the effective character area exceeds the maximum value of the ratio of the character width to the character height of a single character in the preset character attribute set;
if the ratio of the width to the height of the effective character area exceeds the maximum value of the ratio of the character width to the character height of a single character in the preset character attribute set, determining the effective character area as a sticky character area;
and if the ratio of the width to the height of the effective character area does not exceed the maximum value of the ratio of the character width to the character height of the single character in the preset character attribute set, determining the effective character area as the single character area.
4. The method of claim 3, wherein if the ratio of the width to the height of the valid character region does not exceed the maximum value of the ratio of the character width to the character height of the single character in the preset character attribute set, determining the valid character region as the single character region further comprises:
judging whether the number of pixel points in the effective character area exceeds the maximum value of the number of pixel points of a single character in the preset character attribute set;
if the number of pixel points in the effective character area exceeds the maximum value of the number of pixel points of a single character in the preset character attribute set, determining the effective character area as a sticky character area;
and if the number of pixel points in the effective character area does not exceed the maximum value of the number of pixel points of the single character in the preset character attribute set, determining the effective character area as the single character area.
5. The method according to claim 1, wherein obtaining a plurality of valid characters according to the sticky character region by a preset cutting rule comprises:
for each sticky character area the following steps are performed:
according to a vertical projection method, counting the number of pixel points in a preset unit interval of the sticky character area in the horizontal direction in sequence;
determining candidate cutting points of the sticky character area according to the variation trend of the number of pixel points in a preset unit interval of the sticky character area in the horizontal direction;
when the candidate cutting point is one, taking the candidate cutting point as a target cutting point;
when the candidate cutting points are multiple, obtaining multiple character features of a candidate region obtained by the multiple candidate cutting points, and screening a target cutting point from the multiple candidate cutting points through the multiple character features and a preset screening rule;
and cutting the sticky character area according to the target cutting point to obtain a plurality of cut effective characters.
6. The method according to claim 5, wherein the sequentially counting the number of pixels in the horizontal unit interval of the sticky character region according to a vertical projection method comprises:
determining a minimum character width from the preset character attribute set, and taking the minimum character width as an initial width of a designated window, wherein the designated window comprises a fixed end and a movable end;
placing a fixed end of the designated window on one side of the sticky character area and placing a moving end of the designated window on the other side of the sticky character area by the initial width;
moving the moving end towards one side far away from the fixed end in sequence by a preset unit interval;
and obtaining the number of pixel points of the sticky character area in the moving range of the mobile terminal.
7. The method according to claim 5, wherein the determining the candidate cut point of the sticky character region according to the variation trend of the number of pixels in a preset unit interval of the sticky character region in the horizontal direction comprises:
generating a change curve of the number of the pixel points according to the number of the pixel points in a unit interval preset in the horizontal direction in the sticky character area;
calculating to obtain the change slope of the pixel points in the change curve according to the change curve;
and determining the position of the pixel point change slope exceeding a preset value as a candidate cutting point of the sticky character area.
8. The method according to claim 5, wherein the determining the candidate cut point of the sticky character region according to a variation trend of the number of pixels in a preset unit interval of the sticky character region in a horizontal direction further comprises:
generating a change curve of the number of the pixel points according to the number of the pixel points in a unit interval preset in the horizontal direction in the sticky character area;
determining the positions of wave crests and wave troughs in the change curve according to the change curve;
and determining the valley position as a candidate cutting point of the sticky character area.
9. The method according to claim 5, wherein when the candidate cut points are multiple, acquiring multiple character features of a candidate region obtained from the multiple candidate cut points, and screening out a target cut point from the multiple candidate cut points by using the multiple character features in combination with a preset screening rule, includes:
determining a cutting position combination aiming at the sticky character area according to a plurality of candidate cutting points, wherein each cutting position in the cutting position combination comprises at least one candidate cutting point;
cutting the sticky character area according to the cutting position combination and the candidate cutting points in each cutting position to obtain a plurality of candidate areas corresponding to each cutting position;
counting character features in a plurality of candidate regions corresponding to each cutting position, wherein the character features at least comprise character width and the number of character pixel points;
determining the number of the candidate regions corresponding to each cutting position according to the character features, wherein the number of the candidate regions corresponds to a single character feature;
and determining candidate cutting points in the cutting positions corresponding to the plurality of candidate areas with the maximum number of the character features as target cutting points.
10. The method of claim 9, wherein determining, according to the character features, the number of the candidate regions corresponding to each cutting position that meet a single character feature comprises:
sequentially carrying out the following steps on a plurality of candidate regions corresponding to each cutting position:
judging whether the number of character pixel points in the candidate region exceeds the minimum value of the number of single character pixel points in the preset character attribute set or not;
if yes, continuing to judge that the character width in the candidate area is between the minimum value and the maximum value of the character width of a single character in the preset character attribute set;
if the character width in the candidate region is between the minimum value and the maximum value of the character width of a single character in the preset character attribute set, the candidate region conforms to the characteristic of the single character;
and determining the number of candidate areas which accord with the characteristics of the single character.
11. The method of claim 1, wherein the clustering the effective pixels to obtain mutually separated effective character regions comprises:
counting the number of pixels of the effective pixels in the picture to be identified in the vertical direction;
determining the position with the number of the pixel points being zero, and taking the position as a clustering segmentation point;
and according to the clustering partition points, the effective pixel points in the picture to be identified are partitioned to obtain mutually separated effective character areas.
12. An apparatus for identifying a verification code picture, the apparatus comprising:
the preprocessing module is used for carrying out binarization processing on the picture to be identified to obtain effective pixel points of the picture;
the effective character region generation module is used for clustering the effective pixel points to obtain mutually separated effective character regions;
the processing module is used for determining a single character area and a sticky character area in all the effective character areas according to the effective character areas and a preset character attribute set, wherein the preset character attribute set comprises preset attribute characteristics of all characters;
the cutting module is used for obtaining a plurality of effective characters according to the sticky character area through a preset cutting rule;
and the recognition module is used for obtaining a recognition result of the picture to be recognized by combining a recognition model which is trained in advance according to the single character corresponding to the single character area and the plurality of effective characters in the sticky character area.
13. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 11 when executing the computer program.
14. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the method of any one of claims 1 to 11.
CN202111263901.6A 2021-10-27 2021-10-27 Identifying method, device, equipment and storage medium for identifying verification code picture Pending CN114067324A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111263901.6A CN114067324A (en) 2021-10-27 2021-10-27 Identifying method, device, equipment and storage medium for identifying verification code picture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111263901.6A CN114067324A (en) 2021-10-27 2021-10-27 Identifying method, device, equipment and storage medium for identifying verification code picture

Publications (1)

Publication Number Publication Date
CN114067324A true CN114067324A (en) 2022-02-18

Family

ID=80235857

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111263901.6A Pending CN114067324A (en) 2021-10-27 2021-10-27 Identifying method, device, equipment and storage medium for identifying verification code picture

Country Status (1)

Country Link
CN (1) CN114067324A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117275013A (en) * 2023-08-25 2023-12-22 安徽以观文化科技有限公司 Chinese character stroke writing identification method on mobile terminal

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117275013A (en) * 2023-08-25 2023-12-22 安徽以观文化科技有限公司 Chinese character stroke writing identification method on mobile terminal
CN117275013B (en) * 2023-08-25 2024-05-14 安徽以观文化科技有限公司 Chinese character stroke writing identification method on mobile terminal

Similar Documents

Publication Publication Date Title
US20170140138A1 (en) Behavior based authentication for touch screen devices
CN110598686B (en) Invoice identification method, system, electronic equipment and medium
CN111640130A (en) Table reduction method and device
US20180089525A1 (en) Method for line and word segmentation for handwritten text images
CN110765891B (en) Engineering drawing identification method, electronic equipment and related product
CN110647896B (en) Phishing page identification method based on logo image and related equipment
CN113420756B (en) Identification method and device for certificate image, storage medium and electronic device
CN110796016A (en) Engineering drawing identification method, electronic equipment and related product
CN110795714A (en) Identity authentication method and device, computer equipment and storage medium
JP2017527894A (en) Managing user identification registration using handwriting
CN112988557A (en) Search box positioning method, data acquisition device and medium
CN114067324A (en) Identifying method, device, equipment and storage medium for identifying verification code picture
CN110765893A (en) Drawing file identification method, electronic equipment and related product
CN109101974B (en) Denoising method and denoising device for linear interference
CN110992139B (en) Bidding price realizing method and related product
CN112840622A (en) Pushing method and related product
CN113887375A (en) Text recognition method, device, equipment and storage medium
CN111104844B (en) Multi-invoice information input method and device, electronic equipment and storage medium
CN114663418A (en) Image processing method and device, storage medium and electronic equipment
CN113095313A (en) Text string recognition method and device and server
CN111914836A (en) Identity card information extraction method, device, equipment and medium
CN112001819A (en) Small-sized portable mistake and disorder prevention international trade contract scanning device and method
CN110502658B (en) Document image page number migration method, server and storage medium
CN114049646A (en) Bank card identification method and device, computer equipment and storage medium
US20230419715A1 (en) Detection of physical tampering on documents

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination