Method for identifying sliding puzzle verification codes

文档序号:190845 发布日期:2021-11-02 浏览:27次 中文

阅读说明:本技术 一种滑动拼图类验证码识别方法 (Method for identifying sliding puzzle verification codes ) 是由 易鑫 于 2020-05-01 设计创作,主要内容包括:本专利涉及验证码识别方法,主要为了解决现有技术的识别效率、准确率、成功率较低且未利用到左侧滑块坐标的问题。本发明首先获取验证码图像,其次根据预定义特征定位滑块,然后通过颜色特征、渐变特征、形状特征中的一项或多项匹配、定位缺口,再由数据随机分割、重组、按某种双随机规则对数据值增加或删减来模拟人手拖动轨迹完成验证。相比基于普通机器学习的方法,本发明不需要训练集、测试集,也不需要进行初始训练,减少了资源消耗,降低了滑动拼图类验证码识别的复杂性,具有较好的识别效果。(The patent relates to a verification code identification method, and mainly aims to solve the problems that the identification efficiency, accuracy and success rate are low and the left-side sliding block coordinate is not utilized in the prior art. The invention firstly obtains the verification code image, secondly positions the sliding block according to the predefined characteristic, then matches and positions the gap through one or more of the color characteristic, the gradient characteristic and the shape characteristic, and then simulates the hand dragging track to finish the verification by randomly dividing and recombining the data and increasing or deleting the data value according to a certain double random rule. Compared with the method based on common machine learning, the method does not need a training set and a testing set, does not need initial training, reduces resource consumption, reduces the complexity of identifying the sliding jigsaw type identifying code, and has better identification effect.)

1. A method for identifying a verification code of a sliding jigsaw puzzle type is characterized by comprising the following steps:

step 1, acquiring an image of a verification code to be detected;

step 2, scanning is carried out on the left side of the image, coordinates of the center point of a possible slide block in the row or a nearby area are located through one or more items of matching in color, shape and peripheral shadow gradual change, and redundant parts such as a white frame and a bottom option bar are removed;

step 3, after the possible coordinates are obtained in the step 2, matching is carried out on the right side of the pixel point region with similar or equal y-axis values through one or more of color features, gradient features and shape features, the coordinates of the center point of the possible target region are positioned, and the probability is calculated through the feature goodness of fit;

step 4, selecting the coordinate of a point with the maximum probability from the data obtained in the step 3;

and 5, segmenting and recombining the data of the human hand dragging trajectory according to a certain rule, deleting or adding the data according to a certain double random rule according to a required dragging distance to simulate the human hand dragging trajectory, and then controlling a cursor to try to verify.

2. The method for identifying the verification code of the sliding puzzle type according to claim 1, wherein: and 2, scanning the image, matching and positioning the coordinates of the center point of a possible slide block of the row or the adjacent area through one or more of color and shape, and removing redundant parts.

3. The method for identifying the verification code of the sliding puzzle type according to claim 1, wherein: and 3, after the possible coordinates are obtained in the step 2, matching is carried out on the right side of the pixel point region with similar or equal y-axis values through one or more of color features, gradient features and shape features, the coordinates of the center point of the possible target region are positioned, and the probability is calculated.

4. The method for identifying the verification code of the sliding puzzle type according to claim 1, wherein: and 4, selecting the coordinates of a point with the highest probability from the data obtained in the step 3.

5. The method for identifying the verification code of the sliding puzzle type according to claim 1, wherein: and 5, simulating a hand dragging track, and controlling a cursor to try to verify.

Technical Field

The invention relates to the technical field of communication, in particular to a verification code identification method.

Background

In the current internet application, the sliding jigsaw puzzle type verification code is widely applied. The sliding jigsaw type verification code comprises a base image and a sliding block, the sliding block is accurately spliced with a gap (hereinafter referred to as a target area) in the base image, and multi-dimensional judgment is carried out through splicing correctness, dragging track, data browsing and the like. But the employees of the company who need to use the authentication code in large quantities for a long time are fatigued.

The existing method for identifying the sliding jigsaw type verification code mainly has the problems of identification deviation, incapability of simulating real person dragging and no utilization of left side sliding block coordinates. Because the interference that the shape and the color are similar to the target area exists in the base map, the prior identification technology is easy to have misjudgment.

In summary, how to change the method for identifying the sliding puzzle type verification code in the prior art to improve the accuracy and success rate of identifying the sliding puzzle type verification code helps users to use computers more conveniently, promotes the healthy development of the verification code industry, and prompts verification code providers to simplify the verification process and optimize the verification mode is a problem to be considered by those skilled in the art.

Disclosure of Invention

The invention provides a method for identifying a sliding jigsaw type verification code, which can enable a user to log in after inputting a password and immediately judging, and solves the problems of low identification efficiency, accuracy and success rate in the prior art.

The invention provides a method for identifying a sliding jigsaw puzzle type verification code, which is characterized by comprising the following steps:

step 1, obtaining an image of a verification code to be detected.

Step 1.1, matching and positioning are carried out according to predefined colors and shapes, and then redundant parts of the non-verification code areas are discarded.

