CN116703868A - Webpage element testing method and device - Google Patents
Webpage element testing method and device Download PDFInfo
- Publication number
- CN116703868A CN116703868A CN202310684471.8A CN202310684471A CN116703868A CN 116703868 A CN116703868 A CN 116703868A CN 202310684471 A CN202310684471 A CN 202310684471A CN 116703868 A CN116703868 A CN 116703868A
- Authority
- CN
- China
- Prior art keywords
- map
- gaussian
- gray
- gray level
- size
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 35
- 238000000034 method Methods 0.000 claims abstract description 42
- 238000003708 edge detection Methods 0.000 claims abstract description 30
- 238000001914 filtration Methods 0.000 claims abstract description 27
- 238000010586 diagram Methods 0.000 claims abstract description 15
- 238000009499 grossing Methods 0.000 description 8
- 230000000694 effects Effects 0.000 description 4
- BUGBHKTXTAQXES-UHFFFAOYSA-N Selenium Chemical compound [Se] BUGBHKTXTAQXES-UHFFFAOYSA-N 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 229910052711 selenium Inorganic materials 0.000 description 1
- 239000011669 selenium Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3604—Software analysis for verifying properties of programs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/20—Image enhancement or restoration using local operators
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/74—Image or video pattern matching; Proximity measures in feature spaces
- G06V10/761—Proximity, similarity or dissimilarity measures
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Quality & Reliability (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Artificial Intelligence (AREA)
- Databases & Information Systems (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Health & Medical Sciences (AREA)
- Multimedia (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Image Analysis (AREA)
Abstract
The application provides a method and a device for testing webpage elements, wherein the method comprises the following steps: respectively carrying out gray processing on an image corresponding to the webpage element to be detected and an image corresponding to the template webpage element to obtain a first gray image and a second gray image; obtaining a first Gaussian parameter corresponding to the first gray level diagram and a second Gaussian parameter corresponding to the second gray level diagram; performing Gaussian filtering processing on the first gray level map based on the first Gaussian parameter, and performing Gaussian filtering processing on the second gray level map based on the second Gaussian parameter; obtaining a first gradient value and a second gradient value; performing edge detection based on the first gradient value to obtain a first edge map, and performing edge detection based on the second gradient value to obtain a second edge map; determining the similarity between the webpage element to be detected and the template webpage element based on the first edge graph and the second edge graph; and if the similarity meets the similarity threshold, determining that the webpage element to be tested passes the contour test.
Description
Technical Field
The application relates to the technical field of computers, in particular to a method and a device for testing webpage elements.
Background
In the software development process, testing of Web pages is indispensable.
At present, the outline of an element in a Web page is generally tested manually, but the problem of low testing efficiency exists in a manual mode.
Disclosure of Invention
The application provides the following technical scheme:
one aspect of the present application provides a method for testing a web page element, including:
respectively carrying out gray processing on an image corresponding to the webpage element to be detected and an image corresponding to the template webpage element to obtain a first gray image and a second gray image;
obtaining a first Gaussian parameter corresponding to the first gray level diagram and a second Gaussian parameter corresponding to the second gray level diagram;
performing Gaussian filtering processing on the first gray level image based on the first Gaussian parameter to obtain a third gray level image, and performing Gaussian filtering processing on the second gray level image based on the second Gaussian parameter to obtain a fourth gray level image;
obtaining a first gradient value corresponding to the third gray scale image and a second gradient value corresponding to the fourth gray scale image;
performing edge detection on the third gray level image based on the first gradient value to obtain a first edge image, and performing edge detection on the fourth gray level image based on the second gradient value to obtain a second edge image;
determining the similarity between the webpage element to be detected and the template webpage element based on the first edge graph and the second edge graph;
And if the similarity meets a similarity threshold, determining that the webpage element to be tested passes the contour test.
Optionally, obtaining a first gaussian parameter corresponding to the first gray scale map includes:
obtaining the total number of pixels of the first gray scale map;
dividing the square root of the total number of pixels of the first gray map by 100 to obtain a usable Gaussian kernel size corresponding to the first gray map;
if the size of the usable Gaussian kernel corresponding to the first gray level map is odd, determining that the size of the usable Gaussian kernel corresponding to the first gray level map is a first Gaussian parameter corresponding to the first gray level map;
and if the size of the usable Gaussian kernel corresponding to the first gray level map is even, adding the size of the usable Gaussian kernel corresponding to the first gray level map to a set odd number to obtain a first Gaussian parameter corresponding to the first gray level map.
Optionally, obtaining a first gaussian parameter corresponding to the first gray scale map and a second gaussian parameter corresponding to the second gray scale map includes:
obtaining the total number of pixels of the second gray scale map;
dividing the total number of pixels of the second gray level image by 100 to obtain a usable Gaussian kernel size corresponding to the second gray level image;
If the size of the usable Gaussian kernel corresponding to the second gray level map is odd, determining that the size of the usable Gaussian kernel corresponding to the second gray level map is a second Gaussian parameter corresponding to the second gray level map;
and if the size of the usable Gaussian kernel corresponding to the second gray level map is even, adding the size of the usable Gaussian kernel to the set odd number to obtain a second Gaussian parameter corresponding to the second gray level map.
Optionally, obtaining a first gaussian parameter corresponding to the first gray scale map includes:
searching in a range of the size of the set Gaussian kernel with a set step length to obtain a plurality of first candidate Gaussian kernel sizes;
performing Gaussian filtering processing on the first gray level images based on the size of each first candidate Gaussian kernel to obtain fifth gray level images;
obtaining a mean square error between each of the fifth gray scale map and the first gray scale map;
determining and obtaining the minimum value in the mean square error between each fifth gray scale image and the first gray scale image;
and scaling the first candidate gaussian kernel size corresponding to the minimum value based on the image noise level corresponding to the first gray scale map to obtain a first gaussian parameter corresponding to the first gray scale map, wherein the image noise level corresponding to the first gray scale map is determined based on the determination to obtain the minimum value in the mean square error between each fifth gray scale map and the first gray scale map.
Optionally, the scaling the first candidate gaussian kernel size corresponding to the minimum value based on the image noise level corresponding to the first gray scale map to obtain a first gaussian parameter corresponding to the first gray scale map includes:
dividing the first candidate Gaussian kernel size corresponding to the minimum value by the image noise level corresponding to the first gray level map to obtain a first Gaussian kernel size to be used;
if the size of the first Gaussian kernel to be used is odd, determining that the size of the first Gaussian kernel to be used is a first Gaussian parameter corresponding to the first gray level map;
and if the size of the first usable Gaussian kernel is even, adding the size of the first usable Gaussian kernel to the set odd number to obtain a first Gaussian parameter corresponding to the first gray level map.
Optionally, obtaining a second gaussian parameter corresponding to the second gray scale map includes:
searching in the range of the size of the set Gaussian kernel with a set step length to obtain a plurality of second candidate Gaussian kernel sizes;
processing the second gray level map based on the size of each second candidate Gaussian kernel to obtain a sixth gray level map;
obtaining a mean square error between each of the sixth gray scale map and the second gray scale map;
Determining and obtaining the minimum value in the mean square error between each sixth gray scale image and each second gray scale image;
and scaling the second candidate Gaussian kernel size corresponding to the minimum value based on the image noise level corresponding to the second gray level map to obtain a second Gaussian parameter corresponding to the second gray level map, wherein the image noise level corresponding to the second gray level map is determined based on the determination to obtain the minimum value in the mean square error between each sixth gray level map and the second gray level map.
Optionally, the scaling the second candidate gaussian kernel size corresponding to the minimum value based on the image noise level corresponding to the second gray scale map to obtain a second gaussian parameter corresponding to the second gray scale map includes:
dividing the second candidate Gaussian kernel size corresponding to the minimum value by the image noise level corresponding to the second gray level map to obtain a second Gaussian kernel size to be used;
if the size of the second Gaussian kernel to be used is odd, determining that the size of the second Gaussian kernel to be used is a second Gaussian parameter corresponding to the second gray level map;
and if the size of the second usable Gaussian kernel is even, adding the size of the second usable Gaussian kernel to the set odd number to obtain a second Gaussian parameter corresponding to the second gray level map.
Another aspect of the present application provides a web page element testing apparatus, including:
the gray processing module is used for respectively carrying out gray processing on the image corresponding to the to-be-detected webpage element and the image corresponding to the template webpage element to obtain a first gray image and a second gray image;
the first obtaining module is used for obtaining a first Gaussian parameter corresponding to the first gray level diagram and a second Gaussian parameter corresponding to the second gray level diagram;
the Gaussian filter module is used for carrying out Gaussian filter processing on the first gray level image based on the first Gaussian parameter to obtain a third gray level image, and carrying out Gaussian filter processing on the second gray level image based on the second Gaussian parameter to obtain a fourth gray level image;
the second obtaining module is used for obtaining a first gradient value corresponding to the third gray scale image and a second gradient value corresponding to the fourth gray scale image;
the edge detection module is used for carrying out edge detection on the third gray level image based on the first gradient value to obtain a first edge image, and carrying out edge detection on the fourth gray level image based on the second gradient value to obtain a second edge image;
the first determining module is used for determining the similarity between the webpage element to be detected and the template webpage element based on the first edge graph and the second edge graph;
And the second determining module is used for determining that the webpage element to be tested passes the contour test if the similarity meets a similarity threshold.
Optionally, the process of obtaining the first gaussian parameter corresponding to the first gray map by the first obtaining module specifically includes:
obtaining the total number of pixels of the first gray scale map;
dividing the square root of the total number of pixels of the first gray map by 100 to obtain a usable Gaussian kernel size corresponding to the first gray map;
if the size of the usable Gaussian kernel corresponding to the first gray level map is odd, determining that the size of the usable Gaussian kernel corresponding to the first gray level map is a first Gaussian parameter corresponding to the first gray level map;
and if the size of the usable Gaussian kernel corresponding to the first gray level map is even, adding the size of the usable Gaussian kernel corresponding to the first gray level map to a set odd number to obtain a first Gaussian parameter corresponding to the first gray level map.
Optionally, the process of obtaining the second gaussian parameter corresponding to the second gray scale map by the first obtaining module specifically includes:
obtaining the total number of pixels of the second gray scale map;
dividing the total number of pixels of the second gray level image by 100 to obtain a usable Gaussian kernel size corresponding to the second gray level image;
If the size of the usable Gaussian kernel corresponding to the second gray level map is odd, determining that the size of the usable Gaussian kernel corresponding to the second gray level map is a second Gaussian parameter corresponding to the second gray level map;
and if the size of the usable Gaussian kernel corresponding to the second gray level map is even, adding the size of the usable Gaussian kernel to the set odd number to obtain a second Gaussian parameter corresponding to the second gray level map.
According to the method for testing the webpage elements, the outline of the webpage elements to be tested can be automatically tested, and the testing efficiency is improved.
And gray processing is respectively carried out on the image corresponding to the webpage element to be detected and the image corresponding to the template webpage element to obtain a first gray map and a second gray map, the contrast can be improved, noise can be reduced, on the basis, a first Gaussian parameter corresponding to the first gray map and a second Gaussian parameter corresponding to the second gray map are obtained, the first gray map is subjected to Gaussian filtering processing based on the first Gaussian parameter to obtain a third gray map, the second gray map is subjected to Gaussian filtering processing based on the second Gaussian parameter to obtain a fourth gray map, more accurate smoothing processing and noise removal of the first gray map and the second gray map can be achieved, on the basis, a first gradient value corresponding to the third gray map and a second gradient value corresponding to the fourth gray map are obtained, on the basis of the first gradient value, edge detection is carried out on the third gray map to obtain a first edge map, on the basis of the second gradient value, edge detection is carried out on the fourth gray map to obtain a second edge map, the edge detection and the edge detection accuracy and the robustness can be improved, and the similarity of the edge detection can be improved, and the similarity can be ensured if the similarity between the first gray map and the second gray map are tested, the similarity of the webpage element can be determined, and the similarity of the webpage element can pass through the threshold value is determined, and the similarity test is ensured if the similarity is tested.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort to a person skilled in the art.
Fig. 1 is a flow chart of a method for testing web page elements provided in embodiment 1 of the present application;
fig. 2 is a schematic flow chart of obtaining a first gaussian parameter corresponding to a first gray scale map according to embodiment 2 of the present application;
fig. 3 is a flowchart of obtaining a second gaussian parameter corresponding to a second gray scale map according to embodiment 3 of the present application;
fig. 4 is a schematic flow chart of obtaining a first gaussian parameter corresponding to a first gray scale map according to embodiment 4 of the present application;
fig. 5 is a flowchart of obtaining a second gaussian parameter corresponding to a second gray scale map according to embodiment 5 of the present application;
fig. 6 is a schematic structural diagram of a device for testing web page elements according to the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In order that the above-recited objects, features and advantages of the present application will become more readily apparent, a more particular description of the application will be rendered by reference to the appended drawings and appended detailed description.
Referring to fig. 1, a flow chart of a method for testing web page elements according to embodiment 1 of the present application is shown in fig. 1, and the method may include, but is not limited to, the following steps:
step S101, gray processing is carried out on an image corresponding to a webpage element to be detected and an image corresponding to a template webpage element respectively, and a first gray image and a second gray image are obtained.
In this embodiment, the to-be-detected webpage element in the Web page may be located, and the located to-be-detected webpage element may be subjected to screenshot to obtain an image corresponding to the to-be-detected webpage element. Specifically, but not limited to, the method of find_element_by_id, xpath and the like in the selenium library can be used for positioning the webpage element to be tested in the webpage, and then screenshot is carried out on the positioned webpage element to be tested through a screen method.
After the image corresponding to the webpage element to be detected is obtained, the image corresponding to the template element corresponding to the webpage element to be detected can be obtained.
After the image corresponding to the webpage element to be detected and the image corresponding to the template webpage element are obtained, gray processing can be performed on the image corresponding to the webpage element to be detected to obtain a first gray image, and gray processing is performed on the image corresponding to the template webpage element to obtain a second gray image.
Step S102, obtaining a first Gaussian parameter corresponding to the first gray level diagram and a second Gaussian parameter corresponding to the second gray level diagram.
The first gaussian parameter corresponding to the first gray map may be used to perform gaussian filtering on the first gray map.
And a second Gaussian parameter corresponding to the second gray level map can be used for Gaussian filtering of the second gray level map.
Step 103, performing gaussian filtering processing on the first gray scale map based on the first gaussian parameter to obtain a third gray scale map, and performing gaussian filtering processing on the second gray scale map based on the second gaussian parameter to obtain a fourth gray scale map.
Step S104, obtaining a first gradient value corresponding to the third gray scale map and a second gradient value corresponding to the fourth gray scale map.
In this embodiment, the gradient of the third gray scale map in the horizontal and vertical directions may be determined based on, but not limited to, the Sobel algorithm, so as to obtain the first gradient value corresponding to the third gray scale map.
In this embodiment, the gradient of the fourth gray scale map in the horizontal and vertical directions may be determined based on, but not limited to, the Sobel algorithm, so as to obtain the second gradient value corresponding to the fourth gray scale map.
Step S105, performing edge detection on the third gray scale map based on the first gradient value to obtain a first edge map, and performing edge detection on the fourth gray scale map based on the second gradient value to obtain a second edge map.
In this embodiment, the first gradient value and the third gray scale map may be, but not limited to, transferred into a Canny edge detection algorithm to perform edge detection, so as to obtain a first edge map.
In this embodiment, the second gradient value and the fourth gray scale map may be, but not limited to, transferred into a Canny edge detection algorithm to perform edge detection, so as to obtain a second edge map.
Step S106, based on the first edge graph and the second edge graph, the similarity between the webpage element to be detected and the template webpage element is determined.
This step may include, but is not limited to:
s1061, determining coordinates of each edge pixel point in the first edge graph, and determining a first contour point set containing the coordinates of each edge pixel point in the first edge graph.
Coordinates of the edge pixel points in the first edge map represent positions of the edge pixel points in the first edge map.
S1062, determining the coordinates of each edge pixel point in the second edge graph, and determining a second contour point set containing the coordinates of each edge pixel point in the second edge graph.
The first contour point set and the second contour point set are arrays with the same size.
S1063, determining a mean square error between the first contour point set and the second contour point set.
The smaller the mean square error, the higher the similarity between the first edge map and the second edge map.
Step S1063 may include, but is not limited to:
s10631, calculating a square of an element difference at a corresponding position in the first contour point set and the second contour point set.
And S10632, adding the squares of the coordinate differences to obtain a square sum.
S10633, dividing the square sum by the total number of elements in the first contour point set or the second contour point set to obtain a mean square error between the first contour point set and the second contour point set.
And step S107, if the similarity meets a similarity threshold, determining that the webpage element to be tested passes the contour test.
Corresponding to steps S10631-S10633, this step may include, but is not limited to:
and if the mean square error is smaller than the mean square error threshold, determining that the webpage element to be tested passes the contour test.
In the embodiment, the method for testing the webpage elements can realize automatic testing of the outline of the webpage elements to be tested, and improves testing efficiency.
And respectively carrying out gray processing on the images corresponding to the webpage elements to be detected and the images corresponding to the template webpage elements to obtain a first gray level map and a second gray level map, improving contrast and reducing noise, obtaining a first Gaussian parameter corresponding to the first gray level map and a second Gaussian parameter corresponding to the second gray level map on the basis, processing the first gray level map based on the first Gaussian parameter to obtain a third gray level map, processing the second gray level map based on the second Gaussian parameter to obtain a fourth gray level map, carrying out more accurate smoothing processing and noise removal on the first gray level map and the second gray level map, obtaining a first gradient value corresponding to the third gray level map and a second gradient value corresponding to the fourth gray level map on the basis, carrying out edge detection on the third gray level map on the basis of the first gradient value to obtain a first edge map, carrying out edge detection on the fourth gray level map on the basis of the second gradient value to obtain a second edge map, improving the accuracy and the robustness of edge detection, and determining that the similarity between the first edge map and the second gray level map and the webpage elements to be detected meets the threshold value, and determining the similarity of the webpage elements to be detected if the similarity test elements pass the threshold value, and the similarity of the webpage elements can be detected and the similarity is ensured.
As another alternative embodiment of the present application, referring to fig. 2, a flowchart of obtaining a first gaussian parameter corresponding to a first gray scale map according to embodiment 2 of the present application is mainly a refinement of the first gaussian parameter corresponding to the first gray scale map obtained in step S102 in embodiment 1, and as shown in fig. 2, the obtaining the first gaussian parameter corresponding to the first gray scale map in step S102 may include, but is not limited to, the following steps:
step S11, obtaining the total number of pixels of the first gray scale image.
And step S12, dividing the square root of the total number of pixels of the first gray level diagram by 100 to obtain the usable Gaussian kernel size corresponding to the first gray level diagram.
In this embodiment, the following empirical formula may be obtained through testing, and the square root of the total number of pixels of the first gray scale map is substituted into the empirical formula to obtain the usable gaussian kernel size corresponding to the first gray scale map:
wherein G1 represents the usable Gaussian kernel size, p, corresponding to the first gray scale t1 Representing the total number of pixels of the first gray scale map.
And step S13, if the size of the usable Gaussian kernel corresponding to the first gray level map is odd, determining that the size of the usable Gaussian kernel corresponding to the first gray level map is a first Gaussian parameter corresponding to the first gray level map.
And S14, if the size of the usable Gaussian kernel corresponding to the first gray level map is even, adding the size of the usable Gaussian kernel to a set odd number to obtain a first Gaussian parameter corresponding to the first gray level map.
The setting of the odd number may be performed as needed, and is not limited in the present application. For example, the odd number may be set to 1, but is not limited to.
In this embodiment, through steps S13 and S14, it may be ensured that the first gaussian parameter corresponding to the first gray scale map is a gaussian kernel with an odd number, so as to meet the requirement of symmetry of the gaussian kernel, further ensure smoothness and continuity of the image, and obtain a better filtering effect.
In this embodiment, the square root of the total number of pixels of the first gray scale map is divided by 100 to obtain a usable gaussian kernel size corresponding to the first gray scale map, if the usable gaussian kernel size corresponding to the first gray scale map is odd, the usable gaussian kernel size corresponding to the first gray scale map is determined to be a first gaussian parameter corresponding to the first gray scale map, if the usable gaussian kernel size corresponding to the first gray scale map is even, the usable gaussian kernel size corresponding to the first gray scale map is added to a set odd number to obtain a first gaussian parameter corresponding to the first gray scale map, and based on the first gaussian parameter, a gaussian filtering process is performed on the first gray scale map to obtain a third gray scale map, so that a more accurate smoothing process and noise removal for the first gray scale map can be realized.
As another alternative embodiment of the present application, referring to fig. 3, a flowchart of obtaining a second gaussian parameter corresponding to a second gray scale map according to embodiment 3 of the present application is provided, and this embodiment is mainly a refinement of obtaining the second gaussian parameter corresponding to the second gray scale map in step S102 in embodiment 1, as shown in fig. 3, where obtaining the second gaussian parameter corresponding to the second gray scale map in step S102 may include, but is not limited to, the following steps:
step S21, obtaining the total number of pixels of the second gray scale image.
And S22, dividing the total number of pixels of the second gray level image by 100 to obtain the usable Gaussian kernel size corresponding to the second gray level image.
In this embodiment, the following empirical formula may be obtained through testing, and the square root of the total number of pixels in the second gray scale map is substituted into the empirical formula to obtain the usable gaussian kernel size corresponding to the second gray scale map:
wherein G2 represents the usable Gaussian kernel size, p, corresponding to the second gray level t2 Representing the total number of pixels of the second gray scale map.
Step S23, if the size of the usable Gaussian kernel corresponding to the second gray level map is odd, determining that the size of the usable Gaussian kernel corresponding to the second gray level map is the second Gaussian parameter corresponding to the second gray level map.
And step S24, if the size of the usable Gaussian kernel corresponding to the second gray level map is even, adding the size of the usable Gaussian kernel to the set odd number to obtain a second Gaussian parameter corresponding to the second gray level map.
The setting of the odd number may be performed as needed, and is not limited in the present application. For example, the odd number may be set to 1, but is not limited to.
In this embodiment, through steps S23 and S24, it may be ensured that the second gaussian parameter corresponding to the second gray level map is a gaussian kernel with an odd number, so as to meet the requirement of symmetry of the gaussian kernel, further ensure smoothness and continuity of the image, and obtain a better filtering effect.
In this embodiment, the total number of pixels of the second gray scale map is divided by 100 to obtain a usable gaussian kernel size corresponding to the second gray scale map, if the usable gaussian kernel size corresponding to the second gray scale map is odd, a second gaussian parameter corresponding to the second gray scale map is determined, if the usable gaussian kernel size corresponding to the second gray scale map is even, the usable gaussian kernel size corresponding to the second gray scale map is added to the set odd to obtain a second gaussian parameter corresponding to the second gray scale map, and gaussian filtering is performed on the second gray scale map based on the second gaussian parameter to obtain a fourth gray scale map, so that more accurate smoothing and noise removal on the second gray scale map can be achieved.
As another alternative embodiment of the present application, referring to fig. 4, a flowchart of obtaining a first gaussian parameter corresponding to a first gray scale map according to embodiment 4 of the present application is provided, and this embodiment is mainly a refinement of the first gaussian parameter corresponding to the first gray scale map obtained in step S102 in embodiment 1, as shown in fig. 4, where obtaining the first gaussian parameter corresponding to the first gray scale map in step S102 may include, but is not limited to, the following steps:
step S31, searching in a range of the set Gaussian kernel size with a set step length to obtain a plurality of first candidate Gaussian kernel sizes.
In this embodiment, the setting step size and the setting gaussian kernel size range may be set as required, which is not limited in the present application.
In order to find the best gaussian kernel size as possible while ensuring computational efficiency, and to cover the possible gaussian kernel sizes, the step size should be small enough to ensure the accuracy of the search, the set step size may be, but is not limited to, 2, and the set gaussian kernel size range may be, but is not limited to, 1 to 31.
And step S32, performing Gaussian filtering processing on the first gray level map based on the size of each first candidate Gaussian kernel to obtain a fifth gray level map.
And step S33, obtaining a mean square error between each fifth gray scale image and the first gray scale image.
The mean square error between the fifth gray scale map and the first gray scale map may characterize the difference between the fifth gray scale map and the first gray scale map. The smaller the mean square error between the fifth gray scale map and the first gray scale map, the smaller the difference between the fifth gray scale map and the first gray scale map is represented, and further the better the smoothing effect of the Gaussian filter processing on the first gray scale map by using the first candidate Gaussian kernel size is represented.
And step S34, determining and obtaining the minimum value in the mean square error between each fifth gray scale image and the first gray scale image.
And step S35, scaling the first candidate Gaussian kernel size corresponding to the minimum value based on the image noise level corresponding to the first gray level map to obtain a first Gaussian parameter corresponding to the first gray level map.
And determining the image noise level corresponding to the first gray scale image based on the minimum value in the mean square error between each fifth gray scale image and the first gray scale image obtained through the determination.
Specifically, the minimum value of the mean square error between each of the fifth gray scale patterns and the first gray scale patterns may be determined as the image noise level corresponding to the first gray scale patterns, but is not limited thereto.
And scaling the first candidate Gaussian kernel size corresponding to the minimum value based on the image noise level corresponding to the first gray level graph so as to limit the scaled first candidate Gaussian kernel size to be between 1 and 31, and avoid the occurrence of excessively large or excessively small Gaussian kernel sizes.
Step S35 may include, but is not limited to:
step S351, dividing the first candidate Gaussian kernel size corresponding to the minimum value by the image noise level corresponding to the first gray scale image to obtain a first Gaussian kernel size to be used.
Step S352, if the size of the first gaussian kernel to be used is odd, determining that the size of the first gaussian kernel to be used is a first gaussian parameter corresponding to the first gray scale map.
Step S353, if the size of the first usable gaussian kernel is even, adding the size of the first usable gaussian kernel to a set odd number to obtain a first gaussian parameter corresponding to the first gray scale map.
The setting of the odd number may be performed as needed, and is not limited in the present application. For example, the odd number may be set to 1, but is not limited to.
In this embodiment, searching is performed within a range of a set gaussian kernel size with a set step length to obtain a plurality of first candidate gaussian kernel sizes, gaussian filtering processing is performed on the first gray map based on each first candidate gaussian kernel size to obtain a fifth gray map, a mean square error between each fifth gray map and the first gray map is obtained, a minimum value in the mean square error between each fifth gray map and the first gray map is determined, scaling is performed on the first candidate gaussian kernel size corresponding to the minimum value based on an image noise level corresponding to the first gray map to obtain a first gaussian parameter corresponding to the first gray map, gaussian filtering processing is performed on the first gray map based on the first gaussian parameter to obtain a third gray map, and more accurate smoothing processing and noise removal on the first gray map can be achieved.
As another alternative embodiment of the present application, referring to fig. 5, a flowchart of obtaining a second gaussian parameter corresponding to a second gray scale map according to embodiment 5 of the present application is provided, and this embodiment is mainly a refinement of obtaining the second gaussian parameter corresponding to the second gray scale map in step S102 in embodiment 1, as shown in fig. 5, where obtaining the second gaussian parameter corresponding to the second gray scale map in step S102 may include, but is not limited to, the following steps:
and S41, searching in a range of the set Gaussian kernel size with a set step length to obtain a plurality of second candidate Gaussian kernel sizes.
In this embodiment, the setting step size and the setting gaussian kernel size range may be set as required, which is not limited in the present application.
In order to find the best gaussian kernel size as possible while ensuring computational efficiency, and to cover the possible gaussian kernel sizes, the step size should be small enough to ensure the accuracy of the search, the set step size may be, but is not limited to, 2, and the set gaussian kernel size range may be, but is not limited to, 1 to 31.
And step S42, processing the second gray level map based on the size of each second candidate Gaussian kernel to obtain a sixth gray level map.
And step S43, obtaining a mean square error between each sixth gray scale image and each second gray scale image.
The mean square error between the sixth gray scale map and the first gray scale map may characterize the difference between the sixth gray scale map and the first gray scale map. The smaller the mean square error between the sixth gray scale map and the first gray scale map, the smaller the difference between the sixth gray scale map and the first gray scale map is represented, and further the better the smoothing effect of the second gray scale map through the Gaussian filter processing by using the second candidate Gaussian kernel size is represented.
And S44, determining and obtaining the minimum value in the mean square error between each sixth gray scale image and each second gray scale image.
And step S45, scaling the second candidate Gaussian kernel size corresponding to the minimum value based on the image noise level corresponding to the second gray level map to obtain a second Gaussian parameter corresponding to the second gray level map.
And determining the image noise level corresponding to the second gray level map based on the minimum value in the mean square error between each sixth gray level map and the second gray level map obtained through the determination.
Specifically, the minimum value of the mean square error between each of the sixth gray scale map and the first gray scale map may be determined as the image noise level corresponding to the second gray scale map, but is not limited thereto.
And scaling the second candidate Gaussian kernel size corresponding to the minimum value based on the image noise level corresponding to the second gray level graph so as to limit the scaled second candidate Gaussian kernel size to be between 1 and 31, and avoid the occurrence of excessively large or excessively small Gaussian kernel size.
Step S45 may include, but is not limited to:
step S451, dividing the second candidate gaussian kernel size corresponding to the minimum value by the image noise level corresponding to the second gray scale map to obtain a second gaussian kernel size to be used.
Step 452, if the size of the second gaussian kernel to be used is odd, determining that the size of the second gaussian kernel to be used is a second gaussian parameter corresponding to the second gray scale map.
Step S453, if the size of the second usable Gaussian kernel is even, adding the size of the second usable Gaussian kernel to the set odd number to obtain a second Gaussian parameter corresponding to the second gray level map.
In this embodiment, a plurality of second candidate gaussian kernel sizes are obtained by searching in a range of a set gaussian kernel size with a set step size, the second gray level map is processed based on each second candidate gaussian kernel size to obtain a sixth gray level map, a mean square error between each sixth gray level map and the second gray level map is obtained, a minimum value in the mean square error between each sixth gray level map and the second gray level map is determined, the second candidate gaussian kernel size corresponding to the minimum value is scaled based on an image noise level corresponding to the second gray level map to obtain a second gaussian parameter corresponding to the second gray level map, gaussian filtering processing is performed on the second gray level map based on the second gaussian parameter to obtain a fourth gray level map, and more accurate smoothing processing and noise removal of the second gray level map can be achieved.
The application provides a webpage element testing device, and the webpage element testing device and the webpage element testing method can be correspondingly referred to each other.
Referring to fig. 6, the web page element testing apparatus includes: the gray processing module 100, the first obtaining module 200, the gaussian filtering module 300, the second obtaining module 400, the edge detection module 500, the first determining module 600, and the second determining module 700.
The gray processing module 100 is configured to perform gray processing on an image corresponding to a to-be-detected web page element and an image corresponding to a template web page element respectively, so as to obtain a first gray map and a second gray map;
a first obtaining module 200, configured to obtain a first gaussian parameter corresponding to the first gray scale map and a second gaussian parameter corresponding to the second gray scale map;
the gaussian filtering module 300 is configured to perform gaussian filtering processing on the first gray scale map based on the first gaussian parameter to obtain a third gray scale map, and perform gaussian filtering processing on the second gray scale map based on the second gaussian parameter to obtain a fourth gray scale map;
a second obtaining module 400, configured to obtain a first gradient value corresponding to the third gray scale map and a second gradient value corresponding to the fourth gray scale map;
The edge detection module 500 is configured to perform edge detection on the third gray scale map based on the first gradient value to obtain a first edge map, and perform edge detection on the fourth gray scale map based on the second gradient value to obtain a second edge map;
a first determining module 600, configured to determine, based on the first edge map and the second edge map, a similarity between the to-be-detected web page element and the template web page element;
the second determining module 700 is configured to determine that the web page element to be tested passes the contour test if the similarity meets a similarity threshold.
The process of the first obtaining module 200 obtaining the first gaussian parameter corresponding to the first gray scale map may specifically include:
obtaining the total number of pixels of the first gray scale map;
dividing the square root of the total number of pixels of the first gray map by 100 to obtain a usable Gaussian kernel size corresponding to the first gray map;
if the size of the usable Gaussian kernel corresponding to the first gray level map is odd, determining that the size of the usable Gaussian kernel corresponding to the first gray level map is a first Gaussian parameter corresponding to the first gray level map;
and if the size of the usable Gaussian kernel corresponding to the first gray level map is even, adding the size of the usable Gaussian kernel corresponding to the first gray level map to a set odd number to obtain a first Gaussian parameter corresponding to the first gray level map.
The process of the first obtaining module 200 obtaining the second gaussian parameter corresponding to the second gray scale map may specifically include:
obtaining the total number of pixels of the second gray scale map;
dividing the total number of pixels of the second gray level image by 100 to obtain a usable Gaussian kernel size corresponding to the second gray level image;
if the size of the usable Gaussian kernel corresponding to the second gray level map is odd, determining that the size of the usable Gaussian kernel corresponding to the second gray level map is a second Gaussian parameter corresponding to the second gray level map;
and if the size of the usable Gaussian kernel corresponding to the second gray level map is even, adding the size of the usable Gaussian kernel to the set odd number to obtain a second Gaussian parameter corresponding to the second gray level map.
The process of the first obtaining module 200 obtaining the first gaussian parameter corresponding to the first gray scale map may specifically include:
searching in a range of the size of the set Gaussian kernel with a set step length to obtain a plurality of first candidate Gaussian kernel sizes;
performing Gaussian filtering processing on the first gray level images based on the size of each first candidate Gaussian kernel to obtain fifth gray level images;
obtaining a mean square error between each of the fifth gray scale map and the first gray scale map;
Determining and obtaining the minimum value in the mean square error between each fifth gray scale image and the first gray scale image;
and scaling the first candidate gaussian kernel size corresponding to the minimum value based on the image noise level corresponding to the first gray scale map to obtain a first gaussian parameter corresponding to the first gray scale map, wherein the image noise level corresponding to the first gray scale map is determined based on the determination to obtain the minimum value in the mean square error between each fifth gray scale map and the first gray scale map.
The process of scaling the first candidate gaussian kernel size corresponding to the minimum value based on the image noise level corresponding to the first gray map by the first obtaining module 200 to obtain the first gaussian parameter corresponding to the first gray map may specifically include:
dividing the first candidate Gaussian kernel size corresponding to the minimum value by the image noise level corresponding to the first gray level map to obtain a first Gaussian kernel size to be used;
if the size of the first Gaussian kernel to be used is odd, determining that the size of the first Gaussian kernel to be used is a first Gaussian parameter corresponding to the first gray level map;
and if the size of the first usable Gaussian kernel is even, adding the size of the first usable Gaussian kernel to the set odd number to obtain a first Gaussian parameter corresponding to the first gray level map.
The process of the first obtaining module 200 obtaining the second gaussian parameter corresponding to the second gray scale map may specifically include:
searching in the range of the size of the set Gaussian kernel with a set step length to obtain a plurality of second candidate Gaussian kernel sizes;
processing the second gray level map based on the size of each second candidate Gaussian kernel to obtain a sixth gray level map;
obtaining a mean square error between each of the sixth gray scale map and the second gray scale map;
determining and obtaining the minimum value in the mean square error between each sixth gray scale image and each second gray scale image;
and scaling the second candidate Gaussian kernel size corresponding to the minimum value based on the image noise level corresponding to the second gray level map to obtain a second Gaussian parameter corresponding to the second gray level map, wherein the image noise level corresponding to the second gray level map is determined based on the determination to obtain the minimum value in the mean square error between each sixth gray level map and the second gray level map.
The process of scaling the second candidate gaussian kernel size corresponding to the minimum value by the first obtaining module 200 based on the image noise level corresponding to the second gray scale map to obtain the second gaussian parameter corresponding to the second gray scale map may specifically include:
Dividing the second candidate Gaussian kernel size corresponding to the minimum value by the image noise level corresponding to the second gray level map to obtain a second Gaussian kernel size to be used;
if the size of the second Gaussian kernel to be used is odd, determining that the size of the second Gaussian kernel to be used is a second Gaussian parameter corresponding to the second gray level map;
and if the size of the second usable Gaussian kernel is even, adding the size of the second usable Gaussian kernel to the set odd number to obtain a second Gaussian parameter corresponding to the second gray level map.
It should be noted that, in each embodiment, the differences from the other embodiments are emphasized, and the same similar parts between the embodiments are referred to each other. For the apparatus class embodiments, the description is relatively simple as it is substantially similar to the method embodiments, and reference is made to the description of the method embodiments for relevant points.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
For convenience of description, the above devices are described as being functionally divided into various modules, respectively. Of course, the functions of each module may be implemented in the same piece or pieces of software and/or hardware when implementing the present application.
From the above description of embodiments, it will be apparent to those skilled in the art that the present application may be implemented in software plus a necessary general hardware platform. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the embodiments or some parts of the embodiments of the present application.
The above describes in detail a method and apparatus for testing web page elements provided by the present application, and specific examples are applied herein to describe the principles and embodiments of the present application, and the description of the above examples is only for helping to understand the method and core ideas of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.
Claims (10)
1. A method for testing web page elements, comprising:
respectively carrying out gray processing on an image corresponding to the webpage element to be detected and an image corresponding to the template webpage element to obtain a first gray image and a second gray image;
obtaining a first Gaussian parameter corresponding to the first gray level diagram and a second Gaussian parameter corresponding to the second gray level diagram;
performing Gaussian filtering processing on the first gray level image based on the first Gaussian parameter to obtain a third gray level image, and performing Gaussian filtering processing on the second gray level image based on the second Gaussian parameter to obtain a fourth gray level image;
obtaining a first gradient value corresponding to the third gray scale image and a second gradient value corresponding to the fourth gray scale image;
performing edge detection on the third gray level image based on the first gradient value to obtain a first edge image, and performing edge detection on the fourth gray level image based on the second gradient value to obtain a second edge image;
determining the similarity between the webpage element to be detected and the template webpage element based on the first edge graph and the second edge graph;
and if the similarity meets a similarity threshold, determining that the webpage element to be tested passes the contour test.
2. The method of claim 1, wherein obtaining a first gaussian parameter corresponding to the first gray scale map comprises:
obtaining the total number of pixels of the first gray scale map;
dividing the square root of the total number of pixels of the first gray map by 100 to obtain a usable Gaussian kernel size corresponding to the first gray map;
if the size of the usable Gaussian kernel corresponding to the first gray level map is odd, determining that the size of the usable Gaussian kernel corresponding to the first gray level map is a first Gaussian parameter corresponding to the first gray level map;
and if the size of the usable Gaussian kernel corresponding to the first gray level map is even, adding the size of the usable Gaussian kernel corresponding to the first gray level map to a set odd number to obtain a first Gaussian parameter corresponding to the first gray level map.
3. The method of claim 1, wherein obtaining a first gaussian parameter corresponding to the first gray scale map and a second gaussian parameter corresponding to the second gray scale map comprises:
obtaining the total number of pixels of the second gray scale map;
dividing the total number of pixels of the second gray level image by 100 to obtain a usable Gaussian kernel size corresponding to the second gray level image;
If the size of the usable Gaussian kernel corresponding to the second gray level map is odd, determining that the size of the usable Gaussian kernel corresponding to the second gray level map is a second Gaussian parameter corresponding to the second gray level map;
and if the size of the usable Gaussian kernel corresponding to the second gray level map is even, adding the size of the usable Gaussian kernel to the set odd number to obtain a second Gaussian parameter corresponding to the second gray level map.
4. The method of claim 1, wherein obtaining a first gaussian parameter corresponding to the first gray scale map comprises:
searching in a range of the size of the set Gaussian kernel with a set step length to obtain a plurality of first candidate Gaussian kernel sizes;
performing Gaussian filtering processing on the first gray level images based on the size of each first candidate Gaussian kernel to obtain fifth gray level images;
obtaining a mean square error between each of the fifth gray scale map and the first gray scale map;
determining and obtaining the minimum value in the mean square error between each fifth gray scale image and the first gray scale image;
and scaling the first candidate gaussian kernel size corresponding to the minimum value based on the image noise level corresponding to the first gray scale map to obtain a first gaussian parameter corresponding to the first gray scale map, wherein the image noise level corresponding to the first gray scale map is determined based on the determination to obtain the minimum value in the mean square error between each fifth gray scale map and the first gray scale map.
5. The method of claim 4, wherein scaling the first candidate gaussian kernel size corresponding to the minimum value based on the image noise level corresponding to the first gray scale map to obtain a first gaussian parameter corresponding to the first gray scale map, comprises:
dividing the first candidate Gaussian kernel size corresponding to the minimum value by the image noise level corresponding to the first gray level map to obtain a first Gaussian kernel size to be used;
if the size of the first Gaussian kernel to be used is odd, determining that the size of the first Gaussian kernel to be used is a first Gaussian parameter corresponding to the first gray level map;
and if the size of the first usable Gaussian kernel is even, adding the size of the first usable Gaussian kernel to the set odd number to obtain a first Gaussian parameter corresponding to the first gray level map.
6. The method of claim 1, wherein obtaining a second gaussian parameter corresponding to the second gray scale map comprises:
searching in the range of the size of the set Gaussian kernel with a set step length to obtain a plurality of second candidate Gaussian kernel sizes;
processing the second gray level map based on the size of each second candidate Gaussian kernel to obtain a sixth gray level map;
Obtaining a mean square error between each of the sixth gray scale map and the second gray scale map;
determining and obtaining the minimum value in the mean square error between each sixth gray scale image and each second gray scale image;
and scaling the second candidate Gaussian kernel size corresponding to the minimum value based on the image noise level corresponding to the second gray level map to obtain a second Gaussian parameter corresponding to the second gray level map, wherein the image noise level corresponding to the second gray level map is determined based on the determination to obtain the minimum value in the mean square error between each sixth gray level map and the second gray level map.
7. The method of claim 6, wherein scaling the second candidate gaussian kernel size corresponding to the minimum value based on the image noise level corresponding to the second gray scale map to obtain a second gaussian parameter corresponding to the second gray scale map, comprises:
dividing the second candidate Gaussian kernel size corresponding to the minimum value by the image noise level corresponding to the second gray level map to obtain a second Gaussian kernel size to be used;
if the size of the second Gaussian kernel to be used is odd, determining that the size of the second Gaussian kernel to be used is a second Gaussian parameter corresponding to the second gray level map;
And if the size of the second usable Gaussian kernel is even, adding the size of the second usable Gaussian kernel to the set odd number to obtain a second Gaussian parameter corresponding to the second gray level map.
8. A web page element testing device, comprising:
the gray processing module is used for respectively carrying out gray processing on the image corresponding to the to-be-detected webpage element and the image corresponding to the template webpage element to obtain a first gray image and a second gray image;
the first obtaining module is used for obtaining a first Gaussian parameter corresponding to the first gray level diagram and a second Gaussian parameter corresponding to the second gray level diagram;
the Gaussian filter module is used for carrying out Gaussian filter processing on the first gray level image based on the first Gaussian parameter to obtain a third gray level image, and carrying out Gaussian filter processing on the second gray level image based on the second Gaussian parameter to obtain a fourth gray level image;
the second obtaining module is used for obtaining a first gradient value corresponding to the third gray scale image and a second gradient value corresponding to the fourth gray scale image;
the edge detection module is used for carrying out edge detection on the third gray level image based on the first gradient value to obtain a first edge image, and carrying out edge detection on the fourth gray level image based on the second gradient value to obtain a second edge image;
The first determining module is used for determining the similarity between the webpage element to be detected and the template webpage element based on the first edge graph and the second edge graph;
and the second determining module is used for determining that the webpage element to be tested passes the contour test if the similarity meets a similarity threshold.
9. The apparatus of claim 8, wherein the process of the first obtaining module obtaining the first gaussian parameter corresponding to the first gray map specifically includes:
obtaining the total number of pixels of the first gray scale map;
dividing the square root of the total number of pixels of the first gray map by 100 to obtain a usable Gaussian kernel size corresponding to the first gray map;
if the size of the usable Gaussian kernel corresponding to the first gray level map is odd, determining that the size of the usable Gaussian kernel corresponding to the first gray level map is a first Gaussian parameter corresponding to the first gray level map;
and if the size of the usable Gaussian kernel corresponding to the first gray level map is even, adding the size of the usable Gaussian kernel corresponding to the first gray level map to a set odd number to obtain a first Gaussian parameter corresponding to the first gray level map.
10. The apparatus of claim 8, wherein the process of the first obtaining module obtaining the second gaussian parameter corresponding to the second gray map specifically comprises:
Obtaining the total number of pixels of the second gray scale map;
dividing the total number of pixels of the second gray level image by 100 to obtain a usable Gaussian kernel size corresponding to the second gray level image;
if the size of the usable Gaussian kernel corresponding to the second gray level map is odd, determining that the size of the usable Gaussian kernel corresponding to the second gray level map is a second Gaussian parameter corresponding to the second gray level map;
and if the size of the usable Gaussian kernel corresponding to the second gray level map is even, adding the size of the usable Gaussian kernel to the set odd number to obtain a second Gaussian parameter corresponding to the second gray level map.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310684471.8A CN116703868A (en) | 2023-06-09 | 2023-06-09 | Webpage element testing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310684471.8A CN116703868A (en) | 2023-06-09 | 2023-06-09 | Webpage element testing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116703868A true CN116703868A (en) | 2023-09-05 |
Family
ID=87827191
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310684471.8A Pending CN116703868A (en) | 2023-06-09 | 2023-06-09 | Webpage element testing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116703868A (en) |
-
2023
- 2023-06-09 CN CN202310684471.8A patent/CN116703868A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110147774B (en) | Table format picture layout analysis method and computer storage medium | |
JP6000455B2 (en) | Form recognition method and form recognition apparatus | |
CN111640089B (en) | Defect detection method and device based on feature map center point | |
CN111723798B (en) | Multi-instance natural scene text detection method based on relevance hierarchy residual errors | |
US8019164B2 (en) | Apparatus, method and program product for matching with a template | |
US8396303B2 (en) | Method, apparatus and computer program product for providing pattern detection with unknown noise levels | |
TWI533383B (en) | Design-based inspection using repeating structures | |
CN107368829B (en) | Method and apparatus for determining rectangular target area in input image | |
CN104239909A (en) | Method and device for recognizing images | |
CN111814905A (en) | Target detection method, target detection device, computer equipment and storage medium | |
CN112634201B (en) | Target detection method and device and electronic equipment | |
US9336587B2 (en) | Semiconductor circuit pattern measuring apparatus and method | |
CN111881764A (en) | Target detection method and device, electronic equipment and storage medium | |
CN117392464A (en) | Image anomaly detection method and system based on multi-scale denoising probability model | |
CN104700388A (en) | Method and device for extracting distorted lines from images | |
CN111462056A (en) | Workpiece surface defect detection method, device, equipment and storage medium | |
CN112633327B (en) | Staged metal surface defect detection method, system, medium, equipment and application | |
CN111027551B (en) | Image processing method, apparatus and medium | |
CN116703868A (en) | Webpage element testing method and device | |
CN117011223A (en) | Method and system for detecting few PCB defect samples based on dense prediction | |
CN116030472A (en) | Text coordinate determining method and device | |
CN114897797A (en) | Method, device and equipment for detecting defects of printed circuit board and storage medium | |
CN111599080B (en) | Spliced paper money detection method and device, financial machine tool equipment and storage medium | |
CN111256609B (en) | Method and device for detecting USB interface depth | |
CN115908532A (en) | Line width identification method, line width identification device, medium and electronic device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |