Slider unlocking test method, device, computer equipment and storage medium

By extracting and processing the foreground pictures of the slider verification code on the APP side, obtaining the slider and notch coordinates, and generating unlocked test parameters, it solves the problem of automatic identification of slider verification code on the APP side, improving testing efficiency and reducing costs.

CN114996683BActive Publication Date: 2025-04-04SHANGHAI FAIRYLAND INFORMATION TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210407953.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-19
Publication Date
2025-04-04
Estimated Expiration
2042-04-19

AI Technical Summary

Technical Problem

The prior art is difficult to automatically identify the slider verification code on the APP side, resulting in high testing efficiency and cost.

Method used

By obtaining the foreground picture, extracting the verification code picture and slider picture, performing image processing to obtain the slider coordinates and gap coordinates, generating unlock test parameters, and realizing automatic recognition of the slider verification code.

Benefits of technology

Improves the automatic identification efficiency of slider verification codes and reduces testing costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114996683B_ABST
    Figure CN114996683B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data processing, and discloses a slider unlocking test method, device, computer equipment and storage medium, the method comprising: obtaining a foreground image for slider unlocking; extracting a verification code image and a slider image from the foreground image; performing image processing on the slider image to obtain the slider coordinates of the slider image; performing image comparison on the verification code image according to the slider coordinates to determine the gap coordinates of the verification code image; generating unlocking test parameters according to the slider coordinates and the gap coordinates. The present invention obtains the unlocking test parameters by means of graphic recognition, thereby realizing slider unlocking, and greatly improving the test efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software testing, and in particular to a slider unlocking testing method, device, computer equipment and storage medium. Background Art

[0002] Slider verification code is a common verification method in web pages, apps and other applications. Verification is completed by sliding the slider to the specified position according to certain rules. Existing slider verification code recognition is mostly used on the web side, and the main demand comes from web crawlers. The web version of the slider verification code recognition technology mainly obtains the complete verification code image and the verification code image with a gap based on the web page information, and finds the gap position by comparing the pixel value difference between the two images, so as to realize the automatic recognition of the slider verification code.

[0003] However, for some application scenarios, such as the slider verification code on the APP side, it is impossible to obtain the complete verification code image, so pixel value comparison is impossible. If manual unlocking is used, the test efficiency and test cost will be greatly reduced. Summary of the invention

[0004] Based on this, it is necessary to provide a slider unlocking test method, device, computer equipment and storage medium to address the above technical problems, so as to realize automatic recognition of slider verification codes and improve test efficiency.

[0005] A slider unlocking test method, comprising:

[0006] Get the foreground image used to unlock the slider;

[0007] Extracting a verification code image and a slider image from the foreground image;

[0008] Performing image processing on the slider image to obtain the slider coordinates of the slider image;

[0009] Performing image comparison on the verification code image according to the slider coordinates to determine the gap coordinates of the verification code image;

[0010] An unlocking test parameter is generated according to the slider coordinates and the notch coordinates.

[0011] A slide unlocking test device, comprising:

[0012] An acquisition module is used to obtain a foreground image for unlocking the slider;

[0013] An extraction module, used for extracting a verification code image and a slider image from the foreground image;

[0014] A slider coordinate module, used for performing image processing on the slider image to obtain the slider coordinates of the slider image;

[0015] A notch coordinate module, used for performing image comparison on the verification code image according to the slider coordinates to determine the notch coordinates of the verification code image;

[0016] The unlocking test module is used to generate unlocking test parameters according to the slider coordinates and the notch coordinates.

[0017] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned slider unlocking test method when executing the computer program.

[0018] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the slider unlocking test method is implemented.

[0019] The above-mentioned slider unlocking test method, device, computer equipment and storage medium obtain unlocking test parameters by means of graphic recognition, thereby realizing slider unlocking, which greatly improves the test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0021] Figure 1 is a schematic diagram of an application environment of a slider unlocking test method in an embodiment of the present invention;

[0022] Figure 2 is a flow chart of a slider unlocking test method according to an embodiment of the present invention;

[0023] Figure 3 is a full picture of the verification code in one embodiment of the present invention;

[0024] Figure 4 is a verification code image in an embodiment of the present invention;

[0025] Figure 5 is a slider image in one embodiment of the present invention;

[0026] Figure 6 It is a schematic diagram of setting a first detection frame and a second detection frame in a full verification code image in one embodiment of the present invention;

[0027] Figure 7 is a schematic diagram of the distribution of blocks related to HOG features in one embodiment of the present invention;

[0028] Figure 8 is a structural schematic diagram of a slider unlocking test device in one embodiment of the present invention;

[0029] Fig. 9 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0031] The account method provided in this embodiment can be applied in Figure 1 In an application environment, a user terminal communicates with a server through a network. The user terminal includes but is not limited to various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server can be implemented with an independent server or a server cluster consisting of multiple servers.

[0032] In one embodiment, if Figure 2 As shown, a slider unlocking test method is provided, which is applied in Figure 1 The server in is taken as an example to illustrate, including the following steps S10-S50.

[0033] S10. Obtain a foreground image for unlocking the slider.

[0034] Understandably, the foreground image may refer to a mobile phone screenshot containing the full image of the verification code. Figure 3 As shown, Figure 3 The foreground image may refer to a complete mobile phone screenshot (not shown) containing the above-mentioned full verification code image.

[0035] S20: extracting a verification code image and a slider image from the foreground image.

[0036] Understandably, the verification code image and the slider image can be extracted from the foreground image according to historical experience. Figure 4 and 5 As shown, Figure 4 This is a verification code image in an example. Figure 5 is a slider image in an example. The verification code image includes a gap to be filled and a gap image. The slider image includes a slider. When the slider is unlocked, the user slides the slider and the gap image moves accordingly. When the gap image overlaps with the filled gap, the unlocking is successful.

[0037] S30: Perform image processing on the slider image to obtain the slider coordinates of the slider image.

[0038] It is understandable that in the slider image, since the slider is significantly different from other parts of the image, the slider coordinates can be obtained by performing image processing on the slider image.

[0039] S40: performing image comparison on the verification code image according to the slider coordinates to determine the gap coordinates of the verification code image.

[0040] Understandably, in general, if Figure 6 As shown, the gap image and the slider have the same horizontal coordinate, and the gap image has the same vertical coordinate as the gap. Therefore, the horizontal coordinate of the gap coordinate can be used to slide along the vertical coordinate to intercept multiple first detection frames. For a certain first detection frame, the first detection frame is used as the starting point, and the window is slid along the horizontal coordinate to obtain the corresponding multiple second detection frames. The first detection frame can be compared with the second detection frame to calculate the similarity. When a second detection frame that is the same as the first detection frame is found, the coordinates of the second detection frame are the gap coordinates.

[0041] S50, generating unlocking test parameters according to the slider coordinates and the notch coordinates.

[0042] Understandably, after determining the slider coordinates and the notch coordinates, an unlock test parameter simulating a sliding screen operation can be generated. In one example, the unlock start point of the unlock test parameter is the slider coordinates, and the abscissa of the unlock end point is the abscissa of the notch coordinates.

[0043] This embodiment obtains unlocking test parameters by means of graphic recognition, thereby realizing slider unlocking, which greatly improves test efficiency.

[0044] Optionally, step S20, i.e., extracting a verification code image and a slider image from the foreground image, includes:

[0045] S201, intercepting the foreground image according to a preset interception rule to generate an intercepted image;

[0046] S202, binarizing the captured image, and then projecting it to obtain projection information;

[0047] S203, intercepting the foreground image according to the projection information to generate a full verification code image;

[0048] S204: Segment the verification code full image into the verification code image and the slider image according to a preset segmentation rule.

[0049] Understandably, the preset interception rules can be set according to actual needs. In general, the preset interception rules can be formulated based on the setting characteristics of the slider unlocking. For example, the pixel values ​​in the range of 0.1*H (screen height) above and below the foreground image are relatively high, which is not conducive to binarization. The image in this range is intercepted to obtain the intercepted image.

[0050] After obtaining the captured image, a binarization operation is performed immediately, and the binarized image is horizontally and vertically projected to obtain projection information. After obtaining the projection information, the foreground image can be captured based on the projection information to generate the full verification code image. Through binarization and projection, the non-verification code part of the screenshot is cleared.

[0051] Usually, there is a certain pattern between the position of the verification code image and the slider image, such as the slider image is below the verification code image. The above preset segmentation rules can be set based on the actual situation, and then the verification code full image ( Figure 3 ) is split into verification code images ( Figure 4 ) and Slider Image ( Figure 5 ).

[0052] Optionally, step S30, i.e., performing image processing on the slider image to obtain the slider coordinates of the slider image, includes:

[0053] S301, converting the slider image into an HSV image, performing Gaussian filtering on the saturation channel of the HSV image, and then performing a binarization operation to generate a binarized slider image;

[0054] S302, performing an expansion operation on the binary slider image through a kernel of preset specifications to obtain an expanded image;

[0055] S303, extracting connected domains from the dilated image, and determining connected domains that meet a preset selection criterion as sliders;

[0056] S304: Generate the slider coordinates based on the slider coordinates.

[0057] Understandably, the slider image can be converted into an HSV (Hue, Saturation, Value) image, and then the saturation channel of the HSV image is Gaussian filtered, and then binarized to generate a binary slider image. Use a kernel of preset specifications to perform an expansion operation on the binary slider image to obtain an expanded image. The preset specification can be 3*8px. The number of expansion operations can be set according to actual needs, such as twice. Then, the connected domain is extracted from the expanded image, and the connected domain that meets the preset selection criteria is determined as a slider. The coordinates of the slider are the slider coordinates. The preset selection criteria can be set according to actual conditions.

[0058] Optionally, the preset selection criteria include: being at a specified position of the expanded image and having an area greater than a specified area threshold.

[0059] Understandably, the preset selection criteria may be: 1. being located at a specified position of the dilated image, such as being located at the left side of the image; 2. the area of ​​the connected domain is greater than a specified area threshold, such as the specified area threshold may be 100.

[0060] Optionally, step S40, i.e., performing image comparison on the verification code image according to the slider coordinates to determine the gap coordinates of the verification code image, includes:

[0061] S401, taking the first coordinate of the slider coordinate as a starting point, sliding the window along a first direction with a first step length, to obtain a plurality of first detection frames;

[0062] S402, starting from the first detection frame, sliding a window along a second direction with a second step length to obtain a plurality of second detection frames corresponding to the first detection frame; the first direction is perpendicular to the second direction;

[0063] S403, calculating the similarity between the first detection frame and the second detection frame to determine the same detection frame pair with the highest similarity;

[0064] S404: Determine the gap coordinates according to the coordinates of the second detection frame in the same detection frame pair.

[0065] Understandably, if Figure 6 As shown, the gap image and the slider have the same horizontal coordinate, and the gap image and the gap have the same vertical coordinate. Therefore, the first coordinate of the gap coordinate ( Figure 6 Example is the horizontal axis), take the first step along the first direction ( Figure 6 The example is a vertical axis direction) sliding window, intercepting multiple first detection frames. The first step length can be set according to actual needs. The first detection frame refers to the selection frame arranged along the vertical direction (that is, the image intercepted in the frame).

[0066] For a first detection frame, take the first detection frame as the starting point and move along the second direction ( Figure 6The example is the horizontal axis direction) to obtain the corresponding multiple second detection frames. The first detection frame can be compared with the second detection frame to calculate the similarity. If the number of first detection frames is M, and one first detection frame corresponds to N second detection frames, then the number of second detection frames is M*N. If the second detection frame is only compared with the corresponding first detection frame, M*N similarities can be obtained. The highest similarity can be selected from them, and the first detection frame and the second detection frame corresponding to the highest similarity are the same detection frame pair. In other words, the gap is in the second detection frame in the same detection frame pair. Therefore, the gap coordinates can be determined according to the coordinates of the second detection frame in the same detection frame pair. The second step size can be set according to actual needs. The second detection frame refers to the selection box arranged horizontally (except the first detection frame).

[0067] It should be noted that the first direction and the second direction can be set according to actual needs. For example, if the slider slides up and down, the first direction can be the horizontal coordinate direction, and the second direction can be the vertical coordinate direction.

[0068] Optionally, step S403, i.e., calculating the similarity between the first detection frame and the second detection frame to determine an identical detection frame pair with the highest similarity, includes:

[0069] S4031, extracting a first HOG feature of the first detection frame; extracting a second HOG feature of the second detection frame;

[0070] S4032: Calculate the similarity according to the first HOG feature and the second HOG feature.

[0071] It can be understood that the HOG (Histogram of Oriented Gradient) algorithm can be used to extract corresponding HOG features from the first detection box and the second detection box.

[0072] In the HOG algorithm, the horizontal and vertical gradients of each pixel of a digital image (both the first detection box and the second detection box belong to the digital image) can be calculated by kernels. The calculation formula is as follows:

[0073] G(x,y)=d x (x,y)+d y (x,y)

[0074] d x (x,y)=I(x+1,y)-I(x,y)

[0075] d y (x,y)=I(x,y+1)-I(x,y)

[0076] Among them, G(x,y) is the gradient of the coordinate point (x,y), d x (x,y) is the pixel difference in the x direction, d y (x,y) is the pixel difference in the y direction.

[0077] The magnitude and direction of each pixel gradient can be expressed as:

[0078]

[0079]

[0080] From this, a gradient image can be constructed. The gradient image removes unnecessary information and highlights the contours. At each pixel, the gradient has a magnitude and a direction. For a color image, the gradients of all three channels will be calculated, and the gradient value of the image pixel is the largest gradient value among the three channels, and the angle is also the largest angle.

[0081] When calculating HOG features, three features are involved: win, block, and cell. Assuming that the size of the detection window in the digital image is 64×64, the size of the given block is 16×16, and the block step is (8,8), after calculation: the detection window slides 7×7=49 blocks in total. Selecting a cell in a block and no longer sliding, the size of the given cell unit is (8,8), so there are a total of 2×2=4 cells in a block.

[0082] HOG constructs the directional gradient histogram in the cell, and the number of bins determines the range of directions. Assume that a 9-bin histogram is used to count the gradient information of the 8×8 pixel cell, that is, the cell gradient direction 0 to 180 degrees (or 0 to 360 degrees, considering positive and negative, signed) is divided into 9 directional blocks. Figure 7 As shown, if the gradient direction of this pixel is 20-40 degrees, the count of the second bin of the histogram will be increased by 1. In this way, the gradient direction of each pixel in the cell is weightedly projected in the histogram and mapped to the corresponding angle range block, and the gradient direction histogram of this cell can be obtained, which is the 9-dimensional feature vector corresponding to the cell (because there are 9 bins). The weight used in the weighted projection here is the gradient amplitude of the current point. For example: if the gradient direction of a pixel is 20-40 degrees and its gradient amplitude is 4, then the count of the second bin of the histogram is not increased by 1, but by 4. In this way, a weighted histogram about the gradient direction is obtained.

[0083] The number of direction ranges in a cell is determined by bins. For example, there are 9 vectors in a cell. In a detection window of size 64×64, the dimension of the descriptor should be: 9×4×49=1764. 4 is the number of cells in a block, and 49 is the number of blocks in a win.

[0084] Optionally, in step S4031, extracting the second HOG feature of the second detection frame includes:

[0085] S40311, performing brightening processing on the second detection frame to obtain a brightened image;

[0086] S40312. Perform feature extraction on the brightened image to obtain the second HOG feature.

[0087] Understandably, from Figure 6 It can be seen that the brightness of the gap (on the right) is lower than that of the gap image (on the left). Therefore, the second detection frame can be appropriately brightened to obtain a brightened image, and then the second HOG feature can be extracted from the brightened image. The brightness can be set according to actual needs.

[0088] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0089] In one embodiment, a slider unlocking test device is provided, and the slider unlocking test device corresponds to the slider unlocking test method in the above embodiment. Figure 8 As shown, the slider unlocking test device includes an acquisition module 10, an extraction module 20, a slider coordinate module 30, a notch coordinate module 40 and an unlocking test module 50. The functional modules are described in detail as follows:

[0090] An acquisition module 10, used to acquire a foreground image for unlocking the slider;

[0091] An extraction module 20, used for extracting a verification code image and a slider image from the foreground image;

[0092] The slider coordinate module 30 is used to perform image processing on the slider image to obtain the slider coordinates of the slider image;

[0093] A notch coordinate module 40 is used to perform image comparison on the verification code image according to the slider coordinates to determine the notch coordinates of the verification code image;

[0094] The unlocking test module 50 is used to generate unlocking test parameters according to the slider coordinates and the notch coordinates.

[0095] Optionally, the extraction module 20 includes:

[0096] A capture unit, configured to capture the foreground image according to a preset capture rule to generate a captured image;

[0097] A projection unit, used for binarizing the captured image and then projecting it to obtain projection information;

[0098] A verification code full image generating unit, used for intercepting the foreground image according to the projection information to generate a verification code full image;

[0099] The segmentation unit is used to segment the verification code full image into the verification code image and the slider image according to a preset segmentation rule.

[0100] Optionally, the slider coordinate module 30 includes:

[0101] A binarization unit, used to convert the slider image into an HSV image, perform Gaussian filtering on the saturation channel of the HSV image, and then perform a binarization operation to generate a binarized slider image;

[0102] An expansion unit, used for performing an expansion operation on the binary slider image through a kernel of preset specifications to obtain an expanded image;

[0103] A connected domain extraction unit, used to extract connected domains from the dilated image, and determine connected domains that meet a preset selection criterion as sliders;

[0104] The slider coordinate generating unit is used to generate the slider coordinate based on the slider coordinate.

[0105] Optionally, the preset selection criteria include: being at a specified position of the expanded image and having an area greater than a specified area threshold.

[0106] Optionally, the notch coordinate module 40 includes:

[0107] A first detection frame unit, configured to take the first coordinate of the slider coordinate as a starting point and perform sliding along a first direction with a first step length to obtain a plurality of first detection frames;

[0108] A second detection frame unit, configured to take the first detection frame as a starting point and perform a sliding window along a second direction with a second step length to obtain a plurality of second detection frames corresponding to the first detection frame; the first direction is perpendicular to the second direction;

[0109] a same detection frame pair determination unit, configured to calculate a similarity between the first detection frame and the second detection frame to determine a same detection frame pair with the highest similarity;

[0110] The notch coordinate determining unit is used to determine the notch coordinates according to the coordinates of the second detection frame in the same detection frame pair.

[0111] Optionally, determining the same detection box pair unit includes:

[0112] An HOG feature extraction unit is used to extract a first HOG feature of the first detection frame; and extract a second HOG feature of the second detection frame;

[0113] A similarity calculation unit is used to calculate the similarity according to the first HOG feature and the second HOG feature.

[0114] Optionally, extracting the HOG feature unit includes:

[0115] A brightening unit, used for brightening the second detection frame to obtain a brightened image;

[0116] A second HOG feature unit is obtained, which is used to perform feature extraction on the brightened image to obtain the second HOG feature.

[0117] The specific definition of the slider unlocking test device can be found in the definition of the slider unlocking test method above, which will not be repeated here. Each module in the above slider unlocking test device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0118] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store methods involved in the slider unlocking test method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a slider unlocking test method is implemented.

[0119] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0120] Get the foreground image used to unlock the slider;

[0121] Extracting a verification code image and a slider image from the foreground image;

[0122] Performing image processing on the slider image to obtain the slider coordinates of the slider image;

[0123] Performing image comparison on the verification code image according to the slider coordinates to determine the gap coordinates of the verification code image;

[0124] An unlocking test parameter is generated according to the slider coordinates and the notch coordinates.

[0125] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0126] Get the foreground image used to unlock the slider;

[0127] Extracting a verification code image and a slider image from the foreground image;

[0128] Performing image processing on the slider image to obtain the slider coordinates of the slider image;

[0129] Performing image comparison on the verification code image according to the slider coordinates to determine the gap coordinates of the verification code image;

[0130] An unlocking test parameter is generated according to the slider coordinates and the notch coordinates.

