Click response time testing method, device, electronic device, storage medium and program product
By connecting the screen clicker and the light-emitting diode in parallel and combining it with image processing technology to automatically identify the time point when the click is completed, the problems of low accuracy and efficiency of manual testing are solved, and high-precision click response duration testing is achieved.
Patent Information
- Application Number
- CN202411595220.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-11-08
AI Technical Summary
In the prior art, testing click response duration requires manual intervention, resulting in poor accuracy and low efficiency.
A screen clicker is connected in parallel with the light-emitting diode, and the time point of the click completion is automatically identified through image processing technology. The light-emitting diode is photographed with a high-speed camera to achieve automated testing.
The accuracy and efficiency of the test are improved, the test accuracy can be within 10ms, and human errors are reduced.
Smart Images

Figure CN119493717B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of terminal devices, and in particular to a method, device, electronic device, storage medium, and program product for testing click response duration. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the present disclosure that are recited in the claims. No statement herein is admitted to be prior art by virtue of its inclusion in this section.
[0003] A touch screen terminal device is a device that integrates touch screen technology, allowing users to interact with the device by directly touching the screen.
[0004] Click operation is one of the main operations of touch screen interaction. For electronic games or applications, the click response time is the operation experience that users can directly feel and is also an important indicator for user interaction experience testing.
[0005] In related technologies, when testing click response duration, manual participation is usually required in many steps to complete the test.
[0006] However, manual participation may result in poor accuracy in testing click response duration, for example, poor accuracy in determining the time point when the manual click operation leaves the touch screen, and low test efficiency. Summary of the Invention
[0007] In view of this, the purpose of the present disclosure is to provide a method, device, electronic device, storage medium and program product for testing click response duration, which at least to some extent solve one of the technical problems in the related art.
[0008] Based on the above objectives, a first aspect of an exemplary embodiment of the present disclosure provides a method for testing click response duration, comprising:
[0009] Connect a screen clicker in parallel with a light-emitting diode and then in series with a switch and a power supply. Place the screen to be tested within the operating range of the screen clicker and place a preset pattern consisting of two colors within a preset range around the light-emitting diode.
[0010] Acquiring a first image when the switch is closed and a second image when the switch is open, wherein both the first image and the second image include the light-emitting diode and the preset pattern, clustering the first image and obtaining a first cluster center, a second cluster center, and a third cluster center based on the preset pattern, and clustering the second image and obtaining a fourth cluster center based on the preset pattern;
[0011] Controlling the switch to be closed until the screen clicker completes clicking and the screen to be tested completes clicking response, controlling the switch to be opened, and acquiring a video from closing the switch to opening the switch, wherein the video includes the light-emitting diode, the preset pattern, and the screen to be tested;
[0012] For each frame image in the video, clustering the pixels of the frame image based on the first cluster center, the second cluster center, the third cluster center, and the fourth cluster center, determining the total number of pixels in the frame image, the number of third pixels clustered to the third cluster center, the number of light-emitting diode pixels of the light-emitting diode in the second image, and the number of preset pattern pixels of the preset pattern, so as to determine the light-emitting state of the light-emitting diode in the frame image;
[0013] Traverse each frame image in the video, determine the starting frame image and the starting time point of the click based on the lighting state of the light-emitting diode, traverse all frame images after the starting frame image, and determine the time point when the click response is completed based on the difference value between adjacent frame images, and use the time difference between the time point when the click response is completed and the starting time point of the click as the click response duration.
[0014] Based on the same inventive concept, a second aspect of the exemplary embodiment of the present disclosure provides a device for testing click response duration, comprising:
[0015] a test scenario construction module configured to connect a screen clicker in parallel with a light-emitting diode and then in series with a switch and a power supply, place a screen to be tested within an operating range of the screen clicker, and place a preset pattern including two colors within a preset range around the light-emitting diode;
[0016] a cluster center determination module configured to obtain a first image when the switch is closed and a second image when the switch is open, wherein both the first image and the second image contain the light-emitting diode and the preset pattern, cluster the first image and obtain a first cluster center, a second cluster center, and a third cluster center based on the preset pattern, and cluster the second image and obtain a fourth cluster center based on the preset pattern;
[0017] a test video acquisition module, configured to control the switch to be closed until the screen clicker completes the click and the screen to be tested completes the click response, control the switch to be opened, and acquire a video from the closing of the switch to the opening of the switch, wherein the video includes the light-emitting diode, the preset pattern, and the screen to be tested;
[0018] a test video processing module configured to cluster pixels of each frame image in the video based on the first cluster center, the second cluster center, the third cluster center, and the fourth cluster center, determine the total number of pixels in the frame image, the number of third pixels clustered to the third cluster center, the number of LED pixels of the LED in the second image, and the number of preset pattern pixels of the preset pattern, so as to determine the light-emitting state of the LED in the frame image;
[0019] The response duration determination module is configured to traverse each frame image in the video, determine the starting frame image and the starting time point of the click based on the lighting state of the light-emitting diode, traverse all frame images after the starting frame image, and determine the time point when the click response is completed based on the difference value between adjacent frame images, and use the time difference between the time point when the click response is completed and the starting time point of the click as the click response duration.
[0020] Based on the same inventive concept, the third aspect of the exemplary embodiment of the present disclosure provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect is implemented.
[0021] Based on the same inventive concept, a fourth aspect of the exemplary embodiment of the present disclosure provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method described in the first aspect.
[0022] Based on the same inventive concept, a fifth aspect of the exemplary embodiments of the present disclosure provides a computer program product, including computer program instructions. When the computer program instructions are executed on a computer, the computer is caused to execute the method described in the first aspect.
[0023] From the above description, it can be seen that the test method, device, electronic device, storage medium and program product for click response duration provided by the embodiments of the present disclosure include: connecting a screen clicker in parallel with a light-emitting diode and then connecting them in series with a switch and a power supply, placing the screen to be tested within the operating range of the screen clicker, and placing a preset pattern including two colors within a preset range around the light-emitting diode; obtaining a first image when the switch is closed and a second image when the switch is disconnected, both the first image and the second image contain the light-emitting diode and the preset pattern, clustering the first image, and obtaining a first cluster center, a second cluster center and a third cluster center based on the preset pattern, clustering the second image, and obtaining a fourth cluster center based on the preset pattern; controlling the switch to be closed until the screen clicker completes the click and the screen to be tested completes the click response, controlling the switch to be opened, and obtaining the time from closing the switch to opening the switch. A video of the switch, wherein the video includes the light-emitting diode, the preset pattern and the screen to be tested; for each frame image in the video, the pixels of the frame image are clustered based on the first cluster center, the second cluster center, the third cluster center and the fourth cluster center, and the total number of pixels of the frame image, the number of third pixels clustered to the third cluster center, the number of light-emitting diode pixels of the light-emitting diode in the second image and the number of preset pattern pixels of the preset pattern are determined to determine the light-emitting state of the light-emitting diode in the frame image; traverse each frame image in the video, determine the starting frame image and the starting time point of the click based on the light-emitting state of the light-emitting diode, traverse all frame images after the starting frame image, determine the time point when the click response is completed based on the difference value between adjacent frame images, and use the time difference between the time point when the click response is completed and the starting time point of the click as the click response duration.
[0024] Using a power-driven screen clicker and LEDs to perform clicks accurately records the time of click completion, improving test accuracy and automating the process. This significantly increases test efficiency compared to manual testing. Using a camera to capture the LEDs and using image processing technology to automatically identify the time of click completion improves test accuracy. Using a high-speed camera can improve test accuracy to within 10ms, further enhancing test precision. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0026] Figure 1 A flowchart of a method for testing click response duration provided by an exemplary embodiment of the present disclosure;
[0027] Figure 2 A schematic structural diagram of a test scenario for click response duration provided by an exemplary embodiment of the present disclosure;
[0028] Figure 3 A schematic structural diagram of a preset pattern and a light-emitting diode provided by an exemplary embodiment of the present disclosure;
[0029] Figure 4 Another structural schematic diagram of a preset pattern and a light-emitting diode provided by an exemplary embodiment of the present disclosure;
[0030] Figure 5 A schematic structural diagram of a device for testing click response duration provided by an exemplary embodiment of the present disclosure;
[0031] Figure 6 A schematic structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0032] To make the objectives, technical solutions, and advantages of the present disclosure more clearly understood, the principles and spirit of the present disclosure will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided solely to enable those skilled in the art to better understand and implement the present disclosure, and are not intended to limit the scope of the present disclosure in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0033] It should be understood herein that any number of elements in the drawings is for illustration only and not for limitation, and any naming is only for distinction and does not have any limiting meaning.
[0034] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should have the usual meanings understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the embodiments of the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly. The article "one" or "an" before an element does not exclude the presence of multiple such elements.
[0035] The principles and spirit of the present disclosure are explained in detail below with reference to several representative embodiments of the present disclosure.
[0036] As described in the background art, a touch screen terminal device is a device integrated with touch screen technology, allowing a user to interact with the device by directly touching the screen.
[0037] Touch screen technology makes operation more intuitive and convenient, and is widely used in personal portable information products, home appliances, public information inquiry, electronic games, communication equipment, office automation equipment, information collection equipment and industrial equipment.
[0038] Click operation is one of the main operations of touch screen interaction. For electronic games or applications, the click response time is the operation experience that users can directly feel and is also an important indicator for user interaction experience testing.
[0039] In related technologies, when testing click response duration, manual participation is usually required in many steps, such as:
[0040] First, manually perform the click operation and record the time point of the manual click operation.
[0041] Then manually observe the response after the click operation, determine the time point when the response is completed and record it.
[0042] For scenarios with high test accuracy requirements, the entire process can also be saved through a camera or screen capture card, and then the key time points can be manually observed frame by frame.
[0043] However, the inventors of the present disclosure have found that manual participation will lead to poor accuracy in testing click response duration and low test efficiency. The reasons for the poor accuracy and low test efficiency in the above-mentioned related technologies are:
[0044] Manual judgment of click timing is inaccurate. Because the click timing is the moment when the touch screen is released after clicking, it is difficult for manual clicks to accurately determine the time point when the touch screen is released (for example, the error must be less than 20ms).
[0045] Manually observing the click timing and response completion timing frame by frame consumes a lot of time and the test efficiency is not high.
[0046] To solve the above problems, the present disclosure provides a test solution for click response duration, which specifically includes:
[0047] A screen clicker is connected in parallel with a light-emitting diode and then in series with a switch and a power supply, the screen to be tested is placed within the operating range of the screen clicker, and a preset pattern including two colors is placed within a preset range around the light-emitting diode; a first image when the switch is closed and a second image when the switch is disconnected are obtained, the first image and the second image both contain the light-emitting diode and the preset pattern, the first image is clustered, and a first cluster center, a second cluster center, and a third cluster center are obtained based on the preset pattern, the second image is clustered, and a fourth cluster center is obtained based on the preset pattern; the switch is controlled to be closed until the screen clicker completes the click and the screen to be tested completes the click response, the switch is controlled to be disconnected, and a video from closing the switch to opening the switch is obtained, the video containing the light-emitting diode, the preset pattern and the screen to be tested; for each frame image in the video, cluster the pixels of the frame image based on the first cluster center, the second cluster center, the third cluster center and the fourth cluster center, determine the total number of pixels of the frame image, the number of third pixels clustered to the third cluster center, the number of light-emitting diode pixels of the light-emitting diode in the second image and the number of preset pattern pixels of the preset pattern, so as to determine the light-emitting state of the light-emitting diode in the frame image; traverse each frame image in the video, determine the starting frame image and the starting time point of the click based on the light-emitting state of the light-emitting diode, traverse all frame images after the starting frame image, determine the time point when the click response is completed based on the difference value between adjacent frame images, and use the time difference between the time point when the click response is completed and the starting time point of the click as the click response duration.
[0048] Among them, clicking is performed through a power-driven screen clicker and light-emitting diode, which accurately records the time when the click is completed, improves the test accuracy, and automatically finds the time when the click is completed. Compared with manual testing, the test efficiency is greatly improved, thereby improving the test efficiency.
[0049] The light-emitting diode is photographed by a camera, and the time point when the click is completed is automatically identified using image processing technology, thereby improving the test accuracy.
[0050] The use of high-speed cameras can improve the test accuracy to within 10ms, thereby improving the test accuracy.
[0051] After introducing the basic principles of the present disclosure, various non-limiting embodiments of the present disclosure are described in detail below.
[0052] refer to Figure 1 , which is a flow chart of a method for testing click response duration provided by an exemplary embodiment of the present disclosure.
[0053] The test method for click response time includes the following steps:
[0054] Step S110: connect a screen clicker and a light emitting diode in parallel and then in series with a switch and a power supply, place the screen to be tested within the operating range of the screen clicker, and place a preset pattern including two colors within a preset range around the light emitting diode.
[0055] In specific implementation, the purpose of step S110 is to construct a test scenario for click response duration, specifically:
[0056] The test scenarios for click response time include:
[0057] Screen clicker, LEDs, switches, power supply, screen to be tested and preset patterns and camera.
[0058] refer to Figure 2 , where the screen clicker and the light-emitting diode are first connected in parallel, and then in series with the switch and the power supply.
[0059] During specific implementation, the screen clicker is used to simulate the action of the user clicking the screen.
[0060] Below, we will introduce how to select the screen clicker, specifically:
[0061] In this exemplary embodiment, the screen type of the screen to be tested is determined, and based on the screen type, the clicker type of the screen clicker is determined.
[0062] During specific implementation, the screen types to be tested include:
[0063] Capacitive touch screen, resistive touch screen, surface acoustic wave touch screen (SAW), infrared touch screen, electromagnetic touch screen, optical touch screen, pressure touch screen, bending wave touch screen, holographic touch screen, nano touch technology and plasma touch screen, etc.
[0064] Then, the clicker type of the screen clicker corresponding to the screen type of the screen to be tested includes:
[0065] Capacitive screen clickers and resistive screen clickers, etc.
[0066] Among them, the capacitive screen clicker uses the electromagnetic principle to simulate the touch of a human finger. It generates a magnetic field through an electromagnetic coil, causing the capacitance of the capacitive screen to change, thereby achieving a click effect.
[0067] Resistive screen clickers use mechanical pressure to simulate touch. They detect touch location by applying pressure between the two conductive layers of the resistive screen, creating contact and a circuit. For example, a clicker built using a microcontroller can programmatically control the high and low levels of an IO port, simulating the effect of a finger pressing the screen.
[0068] Furthermore, since the resistive screen clicker uses mechanical pressure to simulate touch, it can also be applied to surface acoustic wave touch screens, infrared touch screens, electromagnetic touch screens, optical touch screens, pressure touch screens, bending wave touch screens, holographic touch screens, nano touch technology and plasma touch screens, etc.
[0069] In this exemplary embodiment, the steps of connecting a screen clicker in parallel with a light-emitting diode and then in series with a switch and a power supply, and placing the screen to be tested within the operating range of the screen clicker, include:
[0070] In response to determining that the screen type of the screen to be tested is a capacitive screen, determining that the clicker type of the screen clicker is a capacitive screen clicker;
[0071] or,
[0072] In response to determining that the screen type of the screen to be tested is a resistive screen, the clicker type of the screen clicker is determined to be a resistive screen clicker.
[0073] In this exemplary embodiment, the screen clicker is an electric high-speed clicker.
[0074] During specific implementation, the light emitting diode is used to emit light of a specified color.
[0075] As a specific example, the designated color includes one of red, green, or blue.
[0076] In a specific implementation, the power supply is used to provide power to the screen clicker and the light-emitting diode.
[0077] As a specific example, the power source includes a portable power source such as a battery.
[0078] In a specific implementation, the switch is used to control the power supply to provide power to the screen clicker and the light-emitting diode.
[0079] In this exemplary embodiment, a preset pattern including two colors is placed within a preset range around the light emitting diode. Specifically:
[0080] In this exemplary embodiment, the preset pattern includes:
[0081] White background with black geometric figures.
[0082] In this exemplary embodiment, placing a preset pattern including two colors within a preset range around the light-emitting diode includes:
[0083] hollowing out a designated portion of the geometric figure to obtain a hollowed-out portion;
[0084] The light emitting diode is placed in the hollow portion.
[0085] refer to Figure 3 , as a specific example, the target pattern includes a white background and a black circle.
[0086] The center portion of the black circle is hollowed out, for example, the hollowed portion is circular, and the light emitting diode D1 is placed in the hollowed portion.
[0087] refer to Figure 4 , as a specific example, the target pattern includes a white background and a black rectangle.
[0088] The center portion of the black rectangle is hollowed out, for example, the hollowed portion is rectangular, and the light emitting diode D1 is placed in the hollowed portion.
[0089] Step S120: Acquire a first image when the switch is closed and a second image when the switch is open, wherein both the first image and the second image contain the light-emitting diode and the preset pattern, cluster the first image, and obtain a first cluster center, a second cluster center, and a third cluster center based on the preset pattern, cluster the second image, and obtain a fourth cluster center based on the preset pattern.
[0090] In this exemplary embodiment, acquiring a first image when the switch is closed and a second image when the switch is open, wherein both the first image and the second image include the light-emitting diode and the preset pattern, clustering the first image and obtaining a first cluster center, a second cluster center, and a third cluster center based on the preset pattern, and clustering the second image and obtaining a fourth cluster center based on the preset pattern, includes:
[0091] Converting the preset pattern into an HSV color space to obtain a first HSV color and a second HSV color;
[0092] Acquiring a first image when the switch is closed, converting the first image into an HSV color space to obtain a first HSV image, clustering HSV values of pixels in the first HSV image, using the cluster center closest to the first HSV color as the first cluster center, using the cluster center closest to the second HSV color as the second cluster center, and using the remaining cluster centers as the third cluster centers;
[0093] Obtain a second image when the switch is disconnected, convert the second image into an HSV color space to obtain a second HSV image, cluster the HSV values of the pixels of the second HSV image, and use the cluster center farthest from the first cluster center and the second cluster center as the fourth cluster center.
[0094] Considering that the diode is bright when closed, and its color differs significantly from the preset pattern, clustering can better distinguish different areas. However, when the diode is disconnected, the area where the diode is located may be darker and difficult to distinguish from the preset area. Therefore, when processing the second image and in subsequent processing, the first and second cluster centers obtained from processing the first image are used, and the second image is used to determine the fourth cluster center.
[0095] In specific implementation, the conversion steps from RGB color space to HSV color space are:
[0096] 1. Determine the maximum and minimum values: Among the three RGB components, find the maximum value maxc and the minimum value minc.
[0097] 2. Calculate hue (H):
[0098] If maxc is equal to minc, then H=0 (indicates gray, no hue).
[0099] Otherwise, calculate H depending on whether maxc is R, G, or B:
[0100] If maxc is R, then H = 60(GB) / (maxc-minc)+0° (if the result is a negative number, add 360°).
[0101] If maxc is G, then H=60(BR) / (maxc-minc)+120°.
[0102] If maxc is B, then H=60(RG) / (maxc-minc)+240°.
[0103] 3. Calculate saturation (S):
[0104] If maxc is equal to 0, then S=0 (represented as black, no color).
[0105] Otherwise, S = (maxc - minc) / maxc.
[0106] 4. Calculate the value (V):
[0107] V=maxc.
[0108] In specific implementation, the way to cluster pixels is:
[0109] Clustering algorithms such as K-means and K-Medoids can be used.
[0110] In specific implementation, the distance between the cluster center and the first HSV color or the second HSV color is calculated as follows:
[0111] For the first image when the switch is closed: the three cluster centers are converted into vectors. According to the distances between the cluster centers and C1 and C2, the cluster center closest to C1 is determined as the cluster center of C1, the cluster center closest to C2 is determined as the cluster center of C2, and the remaining cluster center is the cluster center of C3.
[0112] For the second image when the switch is off: the three cluster centers are converted into vectors. According to the distances between the cluster centers and C1 and C2, the cluster center closest to C1 is determined as the cluster center of C1, the cluster center closest to C2 is determined as the cluster center of C2, and the remaining cluster center is the cluster center of C4.
[0113] Step S130, controlling the closing of the switch until the screen clicker completes clicking and the screen to be tested completes clicking response, controlling the opening of the switch, and obtaining a video from closing the switch to opening the switch, wherein the video includes the light-emitting diode, the preset pattern, and the screen to be tested.
[0114] During specific implementation, taking into account errors and fault tolerance, a short pre- and post-time period may be added before closing and after opening to avoid errors and improve fault tolerance.
[0115] In a specific implementation, considering that the size of the frame image in the video is usually larger than the first image and the second image including the light-emitting diode and the preset pattern, the frame image in the video is preprocessed to improve the subsequent processing efficiency and recognition accuracy. Specifically:
[0116] In this exemplary embodiment, after obtaining a video from closing the switch to opening the switch, wherein the video includes the light-emitting diode, the preset pattern, and the screen to be tested, the method further includes:
[0117] For each frame image in the video, performing image template matching on the frame image based on a preset image template to obtain a matching image;
[0118] The image template is obtained based on the light-emitting diode, the preset pattern and the screen to be tested.
[0119] In this exemplary embodiment, the size of the frame image is larger than the image template.
[0120] The performing image template matching on the frame image based on the preset image template to obtain the matching image includes:
[0121] Sliding the image template on the frame image;
[0122] The portion of the frame image covered by the image template is used as a sub-image;
[0123] Determining the similarity between the image template and each sub-image;
[0124] The sub-image with the highest similarity is used as the matching image.
[0125] During specific implementation, the matching image includes the light-emitting diode, the preset pattern and the screen to be tested, and does not include other contents as much as possible, so as to improve the efficiency and accuracy of processing the matching image.
[0126] Through the above exemplary embodiments, the frame images in the video with a larger size are preprocessed into matching images with a smaller size (compared to the frame images in the video), thereby improving subsequent processing efficiency and recognition accuracy.
[0127] Step S140: For each frame image in the video, cluster the pixels of the frame image based on the first cluster center, the second cluster center, the third cluster center and the fourth cluster center, and determine the total number of pixels of the frame image, the number of third pixels clustered to the third cluster center, the number of LED pixels of the LED in the second image, and the number of preset pattern pixels of the preset pattern to determine the light-emitting state of the LED in the frame image.
[0128] In this exemplary embodiment, for each frame image in the video, clustering the pixels of the frame image based on the first cluster center, the second cluster center, the third cluster center, and the fourth cluster center, determining the total number of pixels in the frame image, the number of third pixels clustered to the third cluster center, the number of light-emitting diode pixels of the light-emitting diode in the second image, and the number of preset pattern pixels of the preset pattern, so as to determine the light-emitting state of the light-emitting diode in the frame image, includes:
[0129] For each frame image in the video, convert the frame image into the HSV color space to obtain an HSV frame image;
[0130] Clustering the pixels of the HSV frame image based on the first cluster center, the second cluster center, the third cluster center, and the fourth cluster center;
[0131] Determine the total number of pixels of the HSV frame image, the number of third pixels clustered to the third cluster center, the number of LED pixels of the LED in the second image, and the number of preset pattern pixels of the preset pattern to determine the light-emitting state of the LED in the frame image.
[0132] In this exemplary embodiment, determining the total number of pixels of the HSV frame image, the number of third pixels clustered to the third cluster center, the number of LED pixels of the LED in the second image, and the number of preset pattern pixels of the preset pattern to determine the light emitting state of the LED in the frame image includes:
[0133] determining a first ratio of the third number of pixels to the total number of pixels;
[0134] determining a second ratio of the number of light-emitting diode pixels of the light-emitting diode to the number of preset pattern pixels of the preset pattern in the second image;
[0135] In response to determining that the first ratio is greater than or equal to the product of the second ratio and a preset threshold parameter, determining that the light emitting diode in the current frame image is in a light emitting state,
[0136] or,
[0137] In response to determining that the first ratio is less than the product of the second ratio and a preset threshold parameter, it is determined that the light emitting diode in the current frame image is in a non-lighting state.
[0138] As a specific example:
[0139] P3 represents the number of third pixels clustered to the third cluster center, P represents the total number of pixels of the HSV frame image, S1 represents the number of LED pixels of the LED in the second image, S represents the number of preset pattern pixels of the preset pattern in the second image, and j represents the preset threshold parameter.
[0140] Then, if P3 / P>=j*S1 / S, it is determined that the light emitting diode in the current frame image is in a light emitting state;
[0141] If P3 / P<j*S1 / S, it is determined that the light emitting diode in the current frame image is in a non-lighting state.
[0142] Step S150: traverse each frame image in the video, determine the starting frame image and the starting time point of the click based on the lighting state of the light-emitting diode, traverse all frame images after the starting frame image, and determine the time point when the click response is completed based on the difference value between adjacent frame images, and use the time difference between the time point when the click response is completed and the starting time point of the click as the click response duration.
[0143] In this exemplary embodiment, traversing each frame image in the video and determining the starting frame image and the starting time point of the click based on the lighting state of the light-emitting diode includes:
[0144] Traversing each frame image in the video;
[0145] In response to determining that the light emitting diode in the current frame image is in a non-light emitting state and the light emitting diode in the frame image before the current frame image is in a light emitting state, determining the current frame image as the starting frame image;
[0146] The time point corresponding to the current frame image is determined as the starting time point of the click.
[0147] Through the above exemplary embodiments, since the light-emitting diode and the screen clicker are connected in parallel, by determining the on and off status of the light-emitting diode (that is, whether it is in a light-emitting state or a non-light-emitting state), it is possible to determine whether the screen clicker clicks the screen, thereby determining the starting frame image, and further determining the starting time point of the click.
[0148] In this exemplary embodiment, traversing all frame images after the starting frame image and determining the time point when the click response is completed based on the difference value between adjacent frame images includes:
[0149] Traversing all frame images after the starting frame image;
[0150] Calculate the difference between adjacent frame images;
[0151] The difference values are arranged in descending order, and the time point at which the click response is completed is determined based on the time points corresponding to the adjacent frame images corresponding to the difference values of the preset names in the front order.
[0152] In this exemplary embodiment, calculating the difference value between adjacent frame images includes:
[0153] Determine the screen area image to be tested in the frame image;
[0154] Calculate the difference between the images of the screen area to be tested in adjacent frame images.
[0155] In this exemplary embodiment, calculating the difference value between adjacent frame images includes:
[0156] The mean square error of the pixel value differences between adjacent frame images is used as the difference value between adjacent frame images.
[0157] In specific implementation, for each pixel point in the image, the difference in pixel values of the two frames of images at that point is calculated;
[0158] The difference value can be positive or negative, indicating the brightness change of a pixel between two frames. The difference value can be processed as an absolute value to indicate the magnitude of the change.
[0159] As a specific example:
[0160] Set the judgment threshold to N.
[0161] The time point at which the click response is completed is selected from the time points corresponding to the first N groups of adjacent frame images with relatively large differences.
[0162] In a specific implementation, if the content displayed on the screen is switched instantly when responding to a click, then the time point corresponding to the next frame image among the adjacent frames with a difference value is the time point when the click response is completed;
[0163] However, if the switching of the content displayed when the screen responds to a click is a process, then first determine the adjacent frame images with larger difference values, and preliminarily exclude the frames with smaller difference values, which are unlikely to be response completion frames. Then, the user can subsequently select a specific part of them as the test result to determine the response completion frame image.
[0164] In specific implementation, since some frames in N groups of adjacent frames may overlap, for example, in two groups of adjacent frames 1 to 2 and 2 to 3, 2 is overlapped, and there are only 3 frames, the determined adjacent frames can be used as the preliminary result of the response.
[0165] In this exemplary embodiment, the time difference between the time point when the click response is completed and the time point when the click is started is used as the click response duration, including:
[0166] Click response duration = click response completion time - click start time.
[0167] In the above exemplary embodiment, the test of the click response duration of a screen to be tested is described as an example. When it is necessary to test the click response duration of multiple screens to be tested, the test of the click response duration can be achieved by replacing the screen to be tested and repeating the solution of the above exemplary embodiment.
[0168] As can be seen from the above, the test method for click response duration provided by the embodiment of the present disclosure includes: connecting a screen clicker in parallel with a light-emitting diode and then connecting them in series with a switch and a power supply, placing the screen to be tested within the operating range of the screen clicker, and placing a preset pattern including two colors within a preset range around the light-emitting diode; obtaining a first image when the switch is closed and a second image when the switch is disconnected, the first image and the second image both contain the light-emitting diode and the preset pattern, clustering the first image, and obtaining a first cluster center, a second cluster center, and a third cluster center based on the preset pattern, clustering the second image, and obtaining a fourth cluster center based on the preset pattern; controlling the closure of the switch until the screen clicker completes the click and the screen to be tested completes the click response, controlling the disconnection of the switch, and obtaining a video from closing the switch to disconnecting the switch, the video includes the light-emitting diode, the preset pattern and the screen to be tested; for each frame image in the video, the pixels of the frame image are clustered based on the first cluster center, the second cluster center, the third cluster center and the fourth cluster center, and the total number of pixels of the frame image, the number of third pixels clustered to the third cluster center, the number of light-emitting diode pixels of the light-emitting diode in the second image and the number of preset pattern pixels of the preset pattern are determined to determine the light-emitting state of the light-emitting diode in the frame image; traverse each frame image in the video, determine the starting frame image and the starting time point of the click based on the light-emitting state of the light-emitting diode, traverse all frame images after the starting frame image, determine the time point when the click response is completed based on the difference value between adjacent frame images, and take the time difference between the time point when the click response is completed and the starting time point of the click as the click response duration.
[0169] Using a power-driven screen clicker and LEDs to perform clicks accurately records the time of click completion, improving test accuracy and automating the process. This significantly increases test efficiency compared to manual testing. Using a camera to capture the LEDs and using image processing technology to automatically identify the time of click completion improves test accuracy. Using a high-speed camera can improve test accuracy to within 10ms, further enhancing test precision.
[0170] It should be noted that the method of the embodiments of the present disclosure can be performed by a single device, such as a computer or server. The method of the embodiments of the present disclosure can also be applied in a distributed scenario, where multiple devices cooperate to perform the method. In such a distributed scenario, one of the multiple devices may only perform one or more steps of the method of the embodiments of the present disclosure, and the multiple devices will interact with each other to complete the method.
[0171] It should be noted that the above description is limited to some embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in an order different from that described in the above embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0172] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure further provides a device for testing click response duration.
[0173] refer to Figure 5 , which is a structural diagram of a device for testing click response duration provided by an exemplary embodiment of the present disclosure.
[0174] The test device for click response time includes the following modules:
[0175] The test scenario construction module 910 is configured to connect a screen clicker in parallel with a light-emitting diode and then in series with a switch and a power supply, place the screen to be tested within the operating range of the screen clicker, and place a preset pattern including two colors within a preset range around the light-emitting diode;
[0176] a cluster center determination module 920 configured to obtain a first image when the switch is closed and a second image when the switch is open, wherein both the first image and the second image contain the light-emitting diode and the preset pattern, cluster the first image and obtain first, second, and third cluster centers based on the preset pattern, and cluster the second image and obtain a fourth cluster center based on the preset pattern;
[0177] The test video acquisition module 930 is configured to control the switch to be closed until the screen clicker completes the click and the screen to be tested completes the click response, then control the switch to be opened, and acquire a video from the closing of the switch to the opening of the switch, wherein the video includes the light-emitting diode, the preset pattern, and the screen to be tested;
[0178] a test video processing module 940 configured to cluster pixels of each frame image in the video based on the first cluster center, the second cluster center, the third cluster center, and the fourth cluster center, determine the total number of pixels in the frame image, the number of third pixels clustered to the third cluster center, the number of LED pixels of the LED in the second image, and the number of preset pattern pixels of the preset pattern, so as to determine the light emitting state of the LED in the frame image;
[0179] The response duration determination module 950 is configured to traverse each frame image in the video, determine the starting frame image and the starting time point of the click based on the lighting state of the light-emitting diode, traverse all frame images after the starting frame image, and determine the time point when the click response is completed based on the difference value between adjacent frame images, and use the time difference between the time point when the click response is completed and the starting time point of the click as the click response duration.
[0180] In some exemplary embodiments, the cluster center determination module 920 is specifically configured to:
[0181] Converting the preset pattern into an HSV color space to obtain a first HSV color and a second HSV color;
[0182] Acquiring a first image when the switch is closed, converting the first image into an HSV color space to obtain a first HSV image, clustering HSV values of pixels in the first HSV image, using the cluster center closest to the first HSV color as the first cluster center, using the cluster center closest to the second HSV color as the second cluster center, and using the remaining cluster centers as the third cluster centers;
[0183] Obtain a second image when the switch is disconnected, convert the second image into an HSV color space to obtain a second HSV image, cluster the HSV values of the pixels of the second HSV image, and use the cluster center farthest from the first cluster center and the second cluster center as the fourth cluster center.
[0184] In some exemplary embodiments, the test video acquisition module 930 is further configured to:
[0185] For each frame image in the video, performing image template matching on the frame image based on a preset image template to obtain a matching image;
[0186] The image template is obtained based on the light-emitting diode, the preset pattern and the screen to be tested.
[0187] In some exemplary embodiments, the size of the frame image is larger than the image template, and the test video acquisition module 930 is further configured to:
[0188] Sliding the image template on the frame image;
[0189] The portion of the frame image covered by the image template is used as a sub-image;
[0190] Determining the similarity between the image template and each sub-image;
[0191] The sub-image with the highest similarity is used as the matching image.
[0192] In some exemplary embodiments, the test video processing module 940 is specifically configured to:
[0193] For each frame image in the video, convert the frame image into the HSV color space to obtain an HSV frame image;
[0194] Clustering the pixels of the HSV frame image based on the first cluster center, the second cluster center, the third cluster center, and the fourth cluster center;
[0195] Determine the total number of pixels of the HSV frame image, the number of third pixels clustered to the third cluster center, the number of LED pixels of the LED in the second image, and the number of preset pattern pixels of the preset pattern to determine the light-emitting state of the LED in the frame image.
[0196] In some exemplary embodiments, the test video processing module 940 is specifically configured to:
[0197] determining a first ratio of the third number of pixels to the total number of pixels;
[0198] determining a second ratio of the number of light-emitting diode pixels of the light-emitting diode to the number of preset pattern pixels of the preset pattern in the second image;
[0199] In response to determining that the first ratio is greater than or equal to the product of the second ratio and a preset threshold parameter, determining that the light emitting diode in the current frame image is in a light emitting state,
[0200] or,
[0201] In response to determining that the first ratio is less than the product of the second ratio and a preset threshold parameter, it is determined that the light emitting diode in the current frame image is in a non-lighting state.
[0202] In some exemplary embodiments, the response duration determination module 950 is specifically configured to:
[0203] Traversing each frame image in the video;
[0204] In response to determining that the light emitting diode in the current frame image is in a non-light emitting state and the light emitting diode in the frame image before the current frame image is in a light emitting state, determining the current frame image as the starting frame image;
[0205] The time point corresponding to the current frame image is determined as the starting time point of the click.
[0206] In some exemplary embodiments, the response duration determination module 950 is specifically configured to:
[0207] Traversing all frame images after the starting frame image;
[0208] Calculate the difference between adjacent frame images;
[0209] The difference values are arranged in descending order, and the time point at which the click response is completed is determined based on the time points corresponding to the adjacent frame images corresponding to the difference values of the preset names in the front order.
[0210] In some exemplary embodiments, the preset pattern includes:
[0211] White background with black geometric figures.
[0212] In some exemplary embodiments, the test scenario construction module 910 is specifically configured to:
[0213] hollowing out a designated portion of the geometric figure to obtain a hollowed-out portion;
[0214] The light emitting diode is placed in the hollow portion.
[0215] In some exemplary embodiments, the test scenario construction module 910 is specifically configured to:
[0216] In response to determining that the screen type of the screen to be tested is a capacitive screen, determining that the clicker type of the screen clicker is a capacitive screen clicker;
[0217] or,
[0218] In response to determining that the screen type of the screen to be tested is a resistive screen, the clicker type of the screen clicker is determined to be a resistive screen clicker.
[0219] For the convenience of description, the above devices are described as being functionally divided into various modules. Of course, when implementing the present disclosure, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0220] The device of the above embodiment is used to implement the corresponding click response duration testing method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0221] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for testing the click response duration described in any of the above embodiments is implemented.
[0222] Figure 6 10 is a schematic diagram showing a more specific hardware structure of an electronic device provided in this embodiment. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are communicatively connected to each other within the device via the bus 1050.
[0223] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0224] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage devices, dynamic storage devices, etc. The memory 1020 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.
[0225] The input / output interface 1030 is used to connect an input / output module to implement information input and output. The input / output module can be configured as a component in the device (not shown in the figure) or can be externally connected to the device to provide corresponding functions. Input devices may include a keyboard, mouse, touch screen, microphone, various sensors, etc., and output devices may include a display, speaker, vibrator, indicator light, etc.
[0226] The communication interface 1040 is used to connect to a communication module (not shown) to enable communication between the device and other devices. The communication module can communicate via a wired method (such as USB, network cable, etc.) or a wireless method (such as mobile network, WiFi, Bluetooth, etc.).
[0227] The bus 1050 comprises a path for transmitting information between the various components of the device (eg, the processor 1010 , the memory 1020 , the input / output interface 1030 , and the communication interface 1040 ).
[0228] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. In addition, those skilled in the art will understand that the above device may also include the components necessary to implement the embodiments of this specification, and does not necessarily include all the components shown in the figures.
[0229] The electronic device of the above embodiment is used to implement the corresponding test method of click response duration in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here.
[0230] The memory 1020 stores machine-readable instructions executable by the processor 1010. When the electronic device is running, the processor 1010 communicates with the memory 1020 via the bus 1030, so that the processor 1010 executes the following instructions during operation:
[0231] Connect a screen clicker in parallel with a light-emitting diode and then in series with a switch and a power supply. Place the screen to be tested within the operating range of the screen clicker and place a preset pattern consisting of two colors within a preset range around the light-emitting diode.
[0232] Acquiring a first image when the switch is closed and a second image when the switch is open, wherein both the first image and the second image include the light-emitting diode and the preset pattern, clustering the first image and obtaining a first cluster center, a second cluster center, and a third cluster center based on the preset pattern, and clustering the second image and obtaining a fourth cluster center based on the preset pattern;
[0233] Controlling the switch to be closed until the screen clicker completes clicking and the screen to be tested completes clicking response, controlling the switch to be opened, and acquiring a video from closing the switch to opening the switch, wherein the video includes the light-emitting diode, the preset pattern, and the screen to be tested;
[0234] For each frame image in the video, clustering the pixels of the frame image based on the first cluster center, the second cluster center, the third cluster center, and the fourth cluster center, determining the total number of pixels in the frame image, the number of third pixels clustered to the third cluster center, the number of light-emitting diode pixels of the light-emitting diode in the second image, and the number of preset pattern pixels of the preset pattern, so as to determine the light-emitting state of the light-emitting diode in the frame image;
[0235] Traverse each frame image in the video, determine the starting frame image and the starting time point of the click based on the lighting state of the light-emitting diode, traverse all frame images after the starting frame image, and determine the time point when the click response is completed based on the difference value between adjacent frame images, and use the time difference between the time point when the click response is completed and the starting time point of the click as the click response duration.
[0236] In one possible implementation, the instructions executed by the processor 1010 include: acquiring a first image when the switch is closed and a second image when the switch is open, wherein both the first image and the second image include the light-emitting diode and the preset pattern; clustering the first image and obtaining a first cluster center, a second cluster center, and a third cluster center based on the preset pattern; and clustering the second image and obtaining a fourth cluster center based on the preset pattern, including:
[0237] Converting the preset pattern into an HSV color space to obtain a first HSV color and a second HSV color;
[0238] Acquiring a first image when the switch is closed, converting the first image into an HSV color space to obtain a first HSV image, clustering HSV values of pixels in the first HSV image, using the cluster center closest to the first HSV color as the first cluster center, using the cluster center closest to the second HSV color as the second cluster center, and using the remaining cluster centers as the third cluster centers;
[0239] Obtain a second image when the switch is disconnected, convert the second image into an HSV color space to obtain a second HSV image, cluster the HSV values of the pixels of the second HSV image, and use the cluster center farthest from the first cluster center and the second cluster center as the fourth cluster center.
[0240] In one possible implementation, in the instructions executed by the processor 1010, after obtaining a video from closing the switch to opening the switch, wherein the video includes the light-emitting diode, the preset pattern, and the screen to be tested, the method further includes:
[0241] For each frame image in the video, performing image template matching on the frame image based on a preset image template to obtain a matching image;
[0242] The image template is obtained based on the light-emitting diode, the preset pattern and the screen to be tested.
[0243] In a possible implementation, in the instructions executed by the processor 1010, the size of the frame image is larger than the image template.
[0244] The performing image template matching on the frame image based on the preset image template to obtain the matching image includes:
[0245] Sliding the image template on the frame image;
[0246] The portion of the frame image covered by the image template is used as a sub-image;
[0247] Determining the similarity between the image template and each sub-image;
[0248] The sub-image with the highest similarity is used as the matching image.
[0249] In one possible implementation, the instructions executed by the processor 1010 include clustering, for each frame image in the video, pixels of the frame image based on the first cluster center, the second cluster center, the third cluster center, and the fourth cluster center, determining the total number of pixels in the frame image, the number of third pixels clustered to the third cluster center, the number of LED pixels of the LED in the second image, and the number of preset pattern pixels of the preset pattern, to determine the light-emitting state of the LED in the frame image, including:
[0250] For each frame image in the video, convert the frame image into the HSV color space to obtain an HSV frame image;
[0251] Clustering the pixels of the HSV frame image based on the first cluster center, the second cluster center, the third cluster center, and the fourth cluster center;
[0252] Determine the total number of pixels of the HSV frame image, the number of third pixels clustered to the third cluster center, the number of LED pixels of the LED in the second image, and the number of preset pattern pixels of the preset pattern to determine the light-emitting state of the LED in the frame image.
[0253] In one possible implementation, in the instructions executed by the processor 1010, determining the total number of pixels in the HSV frame image, the number of third pixels clustered to the third cluster center, the number of LED pixels of the LED in the second image, and the number of preset pattern pixels of the preset pattern, to determine the light-emitting state of the LED in the frame image, includes:
[0254] determining a first ratio of the third number of pixels to the total number of pixels;
[0255] determining a second ratio of the number of light-emitting diode pixels of the light-emitting diode to the number of preset pattern pixels of the preset pattern in the second image;
[0256] In response to determining that the first ratio is greater than or equal to the product of the second ratio and a preset threshold parameter, determining that the light emitting diode in the current frame image is in a light emitting state,
[0257] or,
[0258] In response to determining that the first ratio is less than the product of the second ratio and a preset threshold parameter, it is determined that the light emitting diode in the current frame image is in a non-lighting state.
[0259] In one possible implementation, the instructions executed by the processor 1010, wherein traversing each frame image in the video and determining a starting frame image and a start time point of a click based on a lighting state of the light-emitting diode, include:
[0260] Traversing each frame image in the video;
[0261] In response to determining that the light emitting diode in the current frame image is in a non-light emitting state and the light emitting diode in the frame image before the current frame image is in a light emitting state, determining the current frame image as the starting frame image;
[0262] The time point corresponding to the current frame image is determined as the starting time point of the click.
[0263] In one possible implementation, in the instructions executed by the processor 1010, traversing all frame images after the starting frame image and determining the time point when the click response is completed based on the difference value between adjacent frame images includes:
[0264] Traversing all frame images after the starting frame image;
[0265] Calculate the difference between adjacent frame images;
[0266] The difference values are arranged in descending order, and the time point at which the click response is completed is determined based on the time points corresponding to the adjacent frame images corresponding to the difference values of the preset names in the front order.
[0267] In a possible implementation, in the instruction executed by the processor 1010, the preset pattern includes:
[0268] White background with black geometric figures.
[0269] In one possible implementation, the instructions executed by the processor 1010, wherein placing a preset pattern including two colors within a preset range around the light-emitting diode, includes:
[0270] hollowing out a designated portion of the geometric figure to obtain a hollowed-out portion;
[0271] The light emitting diode is placed in the hollow portion.
[0272] In one possible implementation, the instructions executed by the processor 1010, wherein connecting a screen clicker in parallel with a light-emitting diode and then in series with a switch and a power supply, and placing the screen to be tested within an operating range of the screen clicker, include:
[0273] In response to determining that the screen type of the screen to be tested is a capacitive screen, determining that the clicker type of the screen clicker is a capacitive screen clicker;
[0274] or,
[0275] In response to determining that the screen type of the screen to be tested is a resistive screen, the clicker type of the screen clicker is determined to be a resistive screen clicker.
[0276] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present disclosure also provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the click response duration testing method described in any of the above embodiments.
[0277] The computer-readable media of this embodiment include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0278] The above-mentioned non-transitory computer-readable storage medium can be any available medium or data storage device that can be accessed by a computer, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO)), optical storage (such as CDs, DVDs, BDs, HVDs, etc.), and semiconductor storage (such as ROMs, EPROMs, EEPROMs, non-volatile memories (NAND FLASH), solid-state drives (SSDs)), etc.
[0279] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the test method for click response duration as described in any embodiment in the above exemplary method part, and have the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0280] Based on the same inventive concept, corresponding to the click response duration testing method described in any of the above embodiments, the present disclosure further provides a computer program product comprising computer program instructions. In some embodiments, the computer program instructions can be executed by one or more processors of a computer to cause the computer and / or the processor to perform the click response duration testing method. For the execution entities corresponding to the steps in each embodiment of the click response duration testing method, the processors that execute the corresponding steps can belong to the corresponding execution entities.
[0281] The computer program product of the above embodiment is used to enable the computer and / or the processor to execute the test method of click response duration as described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0282] Those skilled in the art will appreciate that embodiments of the present disclosure may be implemented as a system, method, or computer program product. Therefore, the present disclosure may be implemented in the following forms: entirely in hardware, entirely in software (including firmware, resident software, microcode, etc.), or in a combination of hardware and software, generally referred to herein as a "circuit," "module," or "system." Furthermore, in some embodiments, the present disclosure may also be implemented in the form of a computer program product in one or more computer-readable media containing computer-readable program code.
[0283] Any combination of one or more computer-readable media can be used. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples (non-exhaustive examples) of computer-readable storage media can include, for example: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.
[0284] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0285] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0286] Computer program code for performing the operations of the present disclosure may 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 may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone 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 may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0287] It should be understood that each block in the flowchart and / or block diagram, and combinations of blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine. These computer program instructions are executed by the computer or other programmable data processing device to produce a device that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.
[0288] These computer program instructions can also be stored in a computer-readable medium that enables a computer or other programmable data processing device to operate in a specific manner. In this way, the instructions stored in the computer-readable medium produce a product that includes an instruction device that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.
[0289] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, such that the instructions executed on the computer or other programmable apparatus provide a process that implements the functions / operations specified in the blocks in the flowchart and / or block diagram.
[0290] Furthermore, although the operations of the disclosed method are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in that particular order, or that all of the operations shown must be performed to achieve the desired results. Rather, the steps depicted in the flowcharts may be performed in a different order. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into a single step, and / or a single step may be broken down into multiple steps.
[0291] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from 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 or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0292] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiment of the application, the features and functions of two or more modules or units described above can be concretized in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0293] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. Within the scope of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0294] In addition, for simplicity of description and discussion, and in order not to make the embodiment of the application difficult to understand, the known power supply / ground connection with integrated circuit (IC) chip and other components may or may not be shown in the accompanying drawings provided. In addition, the device can be shown in the form of a block diagram to avoid making the embodiment of the application difficult to understand, and this also takes into account the following fact, that is, the details of the embodiment of these block diagram devices are highly dependent on the platform to be implemented in the embodiment of the application (that is, these details should be fully within the scope of understanding of those skilled in the art). When specific details (for example, circuit) are set forth to describe exemplary embodiments of the application, it will be apparent to those skilled in the art that the embodiment of the application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.
[0295] Although the present invention has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those skilled in the art based on the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may utilize the embodiments discussed.
[0296] The embodiments of the present application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of this application.
[0297] Although the spirit and principles of the present disclosure have been described with reference to several specific embodiments, it should be understood that the present disclosure is not limited to the specific embodiments disclosed, and the division into various aspects does not mean that the features of these aspects cannot be combined to benefit. Such division is merely for the convenience of expression. The present disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims. The scope of the appended claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.
Claims
1. A method for testing click response time, characterized in that: include: Connect a screen clicker in parallel with a light-emitting diode and then in series with a switch and a power supply. Place the screen to be tested within the operating range of the screen clicker and place a preset pattern consisting of two colors within a preset range around the light-emitting diode. Acquiring a first image when the switch is closed and a second image when the switch is open, wherein both the first image and the second image include the light-emitting diode and the preset pattern, clustering the first image and obtaining a first cluster center, a second cluster center, and a third cluster center based on the preset pattern, and clustering the second image and obtaining a fourth cluster center based on the preset pattern; Controlling the switch to be closed until the screen clicker completes clicking and the screen to be tested completes clicking response, controlling the switch to be opened, and acquiring a video from closing the switch to opening the switch, wherein the video includes the light-emitting diode, the preset pattern, and the screen to be tested; For each frame image in the video, clustering the pixels of the frame image based on the first cluster center, the second cluster center, the third cluster center, and the fourth cluster center, determining the total number of pixels in the frame image, the number of third pixels clustered to the third cluster center, the number of light-emitting diode pixels of the light-emitting diode in the second image, and the number of preset pattern pixels of the preset pattern, so as to determine the light-emitting state of the light-emitting diode in the frame image; Traverse each frame image in the video, determine the starting frame image and the starting time point of the click based on the lighting state of the light-emitting diode, traverse all frame images after the starting frame image, and determine the time point when the click response is completed based on the difference value between adjacent frame images, and use the time difference between the time point when the click response is completed and the starting time point of the click as the click response duration.
2. The method according to claim 1, characterized in that The acquiring of a first image when the switch is closed and a second image when the switch is open, wherein both the first image and the second image include the light-emitting diode and the preset pattern, clustering the first image and obtaining a first cluster center, a second cluster center, and a third cluster center based on the preset pattern, and clustering the second image and obtaining a fourth cluster center based on the preset pattern, includes: Converting the preset pattern into an HSV color space to obtain a first HSV color and a second HSV color; Acquiring a first image when the switch is closed, converting the first image into an HSV color space to obtain a first HSV image, clustering HSV values of pixels in the first HSV image, using the cluster center closest to the first HSV color as the first cluster center, using the cluster center closest to the second HSV color as the second cluster center, and using the remaining cluster centers as the third cluster centers; Obtain a second image when the switch is disconnected, convert the second image into an HSV color space to obtain a second HSV image, cluster the HSV values of the pixels of the second HSV image, and use the cluster center farthest from the first cluster center and the second cluster center as the fourth cluster center.
3. The method according to claim 1, characterized in that After obtaining a video from closing the switch to opening the switch, wherein the video includes the light-emitting diode, the preset pattern, and the screen to be tested, the method further includes: For each frame image in the video, performing image template matching on the frame image based on a preset image template to obtain a matching image; The image template is obtained based on the light-emitting diode, the preset pattern and the screen to be tested.
4. The method according to claim 3, characterized in that The size of the frame image is larger than the image template, The performing image template matching on the frame image based on the preset image template to obtain the matching image includes: Sliding the image template on the frame image; The portion of the frame image covered by the image template is used as a sub-image; Determining the similarity between the image template and each sub-image; The sub-image with the highest similarity is used as the matching image.
5. The method according to claim 1, wherein For each frame image in the video, clustering the pixels of the frame image based on the first cluster center, the second cluster center, the third cluster center, and the fourth cluster center, determining the total number of pixels in the frame image, the number of third pixels clustered to the third cluster center, the number of light-emitting diode pixels of the light-emitting diode in the second image, and the number of preset pattern pixels of the preset pattern, so as to determine the light-emitting state of the light-emitting diode in the frame image, including: For each frame image in the video, convert the frame image into the HSV color space to obtain an HSV frame image; Clustering the pixels of the HSV frame image based on the first cluster center, the second cluster center, the third cluster center, and the fourth cluster center; Determine the total number of pixels of the HSV frame image, the number of third pixels clustered to the third cluster center, the number of LED pixels of the LED in the second image, and the number of preset pattern pixels of the preset pattern to determine the light-emitting state of the LED in the frame image.
6. The method according to claim 5, characterized in that The determining of the total number of pixels of the HSV frame image, the number of third pixels clustered to the third cluster center, the number of LED pixels of the LED in the second image, and the number of preset pattern pixels of the preset pattern to determine the light emitting state of the LED in the frame image includes: determining a first ratio of the third number of pixels to the total number of pixels; determining a second ratio of the number of light-emitting diode pixels of the light-emitting diode to the number of preset pattern pixels of the preset pattern in the second image; In response to determining that the first ratio is greater than or equal to the product of the second ratio and a preset threshold parameter, determining that the light emitting diode in the current frame image is in a light emitting state, or, In response to determining that the first ratio is less than the product of the second ratio and a preset threshold parameter, it is determined that the light emitting diode in the current frame image is in a non-lighting state.
7. The method according to claim 1, characterized in that The traversing each frame image in the video and determining the starting frame image and the starting time point of the click based on the lighting state of the light-emitting diode includes: Traversing each frame image in the video; In response to determining that the light emitting diode in the current frame image is in a non-light emitting state and the light emitting diode in the frame image before the current frame image is in a light emitting state, determining the current frame image as the starting frame image; The time point corresponding to the current frame image is determined as the starting time point of the click.
8. The method according to claim 1, characterized in that The traversing all frame images after the starting frame image and determining the time point when the click response is completed based on the difference value between adjacent frame images includes: Traversing all frame images after the starting frame image; Calculate the difference between adjacent frame images; The difference values are arranged in descending order, and the time point at which the click response is completed is determined based on the time points corresponding to the adjacent frame images corresponding to the difference values of the preset names in the front order.
9. The method according to claim 1, characterized in that The preset patterns include: White background with black geometric figures.
10. The method according to claim 9, characterized in that Placing a preset pattern including two colors within a preset range around the light emitting diode includes: hollowing out a designated portion of the geometric figure to obtain a hollowed-out portion; The light emitting diode is placed in the hollow portion.
11. The method according to claim 1, wherein The method of connecting the screen clicker and the light emitting diode in parallel and then in series with the switch and the power supply, and placing the screen to be tested within the operating range of the screen clicker, comprises: In response to determining that the screen type of the screen to be tested is a capacitive screen, determining that the clicker type of the screen clicker is a capacitive screen clicker; or, In response to determining that the screen type of the screen to be tested is a resistive screen, the clicker type of the screen clicker is determined to be a resistive screen clicker.
12. A device for testing click response time, characterized in that: include: a test scenario construction module configured to connect a screen clicker in parallel with a light-emitting diode and then in series with a switch and a power supply, place a screen to be tested within an operating range of the screen clicker, and place a preset pattern including two colors within a preset range around the light-emitting diode; a cluster center determination module configured to obtain a first image when the switch is closed and a second image when the switch is open, wherein both the first image and the second image contain the light-emitting diode and the preset pattern, cluster the first image and obtain a first cluster center, a second cluster center, and a third cluster center based on the preset pattern, and cluster the second image and obtain a fourth cluster center based on the preset pattern; a test video acquisition module, configured to control the switch to be closed until the screen clicker completes the click and the screen to be tested completes the click response, control the switch to be opened, and acquire a video from the closing of the switch to the opening of the switch, wherein the video includes the light-emitting diode, the preset pattern, and the screen to be tested; a test video processing module configured to cluster pixels of each frame image in the video based on the first cluster center, the second cluster center, the third cluster center, and the fourth cluster center, determine the total number of pixels in the frame image, the number of third pixels clustered to the third cluster center, the number of LED pixels of the LED in the second image, and the number of preset pattern pixels of the preset pattern, so as to determine the light-emitting state of the LED in the frame image; The response duration determination module is configured to traverse each frame image in the video, determine the starting frame image and the starting time point of the click based on the lighting state of the light-emitting diode, traverse all frame images after the starting frame image, and determine the time point when the click response is completed based on the difference value between adjacent frame images, and use the time difference between the time point when the click response is completed and the starting time point of the click as the click response duration.
13. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 11 is implemented.
14. A non-transitory computer-readable storage medium, characterized in that The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 11.
15. A computer program product, characterized in that The method comprises computer program instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Mobile terminal, response performance testing method and device thereof and storage medium
CN109766250A
Touch screen click response time measuring method and system
CN112783707A