And 2, scanning the left side of the image line by line or line skipping, judging the coordinate value of the center point of a possible slide block in the line or the adjacent area through one or more items of color, shape and peripheral shadow gradual change, and removing redundant parts such as a white frame, a bottom option bar and the like.

And 2.1, scanning line by line to judge whether continuous yellow pixel points exist in the line (yellow is the color characteristic of the sliding block).

And 2.2, judging whether the found slide block has n depressions or bulges (n is more than or equal to 2 and less than or equal to 4).

And 2.3, judging that the shadow around the pattern gradually changes.

And 2.4, removing a dragging strip, a bottom option strip and a surrounding white frame below the image, and only keeping pixel points with y-axis values close to the judgment values.

And 3, after the possible coordinates are obtained in the step 2 or the determined coordinates are obtained in the additional step 1, matching is carried out on the right side of the pixel point region with similar or equal y-axis values through one or more of color features, gradient features and shape features, the coordinates of the center point of the possible target region are positioned, and the probability is calculated through the feature goodness of fit.

And 3.1, matching and positioning according to the characteristics of the target area with light middle and deep periphery, the whole color being deeper than that of the peripheral area and n depressions or protrusions (n is more than or equal to 2 and less than or equal to 4).

And 3.2, calculating the feature goodness of fit to obtain the probability.

And 4, selecting the coordinate value of the point with the highest probability from the data obtained in the step 3.

And 5, segmenting and recombining the data of the human hand dragging trajectory according to a certain rule, deleting or increasing the data value according to a certain double random rule according to the dragging distance required to simulate the human hand dragging trajectory, and then controlling the cursor to try to verify.

And 5.1, segmenting and recombining the track data dragged by the human hand according to a certain rule.

Step 5.2, dividing the probability for each numerical interval according to the proportion, and executing first re-randomization; a second random is performed within the value region.

Step 5.3, drag distance (g (x) = x) as requiredCenter point of target area-xCenter point of slide block) And step 5.2 is repeatedly executed, the track data value obtained in step 5.1 is adjusted for multiple times and slightly subtracted or increased each time, and finally the required dragging distance is reached, so that a group of data of 'time-cursor coordinates' is obtained.

And 5.4, controlling a cursor to drag a slider to try verification according to the track data obtained in the step 5.3.

Drawings

FIG. 1 is a drawing of the present invention: a flow chart of a sliding puzzle type verification code identification method (without additional steps 1, 1.1, 1.2).

Detailed Description

To better illustrate the objects and advantages of the present invention, embodiments of the method of the present invention are described in further detail below.

The above steps can already achieve a good recognition effect, but in order to achieve a more perfect effect, the following additional steps are added:

adding step 1, if the maximum value of the characteristic coincidence degree values obtained in step 2 is close to the second maximum value, then: and controlling the cursor to slightly drag the slider, acquiring the screen image again, comparing the two images, and obtaining the coordinate value of the y axis of the central point of the slider according to the change of the front image and the rear image.

And (4) adding step 1.1, controlling a cursor to drag the sliding block, moving for a proper distance, then obtaining the verification code image to be detected again, and not releasing the sliding block at the moment.

Adding step 1.2, making difference between RGB color values of each pixel block of two verification code images to be detected according to f (x) = (y)max+ymin) 2 (where yminAnd ymaxThe maximum and minimum values of the y-axis referring to the four vertices of the slider viewed as a quadrangle) to obtain the y-axis coordinate value of the slider center point.

And (2) adding step to judge whether the recognition result is correct.

And step 2.1 is added, and the result is judged by judging the color (divided into red, yellow and green) after the verification is tried.

And (3) adding a step, if the recognition result is correct or a correct answer is obtained through other ways, automatically optimizing the preset characteristics of the color, the shadow, the shape and the like in the step (2) and the step (3).

Additional steps 1, 1.1, 1.2 may be used between step 2.3 and step 2.4, additional steps 2, 2.1 may be used after step 5, and additional step 3 may be used after additional step 2.

1) The required verification code image to be tested is obtained from a hardware interface or an operating system interface and is irrelevant to the model of the computer.

2) After the slider is accurately positioned, the rest areas do not help the subsequent identification target area except the pixel point areas with similar y-axis values, and the pixel point areas are removed.

3) The term "eliminating redundant parts" as used herein refers to not participating in subsequent calculations.

4) Since data of "time-cursor coordinates" is required when performing the verification, all references to "coordinates" in this patent should be relative coordinates with respect to the screen edges.

5) The dragging of the sliding block is divided into two modes: the drag slider itself and the drag bar below the drag slider. The 'dragging slider' described in the additional steps 1 and 1.1 is the latter.

Advantageous effects

Compared with the method based on common machine learning, the method does not need a training set and a testing set, and does not need initial training, thereby reducing the resource consumption and the complexity of identifying the sliding jigsaw type identifying code.

The above detailed description is intended to illustrate the objects, aspects and advantages of the present invention, and it should be understood that the above detailed description is only exemplary of the present invention and is not intended to limit the scope of the present invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

6页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种单点登录跳转链接的安全保护方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类