[0131] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0132] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A slider unlocking test method, characterized in that: include: Get the foreground image used to unlock the slider; Extracting a verification code image and a slider image from the foreground image; Performing image processing on the slider image to obtain the slider coordinates of the slider image; Performing image comparison on the verification code image according to the slider coordinates to determine the gap coordinates of the verification code image; Generate unlocking test parameters according to the slider coordinates and the notch coordinates; The performing image comparison on the verification code image according to the slider coordinates to determine the gap coordinates of the verification code image includes: Taking the first coordinate of the slider coordinate as a starting point, sliding the window along the first direction with a first step length to obtain a plurality of first detection frames; Taking the first detection frame as a starting point, sliding a window along a second direction with a second step length to obtain a plurality of second detection frames corresponding to the first detection frame; the first direction is perpendicular to the second direction; Calculating the similarity between the first detection frame and the second detection frame to determine the same detection frame pair with the highest similarity; The gap coordinates are determined according to the coordinates of the second detection frame in the same detection frame pair.

2. The slider unlocking test method according to claim 1, characterized in that: The step of extracting the verification code image and the slider image from the foreground image includes: Intercepting the foreground image according to a preset interception rule to generate an intercepted image; Binarizing the captured image and then projecting it to obtain projection information; The foreground image is intercepted according to the projection information to generate a full verification code image; The verification code full image is divided into the verification code image and the slider image according to a preset segmentation rule.

3. The slider unlocking test method according to claim 1, characterized in that: The performing image processing on the slider image to obtain the slider coordinates of the slider image includes: Convert the slider image into an HSV image, perform Gaussian filtering on the saturation channel of the HSV image, and then perform a binarization operation to generate a binarized slider image; Performing an expansion operation on the binary slider image through a kernel of preset specifications to obtain an expanded image; Extracting connected domains from the dilated image, and determining connected domains that meet a preset selection criterion as sliders; The slider coordinates are generated based on the coordinates of the slider.

4. The slider unlocking test method according to claim 3, characterized in that: The preset selection criteria include: being at a specified position of the expanded image and having an area greater than a specified area threshold.

5. The slider unlocking test method according to claim 1, characterized in that: The calculating the similarity between the first detection frame and the second detection frame to determine the same detection frame pair with the highest similarity includes: Extracting a first HOG feature of the first detection frame; extracting a second HOG feature of the second detection frame; The similarity is calculated according to the first HOG feature and the second HOG feature.

6. The slider unlocking test method according to claim 5, characterized in that: The extracting the second HOG feature of the second detection frame includes: Performing brightening processing on the second detection frame to obtain a brightened image; Perform feature extraction on the brightened image to obtain the second HOG feature.

7. A slider unlocking test device, characterized in that: include: An acquisition module is used to obtain a foreground image for unlocking the slider; An extraction module, used for extracting a verification code image and a slider image from the foreground image; A slider coordinate module, used for performing image processing on the slider image to obtain the slider coordinates of the slider image; A notch coordinate module, used for performing image comparison on the verification code image according to the slider coordinates to determine the notch coordinates of the verification code image; An unlocking test module, used for generating unlocking test parameters according to the slider coordinates and the notch coordinates; The gap coordinate module includes: A first detection frame unit, configured to take the first coordinate of the slider coordinate as a starting point and perform sliding along a first direction with a first step length to obtain a plurality of first detection frames; A second detection frame unit, configured to take the first detection frame as a starting point and perform a sliding window along a second direction with a second step length to obtain a plurality of second detection frames corresponding to the first detection frame; the first direction is perpendicular to the second direction; a same detection frame pair determination unit, configured to calculate a similarity between the first detection frame and the second detection frame to determine a same detection frame pair with the highest similarity; The notch coordinate determining unit is used to determine the notch coordinates according to the coordinates of the second detection frame in the same detection frame pair.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the slider unlocking test method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the slider unlocking test method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • An image matching method and device

    CN109685142A

  • Sliding block verification code verification method and device, storage medium and computer equipment

    CN110427746A

  • Sliding verification code notch positioning method and device

    CN111681280A

  • Traffic sign intelligent identification method and system

    CN112101283A