Automatic verification method, device and equipment for sliding block, storage medium and product
Automatically detect slider position and gap position through image processing technology, and automatic slider verification is performed in combination with the personification curve, which solves the problem of slow slider automatic verification speed in the existing technology, and realizes a more efficient and intelligent verification method.
Patent Information
- Application Number
- CN202510669900.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-08-29
AI Technical Summary
The existing slider automatic verification method is low in speed, and the existing solutions rely on web page element picking and simulating mouse operations, making it difficult to simulate the diversity and randomness of human operations, resulting in low verification speed and easy to be seen through.
By obtaining the image to be verified, the slider position is automatically detected based on image processing technology, the gap position is determined using Hough transformation and template matching technology, and the slider is automatically verified through the personification operation curve, reducing the dependence on web page element picking and simulating the diversity and randomness of human operations.
It improves the success rate and user experience of automatic slider verification, realizes a more efficient automated verification process, reduces the impact of image confusion, and improves verification accuracy and speed.
Smart Images

Figure CN120561908A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image verification technology, and in particular to a slider automatic verification method, device, equipment, storage medium and product. Background Art
[0002] Slider behavior verification is a common verification mechanism used on graphical web pages and applications to distinguish between human users and automated programs (such as robots or crawlers), thereby improving website security. This verification method typically requires the user to complete a drag-and-drop action—dragging a slider to a specified position, such as filling a gap or aligning a puzzle piece. This behavioral verification mechanism is based on the assumption that real human users can easily recognize and perform such drag-and-drop tasks, while automated programs find it difficult to accurately simulate such human actions.
[0003] Existing automated solutions typically attempt to pass this type of verification by combining web page element picking technology with simulated mouse operations. These automated solutions analyze web page code to locate slider elements, then write scripts to simulate mouse events (such as clicks and drags) to operate the slider to complete verification. Although this method can simulate human operations to a certain extent, it has limitations in application scenarios. For example, in many scenarios, the inability to pick elements will cause subsequent operations to stagnate. Furthermore, this method ignores the diversity and randomness of human operations, such as different drag speeds and trajectory fluctuations, resulting in a slow slider verification speed. Summary of the Invention
[0004] The main purpose of this application is to provide a slider automatic verification method, device, equipment, storage medium and product, aiming to solve the current technical problem of low speed of slider automatic verification.
[0005] To achieve the above objectives, the present application proposes a slider automatic verification method, which includes:
[0006] Obtaining a picture to be verified, and automatically detecting the slider based on the picture to be verified to obtain the slider position;
[0007] Obtaining a gap background image based on the image to be verified;
[0008] Performing template matching based on the slider position and the gap background image to obtain the gap position matched by the slider;
[0009] Automatic slider verification is performed using a target operating curve according to the slider position and the notch position.
[0010] In one embodiment, the step of obtaining the image to be verified and automatically detecting the slider based on the image to be verified to obtain the position of the slider includes:
[0011] Setting a predetermined area of the slider according to the image to be verified;
[0012] Performing edge detection on a predetermined area of the slider to obtain a contour map;
[0013] Based on the contour map, Hough transform line detection is used to obtain the slider position.
[0014] In one embodiment, the step of obtaining the slider position by using Hough transform line detection based on the contour map includes:
[0015] Obtaining Hough transform parameters, where the Hough transform parameters include horizontal parameters and vertical parameters;
[0016] Performing straight line detection on the contour image based on the Hough transform parameters to obtain a horizontal straight line and a vertical straight line;
[0017] Calculate the intersection of the horizontal straight line and the vertical straight line;
[0018] Predict the slider rectangle using a preset constraint strategy based on the distribution and location of the line intersections;
[0019] The slider position is obtained according to the slider rectangular frame.
[0020] In one embodiment, the step of obtaining the slider position by using Hough transform line detection based on the contour map includes:
[0021] Obtaining Hough transform parameters, where the Hough transform parameters include horizontal parameters and vertical parameters;
[0022] Performing straight line detection on the contour image based on the Hough transform parameters to obtain a horizontal straight line and a vertical straight line;
[0023] Calculate the intersection of the horizontal straight line and the vertical straight line;
[0024] Predict the slider rectangle using a preset constraint strategy based on the distribution and location of the line intersections;
[0025] The slider position is obtained according to the slider rectangular frame.
[0026] In one embodiment, before the step of performing template matching based on the slider edge binary image and the background edge binary image to obtain the notch position of the slider matching, the step further includes:
[0027] Setting an original matching template, and performing scale fluctuation on the original matching template to obtain a multi-scale template;
[0028] Setting a region of interest for the multi-scale template to obtain a template matching range;
[0029] The multi-scale template is adjusted according to the template matching range to construct a template matching library.
[0030] In one embodiment, the step of automatically verifying the slider using a target operating curve according to the slider position and the notch position includes:
[0031] Acquire preset noise and count slider verification data of manual operation, wherein the slider verification data includes the number of slider verifications and the dragging distance of the slider verification;
[0032] Establishing a distance-time curve according to the number of slider verifications and the dragging distance;
[0033] constructing a target operating curve based on the distance-time curve and the preset noise;
[0034] Obtaining a sliding distance according to the position of the slider and the position of the notch;
[0035] obtaining a sliding operation curve according to the sliding distance and the target operation curve;
[0036] The slider is controlled according to the sliding operation curve to perform automatic slider verification.
[0037] In addition, to achieve the above-mentioned purpose, the present application also proposes a slider automatic verification device, which includes:
[0038] An acquisition module, configured to acquire a picture to be verified, and automatically detect the slider based on the picture to be verified to obtain a position of the slider;
[0039] The acquisition module is further configured to obtain a gap background image based on the image to be verified;
[0040] A matching module, configured to perform template matching based on the slider position and the gap background image to obtain a gap position matched by the slider;
[0041] The verification module is used to automatically verify the slider using a target operating curve according to the slider position and the notch position.
[0042] In addition, to achieve the above-mentioned purpose, the present application also proposes a slider automatic verification device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the slider automatic verification method described above.
[0043] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium and stores a computer program. When the computer program is executed by a processor, the steps of the slider automatic verification method described above are implemented.
[0044] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the slider automatic verification method as described above are implemented.
[0045] One or more technical solutions proposed in this application obtain an image to be verified and automatically detect the slider based on the image to be verified to obtain the slider position; obtain a gap background image based on the image to be verified; perform template matching based on the slider position and the gap background image to obtain the gap position matched by the slider; and automatically verify the slider using a target operating curve based on the slider position and the gap position. Compared to existing verification solutions, the current solution is more intelligent and automated. Users no longer need to rely on element picking in the webpage source code to obtain slider position information. Template matching is used to match the gap position, reducing the impact of confusing images and ensuring verification accuracy. Furthermore, the target operating curve is used during automatic slider verification, improving the success rate and user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0048] Figure 1 A flowchart of the first embodiment of the automatic slider verification method of the present application is provided;
[0049] Figure 2 A flowchart of the second embodiment of the automatic slider verification method of this application is provided;
[0050] Figure 3 This is a schematic diagram of obtaining the position of a slider by template matching in an embodiment of the slider automatic verification method of the present application;
[0051] Figure 4 This is a schematic diagram of obtaining the slider position by Hough transform in an embodiment of the slider automatic verification method of the present application;
[0052] Figure 5 This is a flowchart of the third embodiment of the automatic slider verification method of this application;
[0053] Figure 6 This is a schematic diagram of a multi-scale template after mesoscale fluctuation in an embodiment of the slider automatic verification method of this application;
[0054] Figure 7 This is a schematic diagram showing a comparison between the original template matching range and the template matching range after ROI setting in an embodiment of the slider automatic verification method of the present application;
[0055] Figure 8 This is a schematic diagram of the process of matching the slider and the notch in an embodiment of the slider automatic verification method of the present application;
[0056] Figure 9 A flowchart of the fourth embodiment of the automatic slider verification method of the present application is provided;
[0057] Figure 10 This is a schematic diagram of a target operation curve in an embodiment of the slider automatic verification method of this application;
[0058] Figure 11 This is a schematic diagram of the module structure of the automatic slider verification device according to an embodiment of the present application;
[0059] Figure 12 Schematic diagram of the device structure of the hardware operating environment involved in the automatic slider verification method in the embodiment of the present application.
[0060] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0061] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.
[0062] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0063] The main solution of the embodiment of the present application is: obtain the picture to be verified, and automatically detect the slider based on the picture to be verified to obtain the slider position; obtain the gap background image based on the picture to be verified; perform template matching based on the slider position and the gap background image to obtain the gap position matched by the slider; and use the target operation curve to automatically verify the slider according to the slider position and the gap position.
[0064] The first step in existing slider automatic verification algorithms involves distance calculation. This typically involves obtaining the slider's position and shape by picking up web page elements or user input. Then, by detecting the contours and using template matching, the slider is matched to the gap. This method has limitations. Most non-webpage scenarios don't provide a slider element to pick up, yet locating the slider is essential for automated processes. This limitation can stall the entire process and require manual positioning, significantly slowing verification speed. After calculating the sliding distance, current solutions use scripts to control mouse operations, simulating the human process of "clicking the slider, dragging it to the desired position, and releasing it" to complete slider verification. This approach, which directly stitches together individual operations, is simple but easily detected by human-machine verification. Human movement often involves various noise factors, such as speed fluctuations and back-and-forth swinging, while script-controlled movement maintains consistent speed and direction. The verification backend, by distinguishing the degree of human-likeness in the operation, prevents the script from passing verification. To address this issue, some workarounds have emerged, such as segmenting the sliding process and setting different speeds and accelerations to deceive the verification backend. However, this still results in a significant probability of failure.
[0065] This application provides a solution that fully automates the initial positioning of the slider by introducing solutions such as Hough transform and template pre-positioning. The slider is then matched to the gap through template matching to obtain the sliding distance. The input modality of the entire process is an image, which makes up for the disadvantage of not being able to obtain the sliding distance due to missing picked elements. It is more robust and can greatly improve the smoothness of the process. By statistically analyzing human operations, an anthropomorphic operation curve is obtained, and then noise is superimposed to complete the final drag operation, making it impossible for background verification to distinguish, further improving the success rate and user experience.
[0066] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, mobile phone, etc., or an electronic device capable of implementing the above functions, a slider automatic verification device, a terminal server, etc. The following uses a terminal server as an example to illustrate this embodiment and the following embodiments.
[0067] Based on this, the embodiment of the present application provides a slider automatic verification method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the automatic slider verification method of the present application.
[0068] In this embodiment, the slider automatic verification method includes steps S10 to S40:
[0069] Step S10: obtaining a picture to be verified, and automatically detecting the slider based on the picture to be verified to obtain the position of the slider.
[0070] It should be noted that when logging in normally manually, you can press and drag the arrow button, and the puzzle slider will move to the right along with the button. When the slider moves to the gap, release the mouse and the verification will be completed.
[0071] The image to be verified may be an image used for website or application verification, and may include a slider, a drag button, and a notch.
[0072] In a specific implementation, image recognition can be performed on the image to be verified to obtain the position of the slider on the image to be verified, that is, the slider position. The slider position is the original position of the slider when it is not sliding. The slider position can be obtained by representing a rectangular box with four coordinates.
[0073] The automatic detection of the slider may be performed using an automatic slider position acquisition algorithm, including a template matching method or a Hough transform detection method. The slider is automatically detected by the automatic slider position acquisition algorithm to obtain the slider position.
[0074] Step S20: obtaining a gap background image based on the image to be verified.
[0075] It should be noted that the gap background image is a background image containing a gap in the image to be verified.
[0076] Step S30: performing template matching based on the slider position and the gap background image to obtain the gap position matched by the slider.
[0077] In specific implementation, after the slider position is confirmed, the slider and the gap need to be matched. Therefore, the corresponding gap can be matched on the gap background image through the slider position. Specifically, the precise gap position corresponding to the slider can be obtained through the template matching algorithm.
[0078] Step S40: Automatically verifying the slider using a target operating curve according to the slider position and the notch position.
[0079] It's understandable that the target operation curve is a statistically validated anthropomorphic curve for slider operation. This simulates a human sliding operation of a specified distance, determining the sliding distance based on the slider's position and the notch's position. The slider is then automatically verified based on the target operation curve. Compared to existing direct or segmented sliding methods, this approach is easier to verify with the backend and eliminates the need for time-consuming models. It also requires fewer deployment requirements than existing methods that use models to generate sliding functions, further improving success rates and user experience.
[0080] This embodiment provides a method for automatic slider verification. The method obtains an image to be verified and automatically detects the slider based on the image to determine the slider position. A gap background image is obtained based on the image to be verified. Template matching is performed based on the slider position and the gap background image to determine the gap position for the slider. Finally, the method automatically verifies the slider using a target operating curve based on the slider position and the gap position. Compared to existing verification schemes, the current scheme is more intelligent and automated. Users no longer rely on element extraction from webpage source code to obtain slider position information. Template matching is used to match the gap position, reducing the impact of confusing images and ensuring verification accuracy. Furthermore, the target operating curve is used during automatic slider verification, improving success rates and user experience.
[0081] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 2 , step S10 includes steps S101 to S103:
[0082] Step S101: setting a predetermined area of a slider according to the image to be verified.
[0083] It's important to note that to cover as many business scenarios as possible, the slider is input as an image modal. This aligns with human perception, as people visually confirm the slider's position. If the application is a web version with access to the front-end source code, the slider's position can be obtained using the div component. However, most websites now hide the slider element, and all applications don't open their front-end source code. Therefore, two algorithms based on digital image processing technology were designed to obtain the slider's position. After entering the image to be verified, the first step is to set the slider's intended area—the area where the slider will appear.
[0084] Step S102: performing edge detection on the predetermined area of the slider to obtain a contour map.
[0085] In a specific implementation, edge detection can be performed on the predetermined area of the slider. The edge detection can use the Canny operator (image edge detection operator) or other edge detection algorithms. This embodiment is not limited to this. This embodiment uses the Canny operator as an example to illustrate that the edge detection is performed on the predetermined area of the slider through the Canny operator to obtain a contour map of the entire area.
[0086] It should be noted that after obtaining the contour image, the slider position can be detected using template matching or Hough transform. Template matching matches the contour information with the slider template provided by the user to ultimately obtain the slider's position within the entire image. This method is suitable for scenarios where the slider shape has not changed after multiple verifications. Compared to other detection solutions, it is more accurate and faster, and effectively supplements solutions where elements cannot be picked up. For example, the sliders of websites and applications will not change shape in a short period of time, so a slider contour template can be pre-set to match the corresponding area to obtain the slider position, such as Figure 3 As shown, Figure 3 Schematic diagram of obtaining the slider position for template matching. First, input the full image to be verified and set the slider predetermined area. Perform Canny edge detection on the slider predetermined area to obtain the contour map. Then use the provided slider template for template matching to obtain the slider position.
[0087] Step S103: Using Hough transform line detection based on the contour map to obtain the slider position.
[0088] It is understandable that in the absence of a slider template, detection can be performed based on the slider's digital image characteristics. Therefore, Hough transform line detection can be used to process the contour image to determine the slider position. Edge detection is first used to obtain the edge lines of the slider area, and then a Hough transform is applied to obtain the straight line portions within them. This circumscribed rectangle of the slider boundary is then used to determine the slider position. This method is resistant to most image interference and can eliminate the need for manual intervention even when elements cannot be picked up in non-webpage scenarios, improving automation efficiency.
[0089] In a feasible implementation, step S103 may include steps A11 to A15:
[0090] Step A11: Obtain Hough transform parameters, which include horizontal parameters and vertical parameters.
[0091] It should be noted that, in order to save time and improve detection accuracy, the Hough transform parameters of this solution are only set to two straight lines: horizontal parameters (0 degrees) and vertical parameters (90 degrees).
[0092] Step A12: performing straight line detection on the contour image based on the Hough transform parameters to obtain horizontal straight lines and vertical straight lines.
[0093] In a specific implementation, straight line detection may be performed on the contour image based on horizontal parameters and vertical parameters, thereby obtaining straight lines in two directions, namely, a horizontal straight line and a vertical straight line.
[0094] Step A13: Calculate the intersection of the horizontal straight line and the vertical straight line.
[0095] It can be understood that after obtaining the straight lines in two directions, all straight line intersections can be calculated, including the intersections of possible interfering lines.
[0096] Step A14: Predict the slider rectangle using a preset restriction strategy based on the distribution and position of the line intersections.
[0097] It's important to note that the slider rectangle is predicted based on the distribution and location of line intersections. The preset constraint strategies are aspect ratio and slider size. Therefore, the most likely slider rectangle is predicted based on these constraints, along with the distribution and location of the intersections. These constraints filter out potentially interfering line intersections, improving detection accuracy.
[0098] Step A15: Obtain the slider position according to the slider rectangular frame.
[0099] In a specific implementation, the specific slider position can be determined by calculating the circumscribed rectangular frame of the intersection, interference can be reduced by setting the direction of the detection line, and the most likely slider intersection position can be predicted through post-processing to obtain the slider detection frame.
[0100] like Figure 4 As shown, Figure 4 A schematic diagram of obtaining the slider position using the Hough transform. First, input the full image to be verified and set the slider's predetermined area. Canny edge detection is performed on the slider's predetermined area to obtain a contour map. The contour map is then detected using Hough transform lines to obtain the intersection and the bounding box, thereby obtaining the slider position.
[0101] This embodiment sets a predetermined slider area based on the image to be verified; performs edge detection on the predetermined slider area to obtain a contour map; and uses Hough transform line detection based on the contour map to determine the slider position. This allows for rapid determination of the slider position when the slider element cannot be picked up, and is applicable not only on web pages but also in applications, improving the efficiency and scope of slider detection.
[0102] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 5 , step S30 includes steps S301 to S303:
[0103] Step S301: obtaining a slider image according to the slider position.
[0104] It should be noted that the slider image corresponding to the slider position can be obtained to facilitate subsequent processing of the slider image and complete the matching of the slider with the corresponding gap.
[0105] Step S302: performing edge detection on the slider image and the gap background image respectively to obtain a slider edge binary image and a background edge binary image.
[0106] In a specific implementation, the Canny operator may be used to perform edge detection on the slider image and the gap background image respectively, thereby obtaining a binary edge image of the slider and a binary edge image of the background.
[0107] It should be noted that in order to highlight the image features of the gap, the gap background image is a preprocessed image. By preprocessing the background image, the image contrast is enhanced and the image features of the gap are highlighted, which is especially suitable for scenes with complex backgrounds.
[0108] Step S303: performing template matching in a template matching library based on the slider edge binary image and the background edge binary image to obtain a matching gap position of the slider.
[0109] In the specific implementation, the template matching library stores multi-scale templates of the slider image, which facilitates the matching of the gap. The templates corresponding to the slider and the gap are matched in the template matching library through the slider edge binary image and the background edge binary image to obtain the gap position of the slider matching.
[0110] In order to improve the matching efficiency, the template can be established in the template matching library in advance, so that the template matching library can be directly queried during matching to obtain the corresponding template.
[0111] Therefore, before step S303, the method further includes: setting an original matching template, and performing scale fluctuation on the original matching template to obtain a multi-scale template; setting a region of interest for the multi-scale template to obtain a template matching range; and adjusting the multi-scale template according to the template matching range to construct a template matching library.
[0112] It should be noted that the original matching template is a template of a large number of sliders and gaps that are collected. In order to effectively correspond to the scale difference between the gap and the slider, the original matching template can be scaled, such as Figure 6 As shown, Figure 6 Schematic diagram of the multi-scale template after scale fluctuation. In addition to the original scale of 100%, we also designed a smaller scale of 90% and a larger scale of 110%, which can effectively deal with the scale difference between the gap and the slider.
[0113] It should be noted that since the background image may have many line interferences or irrelevant gaps that may induce the algorithm to make mistakes, you can set ROI (Region of Interest, region of interest) limits the multi-scale template. ROI setting can make template matching more focused on the effective area. Specifically, the region of interest can be set for the multi-scale template to obtain the template matching range, such as Figure 7 As shown, Figure 7 This figure shows a comparison between the original template matching range and the template matching range after setting the ROI. The changes in the red part represent the changes in the template matching range after the ROI is set. Limiting the ROI can minimize the matching background and reduce interference. Multi-scale templates can improve template matching capabilities and address the situation where the slider and gap scales are inconsistent.
[0114] like Figure 8 As shown, Figure 8 This is a flowchart for matching the slider with the gap. By inputting the background image with the gap in the image to be verified and the slider position, edge detection is used to detect the slider edge and the gap area edge. The edge binary images of the slider and the background are obtained. Template matching is performed on the edge binary images of the slider and the background, and finally the gap position matched by the slider is obtained, thereby obtaining the sliding distance.
[0115] This embodiment obtains a slider image based on the slider position; performs edge detection on the slider image and the gap background image to obtain a slider edge binary image and a background edge binary image; and performs template matching on the slider edge binary image and the background edge binary image in a template matching library to obtain the gap position for the slider match. Using the template matching library for region matching reduces the impact of confusing images and ensures verification accuracy.
[0116] Based on the first embodiment of the present application, in the fourth embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 9 , step S40 includes steps S401 to S406:
[0117] Step S401: obtaining preset noise and counting slider verification data of manual operation, wherein the slider verification data includes the number of slider verifications and the dragging distance of the slider verification.
[0118] It should be noted that the preset noise can be random noise, such as Gaussian noise or white noise, and the manually operated slider verification data can be statistically obtained in advance. Specifically, a group of sliders are manually operated for verification M times, usually M is greater than 100, and the dragging distance of these M slider verifications is h, thereby obtaining the slider verification data.
[0119] Step S402: establishing a distance-time curve according to the number of slider verifications and the dragging distance.
[0120] In a specific implementation, the dragging "distance-time" curve can be recorded M times, and the M times of the curve are averaged to obtain a highly anthropomorphic simulation operation curve. That is the distance-time curve, which reflects the habits of manual dragging.
[0121]
[0122] Step S403: constructing a target operating curve based on the distance-time curve and the preset noise.
[0123] In specific implementations, noise that is difficult for machines to distinguish can be added to make the details of each drag different, more human-like, and more likely to pass background verification. The target operation curve R is shown as follows:
[0124]
[0125] like Figure 10 As shown, Figure 10 This is a schematic diagram of the target operation curve, where the horizontal axis is the dragging time and the vertical axis is the distance between the slider and the gap.
[0126] Step S404: Obtaining a sliding distance according to the position of the slider and the position of the notch.
[0127] In a specific implementation, the sliding distance during the current verification dragging can be obtained according to the currently determined slider position and notch position.
[0128] Step S405: obtaining a sliding operation curve according to the sliding distance and the target operation curve.
[0129] It should be noted that the sliding operation curve for the current sliding verification can be determined based on the sliding distance and the target operation curve, that is, a "click-drag-release" process is set according to the curve R to generate the sliding operation curve.
[0130] Step S406: Controlling the slider according to the sliding operation curve to perform automatic slider verification.
[0131] In a specific implementation, the slider can be controlled by sliding the operation curve to complete the automatic verification of the slider. The verification is completed by simulating user operations, which greatly improves the verification success rate and has the advantage of low latency.
[0132] This embodiment obtains preset noise and collects data on manually operated slider verification, including the number of slider verifications and the drag distance of the slider verification. A distance-time curve is established based on the number of slider verifications and the drag distance. A target operation curve is constructed based on the distance-time curve and the preset noise. The sliding distance is obtained based on the slider position and the notch position. A sliding operation curve is obtained based on the sliding distance and the target operation curve. The slider is then controlled according to the sliding operation curve to perform automatic slider verification. By collecting data on human sliding habit curves and then adding noise that is difficult for machines to discern, the verification process is completed with only a single count, eliminating the need for a model. This significantly improves the success rate of verification while maintaining excellent low-latency performance.
[0133] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the slider automatic verification method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0134] This application also provides a slider automatic verification device, please refer to Figure 11 , the slider automatic verification device includes:
[0135] The acquisition module 10 is used to acquire the image to be verified, and automatically detect the slider based on the image to be verified to obtain the position of the slider.
[0136] The acquisition module 10 is further configured to obtain a gap background image based on the image to be verified.
[0137] The matching module 20 is configured to perform template matching based on the slider position and the gap background image to obtain the gap position matched by the slider.
[0138] The verification module 30 is configured to automatically verify the slider using a target operating curve according to the slider position and the notch position.
[0139] The automatic slider verification device provided in this application utilizes the automatic slider verification method of the aforementioned embodiment, and can address the current technical issue of slow automatic slider verification. Compared to the prior art, the automatic slider verification device provided in this application has the same beneficial effects as the automatic slider verification method of the aforementioned embodiment. Other technical features of the automatic slider verification device are the same as those disclosed in the aforementioned embodiment and are not further elaborated here.
[0140] The present application provides a slider automatic verification device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the slider automatic verification method in the above-mentioned embodiment 1.
[0141] Reference below Figure 12 , which shows a schematic diagram of the structure of a slider automatic verification device suitable for implementing the embodiments of the present application. The slider automatic verification device in the embodiments of the present application can include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 12 The slider automatic verification device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0142] like Figure 12As shown, the automatic slider verification device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in ROM (Read Only Memory) 1002 or programs loaded from storage device 1003 into RAM (Random Access Memory) 1004. RAM 1004 also stores various programs and data required for the operation of the automatic slider verification device. Processing device 1001, ROM 1002, and RAM 1004 are interconnected via bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input device 1007 including, for example, a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output device 1008 including, for example, LCD (Liquid Crystal Display), speaker, vibrator, etc.; storage device 1003 including, for example, a magnetic tape, hard disk, etc.; and communication device 1009. The communication device 1009 can allow the automatic slider verification device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows the automatic slider verification device with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems can be implemented or have alternatively.
[0143] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0144] The automatic slider verification device provided by this application utilizes the automatic slider verification method of the aforementioned embodiment, resolving the current technical issue of slow automatic slider verification. Compared to the prior art, the automatic slider verification device provided by this application achieves the same beneficial effects as the automatic slider verification method of the aforementioned embodiment. Other technical features of the automatic slider verification device are the same as those disclosed in the aforementioned embodiment and are not further elaborated here.
[0145] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0146] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0147] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer program) stored thereon, wherein the computer-readable program instructions are used to execute the automatic slider verification method in the above-mentioned embodiment.
[0148] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, RAM (Random Access Memory), ROM (Read Only Memory), EPROM (Erasable Programmable Read Only Memory or Flash memory), optical fiber, CD-ROM (CD-Read Only Memory, portable compact disk read-only memory), optical storage device, magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0149] The computer-readable storage medium may be included in the automatic slider verification device; or may exist independently without being assembled into the automatic slider verification device.
[0150] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the slider automatic verification device, the slider automatic verification device: obtains the picture to be verified, and automatically detects the slider based on the picture to be verified to obtain the slider position; obtains the gap background image based on the picture to be verified; performs template matching based on the slider position and the gap background image to obtain the gap position matched by the slider; and uses the target operation curve to automatically verify the slider according to the slider position and the gap position.
[0151] The computer program code for performing the operations of the present application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a LAN (Local Area Network) or a WAN (Wide Area Network), or can be connected to an external computer (e.g., using an Internet service provider to connect via the Internet).
[0152] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.
[0153] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.
[0154] The computer-readable storage medium provided in this application stores computer-readable program instructions (i.e., a computer program) for executing the above-described automatic slider verification method. This computer-readable storage medium can address the current technical issue of slow automatic slider verification. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided in this application are similar to those of the automatic slider verification method provided in the above-described embodiments, and are not further elaborated here.
[0155] The present application also provides a computer program product, comprising a computer program, which implements the steps of the above-mentioned slider automatic verification method when executed by a processor.
[0156] The computer program product provided by this application can solve the current technical problem of slow slider automatic verification. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as those of the slider automatic verification method provided by the above embodiment, and will not be repeated here.
[0157] The above description is only part of the embodiments of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A slider automatic verification method, characterized in that: The slider automatic verification method includes: Obtaining a picture to be verified, and automatically detecting the slider based on the picture to be verified to obtain the slider position; Obtaining a gap background image based on the image to be verified; Performing template matching based on the slider position and the gap background image to obtain the gap position matched by the slider; Automatic slider verification is performed using a target operating curve according to the slider position and the notch position.
2. The method according to claim 1, wherein The step of obtaining the image to be verified and automatically detecting the slider based on the image to be verified to obtain the position of the slider includes: Setting a predetermined area of the slider according to the image to be verified; Performing edge detection on a predetermined area of the slider to obtain a contour map; Based on the contour map, Hough transform line detection is used to obtain the slider position.
3. The method according to claim 2, wherein The step of obtaining the position of the slider by using Hough transform line detection based on the contour map includes: Obtaining Hough transform parameters, where the Hough transform parameters include horizontal parameters and vertical parameters; Performing straight line detection on the contour image based on the Hough transform parameters to obtain a horizontal straight line and a vertical straight line; Calculate the intersection of the horizontal straight line and the vertical straight line; Predict the slider rectangle using a preset constraint strategy based on the distribution and location of the line intersections; The slider position is obtained according to the slider rectangular frame.
4. The method according to claim 1, wherein The step of performing template matching based on the slider position and the gap background image to obtain the gap position matched by the slider comprises: Obtaining a slider image according to the slider position; Performing edge detection on the slider image and the gap background image respectively to obtain a slider edge binary image and a background edge binary image; Template matching is performed in a template matching library based on the slider edge binary image and the background edge binary image to obtain a gap position of the slider matching.
5. The method according to claim 4, wherein Before the step of performing template matching based on the slider edge binary image and the background edge binary image to obtain the notch position of the slider matching, the method further includes: Setting an original matching template, and performing scale fluctuation on the original matching template to obtain a multi-scale template; Setting a region of interest for the multi-scale template to obtain a template matching range; The multi-scale template is adjusted according to the template matching range to construct a template matching library.
6. The method according to claim 1, wherein The step of automatically verifying the slider using the target operating curve according to the slider position and the notch position includes: Acquire preset noise and count slider verification data of manual operation, wherein the slider verification data includes the number of slider verifications and the dragging distance of the slider verification; Establishing a distance-time curve according to the number of slider verifications and the dragging distance; constructing a target operating curve based on the distance-time curve and the preset noise; Obtaining a sliding distance according to the position of the slider and the position of the notch; obtaining a sliding operation curve according to the sliding distance and the target operation curve; The slider is controlled according to the sliding operation curve to perform automatic slider verification.
7. A slider automatic verification device, characterized in that: The device comprises: An acquisition module, configured to acquire a picture to be verified, and automatically detect the slider based on the picture to be verified to obtain a position of the slider; The acquisition module is further configured to obtain a gap background image based on the image to be verified; A matching module, configured to perform template matching based on the slider position and the gap background image to obtain a gap position matched by the slider; The verification module is used to automatically verify the slider using a target operating curve according to the slider position and the notch position.
8. A slider automatic verification device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the slider automatic verification method according to any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the slider automatic verification method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the automatic slider verification method according to any one of claims 1 to 6 are implemented.