Key frame detection method and device, equipment and medium
By using an automated keyframe detection method, the similarity between an image frame and a reference image frame is calculated, and curve fitting and derivative analysis are performed. This solves the problem of low efficiency in traditional manual detection and achieves efficient keyframe detection.
Patent Information
- Application Number
- CN202310474190.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-26
- Publication Date
- 2024-11-01
AI Technical Summary
Traditional manual keyframe inspection methods are inefficient and result in high labor costs.
The system uses automated methods to identify reference image frames from image frames in a video, calculates the similarity between the image frames and the reference image frames, and automatically detects key image frames based on changes in similarity, including curve fitting and similarity derivative analysis.
It improves the efficiency of keyframe detection and saves labor costs.
Smart Images

Figure CN118887574A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to image processing technology, and in particular to a key frame detection method, device, equipment and medium. Background Art
[0002] A key frame refers to the frame of an image in which a key action occurs during the motion of a character or object in a video animation. Detecting key frames from a video allows for corresponding business processing of the video. For example, in a game scenario, by detecting key frames from a game video, key frames can be used to calculate the time consumption of the user interface response, thereby detecting the latency performance of the game, and improving the performance of the game based on the detection results, so that the released game has a faster response speed.
[0003] In traditional technology, key frames are usually detected from videos through manual detection. However, manual detection requires high manpower costs, resulting in low key frame detection efficiency. Summary of the invention
[0004] Based on this, it is necessary to provide a key frame detection method, device, equipment and medium that can improve the efficiency of key frame detection in response to the above technical problems.
[0005] In a first aspect, the present application provides a key frame detection method, the method comprising:
[0006] Acquire a video to be detected; the video is recorded when a trigger operation is performed on an interactive page of a preset application; when the interactive page is triggered, a screen change occurs;
[0007] Determining a reference image frame from each image frame of the video;
[0008] For each image frame in the video, determine the similarity between the image frame and the reference image frame to obtain the image similarity corresponding to the image frame;
[0009] Determine the change in similarity between groups of adjacent image frames in the video based on the image similarities respectively corresponding to the image frames in the video;
[0010] A key image frame is determined from each of the image frames of the video according to the change in similarity between each group of adjacent image frames; the key image frame has the largest similarity change value with a previous adjacent image frame of the key image frame.
[0011] In a second aspect, the present application provides a key frame detection device, the device comprising:
[0012] An acquisition module is used to acquire a video to be detected; the video is recorded when a trigger operation is performed on an interactive page of a preset application; when the interactive page is triggered, a screen change will occur;
[0013] A determination module, used to determine a reference image frame from each image frame of the video;
[0014] The determination module is also used to determine, for each image frame in the video, the similarity between the image frame and the reference image frame, and obtain the image similarity corresponding to the image frame; based on the image similarities corresponding to each of the image frames in the video, determine the change in similarity between each group of adjacent image frames in the video; determine a key image frame from each of the image frames in the video according to the change in similarity between the groups of adjacent image frames; the similarity change value between the key image frame and the previous adjacent image frame of the key image frame is the largest.
[0015] In one embodiment, the determination module is also used to perform curve fitting based on the image similarities corresponding to each of the image frames in the video to obtain a similarity change curve corresponding to the video; derive the similarity change curve to obtain a similarity derivative curve corresponding to the video; and use the image frame corresponding to the derivative peak value of the similarity derivative curve as the key image frame determined from each of the image frames in the video; wherein the derivative peak value is used to characterize that the similarity change value between the key image frame and the previous adjacent image frame of the key image frame is the largest.
[0016] In one embodiment, the key image frame includes a trigger key frame; the trigger key frame is a key frame entering the trigger stage; the determination module is also used to determine the trigger critical frame from each image frame of the video; the trigger critical frame is an image frame in the video that is before the trigger operation and is located at the trigger critical point; the image area in the trigger critical frame used to display the trigger position information is used as a reference image frame; wherein the trigger position information is used to indicate the position where the trigger operation acts in the interactive interface.
[0017] In one embodiment, the key image frame includes a start key frame; the response process for the trigger operation includes a response start stage; the start key frame is a key frame entering the response start stage; the determination module is also used to determine the trigger critical frame from each of the image frames of the video, and use the trigger critical frame as a reference image frame; wherein the trigger critical frame is an image frame in the video that is before the trigger operation and is located at the trigger critical.
[0018] In one embodiment, the key image frame includes an end key frame; the response process for the trigger operation includes a response end stage; the end key frame is a key frame entering the response end stage; the determination module is also used to determine the response end frame from each of the image frames of the video, and use the response end frame as a reference image frame; wherein, the response end frame is an image frame in the video after the response to the trigger operation ends.
[0019] In one embodiment, the video stops recording after responding to the end of the trigger operation; the response end frame includes the last image frame in the video; the determination module is also used to determine the last image frame from each image frame of the video, and use the last image frame as a reference image frame.
[0020] In one embodiment, the acquisition module is also used to acquire an initial video; the initial video is recorded when a trigger operation is performed on an interactive page of the application; for each image frame in the initial video, a frame difference value corresponding to the image frame is obtained based on a pixel difference value between the image frame and a previous adjacent image frame of the image frame; based on the frame difference values corresponding to each of the image frames in the initial video, at least part of the image frames are filtered out from each of the image frames of the initial video to obtain a video to be detected; wherein the frame difference value corresponding to the filtered image frame is greater than the frame difference value corresponding to the remaining image frames; the remaining image frames are image frames in the initial video other than the filtered image frames.
[0021] In one embodiment, the acquisition module is also used to acquire a frame difference array composed of frame difference values corresponding to each of the image frames in the initial video; slide a sliding window on the frame difference array, and splice the frame difference values covered by the sliding window at adjacent sliding positions on the frame difference array to obtain multiple frame difference splicing arrays; for each frame difference splicing array, according to the window length of the sliding window and the frame difference splicing array, filter at least part of the image frames from the image frames corresponding to the frame difference values in the frame difference splicing array to obtain the video to be detected.
[0022] In one embodiment, the acquisition module is also used to acquire an initial video; the initial video is recorded when a trigger operation is performed on an interactive page of the application running on the target device; the screen in the image frame of the initial video presents the target device; the coordinates corresponding to the key points of the screen contour of the target device are determined to obtain corrected coordinates; each image frame in the initial video is cropped and corrected according to the corrected coordinates to obtain a video to be detected; the video to be detected includes image frames after each image frame in the initial video is cropped and corrected.
[0023] In one embodiment, the initial video is recorded by a camera at a target shooting position for the application running on the target device; the acquisition module is also used to obtain a correction reference image frame; the correction reference image frame is obtained by shooting a reference picture presented on the screen of the target device by the camera at the target shooting position; the reference picture is different from the shooting background of the camera; the vertices of the picture area corresponding to the reference picture are used as the screen contour key points, and the coordinates corresponding to the vertices of the picture area in the correction reference image frame are used as the correction coordinates.
[0024] In one embodiment, the acquisition module is also used to acquire an initial video; the initial video is recorded when a trigger operation is performed on an interactive page of the application; a pixel histogram corresponding to each image frame in the initial video is determined; when it is determined based on the brightness distribution of pixel points in the pixel histogram that there is no exposure frame in the initial video, the initial video is used as the video to be detected.
[0025] In one embodiment, the determination module is also used to determine, for each image frame in the video, a correlation coefficient between the image frame and the reference image frame, and to determine a normalization coefficient between the image frame and the reference image frame; the correlation coefficient is used to characterize the degree of correlation between the image frame and the reference image frame; the normalization coefficient is used to map the correlation coefficient to a preset range; based on the ratio of the correlation coefficient to the normalization coefficient, the similarity between the image frame and the reference image frame is determined to obtain the image similarity corresponding to the image frame.
[0026] In a third aspect, the present application provides a computer device including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps in the method embodiments of the present application are implemented.
[0027] In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in the method embodiments of the present application.
[0028] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the steps in the method embodiments of the present application when the computer program is executed by a processor.
[0029] The above-mentioned key frame detection method, device, equipment, medium and computer program product obtain the video to be detected, which is recorded when the interactive page of the preset application is triggered. When the interactive page is triggered, the screen changes, and the reference image frame is determined from each image frame of the video. For each image frame in the video, the similarity between the image frame and the reference image frame is automatically determined to obtain the image similarity corresponding to the image frame, and based on the image similarity corresponding to each image frame in the video, the similarity change between each group of adjacent image frames in the video is automatically determined, and then the key image frame is automatically determined from each image frame of the video according to the similarity change between each group of adjacent image frames. The similarity change value between the key image frame and the previous adjacent image frame of the key image frame is the largest. Compared with the traditional method of manually detecting key frames, the present application detects key frame images from the video in an automated manner, which can save labor costs and improve the detection efficiency of key frames. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A diagram showing an application environment of a key frame detection method in an embodiment;
[0031] Figure 2 is a flowchart of a key frame detection method in one embodiment;
[0032] Figure 3 is a schematic diagram of a similarity change curve and a similarity derivative curve in one embodiment;
[0033] Figure 4 is a schematic diagram of triggering a critical frame in one embodiment;
[0034] Figure 5 is a schematic diagram of a similarity change curve and a similarity derivative curve when a triggering key frame is detected in one embodiment;
[0035] Figure 6 A schematic diagram of triggering a key frame in an embodiment;
[0036] Figure 7 is a schematic diagram of a similarity change curve and a similarity derivative curve when a start key frame is detected in one embodiment;
[0037] Figure 8 is a schematic diagram of starting a key frame in one embodiment;
[0038] Fig. 9 is a schematic diagram of a similarity change curve and a similarity derivative curve when detecting an end key frame in an embodiment;
[0039] Fig.10 is a schematic diagram of ending a key frame in one embodiment;
[0040] Fig.11 is a schematic diagram of image frames in an initial video before screening in one embodiment;
[0041] Fig.12 is a schematic diagram of each image frame in a video to be detected after screening in one embodiment;
[0042] Fig.13 A schematic diagram of a process of filtering image frames from an initial video in one embodiment;
[0043] Fig.14 A schematic diagram of a process of correcting an image in one embodiment;
[0044] Fig.15 is a schematic diagram of a pixel histogram corresponding to an exposure frame and a non-exposure frame in one embodiment;
[0045] Fig.16 Zhiyitong for exposure frames in one embodiment;
[0046] Fig.17 A schematic diagram of a video preprocessing process in one embodiment;
[0047] Fig.18 is a flowchart of a key frame detection method in another embodiment;
[0048] Fig.19 is a flowchart of a key frame detection method in another embodiment;
[0049] Fig. 20 is a structural block diagram of a key frame detection device in one embodiment;
[0050] Fig.21 is an internal structure diagram of a computer device in one embodiment;
[0051] Fig. 22 FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] The key frame detection method provided in this application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other servers. Among them, the terminal 102 can be, but is not limited to, various desktop computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, cloud security, host security and other network security services, CDN, and basic cloud computing services such as big data and artificial intelligence platforms. The terminal 102 and the server 104 can be directly or indirectly connected by wired or wireless communication, and this application is not limited here.
[0054] The server 104 can obtain a video to be detected; the video is recorded when a trigger operation is performed on an interactive page of a preset application; when the interactive page is triggered, a screen change will occur. The server 104 can determine a reference image frame from each image frame of the video, determine the similarity between the image frame and the reference image frame, obtain the image similarity corresponding to the image frame, and determine the similarity change between each group of adjacent image frames in the video based on the image similarity corresponding to each image frame in the video. Then, the server 104 can determine a key image frame from each image frame of the video according to the similarity change between each group of adjacent image frames; the similarity change value between the key image frame and the previous adjacent image frame of the key image frame is the largest.
[0055] It is understood that the server 104 may send the determined key image frame to the terminal 102, and the terminal 102 may display the key image frame. It is also understood that the server 104 may also store the determined key image frame. This embodiment does not limit this. It is understood that Figure 1 The application scenarios are only for illustration and are not limited to this.
[0056] In one embodiment, Figure 2 As shown, a key frame detection method is provided, which can be applied to a computer device, which can be a terminal or a server, and can be executed by the terminal or the server itself, or can be implemented through interaction between the terminal and the server. This embodiment takes the method applied to a computer device as an example to illustrate, and includes the following steps:
[0057] Step 202, obtaining a video to be detected; the video is recorded when a trigger operation is performed on an interactive page of a preset application; when the interactive page is triggered, a screen change will occur.
[0058] Among them, an application is a computer program used to complete a specific task, which has a visual interactive page. The interactive page is a page provided for users to interact with the application. When the interactive page is triggered, the screen presented by the application will change. It can be understood that each screen corresponds to an image frame, and the constantly changing screens constitute a video composed of multiple image frames.
[0059] Specifically, an application is running in the target device, and the user can trigger the interactive page of the application. It can be understood that when the interactive page of the application is triggered by the user, the screen will change. By recording the constantly changing screen, the video to be detected can be obtained, and then the computer device can obtain the video to be detected.
[0060] In one embodiment, the computer device may use the video obtained by recording the continuously changing pictures as the initial video. The computer device may obtain the initial video and filter out at least part of the image frames from each image frame of the initial video to obtain the video to be detected.
[0061] In one embodiment, the computer device may randomly select at least a portion of image frames from each image frame of the initial video to obtain the video to be detected.
[0062] In one embodiment, the target device is shown in the image frame of the initial video, and the computer device can determine the image area corresponding to the screen of the target device from each image frame of the initial video, and crop the image presented in the image area to obtain the video to be detected. It can be understood that the video to be detected includes image frames obtained by cropping each image frame in the initial video.
[0063] In one embodiment, the computer device may perform exposure detection on each image frame in the initial video. If it is detected that there is no exposure frame in the initial video, the initial video is used as the video to be detected. If it is detected that there is at least one exposure frame in the initial video, the computer device may discard the initial video. It is understood that after discarding the initial video, a new initial video can be re-recorded, and then the exposure frame detection can be continued on the new initial video.
[0064] In one embodiment, exposure detection may be performed on each image frame in the initial video frame by frame by manually detecting exposure frames.
[0065] In one embodiment, the computer device may directly use the video obtained by recording the continuously changing pictures as the video to be detected.
[0066] Step 204: determining a reference image frame from each image frame of the video.
[0067] The reference image frame is an image frame used as a reference in the process of detecting the key image frame. The key image frame is an image frame where the key action of the object in the video is located during the motion change process.
[0068] It can be understood that there is at least one key image frame to be detected in each image frame of the video, and the key image frame to be detected needs to be determined based on the corresponding reference image frame. It can be understood that different reference image frames will result in different key image frames finally detected.
[0069] In one embodiment, the recorded video may include at least three stages, namely, a trigger stage, a response start stage, and a response end stage. It is understood that for each stage, the computer device may obtain a reference image frame corresponding to the stage, and based on the reference image frame corresponding to the stage, detect the key image frame corresponding to the stage from each image frame of the video. Among them, the trigger stage is the stage between the start time of the trigger operation and the end time of the trigger operation. The response start stage is the start stage of the response trigger operation. The response end stage is the end stage of the response trigger operation.
[0070] Step 206 , for each image frame in the video, determine the similarity between the image frame and the reference image frame to obtain the image similarity corresponding to the image frame.
[0071] The image similarity is the similarity between the image frame in the video and the reference image frame. It can be understood that the image similarity can be used to characterize the similarity between the image frame in the video and the reference image frame.
[0072] Specifically, for each image frame in the video, the computer device may calculate the similarity between the image frame and a reference image frame, and use the calculated similarity between the image frame and the reference image frame as the image similarity corresponding to the image frame.
[0073] In one embodiment, for each image frame in the video, a correlation coefficient between the image frame and a reference image frame is determined, and the correlation coefficient can be used to characterize the degree of correlation between the image frame and the reference image frame. Furthermore, the computer device can determine the similarity between the image frame and the reference image frame based on the correlation coefficient between the image frame and the reference image frame to obtain the image similarity corresponding to the image frame.
[0074] In one embodiment, for each image frame in the video, the computer device may directly use the correlation coefficient between the image frame and the reference image frame as the similarity between the image frame and the reference image frame to obtain the image similarity corresponding to the image frame.
[0075] Step 208 : determining the change in similarity between each group of adjacent image frames in the video based on the image similarities corresponding to each image frame in the video.
[0076] Wherein, adjacent image frames refer to image frames with adjacent positions in the video, and each group of adjacent image frames includes a preceding image frame and a succeeding image frame. The preceding image frame is located before the succeeding image frame in the video.
[0077] For example, if the second image frame in a video is adjacent to the first image frame and the third image frame in the video, two groups of adjacent image frames are included. The first group of adjacent image frames is the first image frame and the second image frame in the video, and the second group of adjacent image frames is the second image frame and the third image frame in the video. It can be understood that the first image frame in the first group of adjacent image frames is the first image frame in the video, and the second image frame is the second image frame in the video. The first image frame in the second group of adjacent image frames is the second image frame in the video, and the second image frame is the third image frame in the video.
[0078] In one embodiment, the computer device may determine the similarity change value between each group of adjacent image frames based on the image similarities corresponding to each image frame in the video. It can be understood that the similarity change value can be used to characterize the similarity change between each group of adjacent image frames in the video. The similarity change value is the difference between the image similarities corresponding to two adjacent image frames.
[0079] Step 210 , determining a key image frame from each image frame of the video according to the change in similarity between each group of adjacent image frames; the key image frame has the largest similarity change value with the previous adjacent image frame of the key image frame.
[0080] The similarity change value is the difference between the image similarities corresponding to two adjacent image frames in the video.
[0081] In one embodiment, the computer device may determine the similarity change value between each group of adjacent image frames based on the image similarities corresponding to each image frame in the video, and determine the image frame with the largest similarity change value from each image frame in the video as the key image frame.
[0082] In the above-mentioned key frame detection method, by obtaining the video to be detected, the video is recorded when the trigger operation is performed on the interactive page of the preset application, and the screen changes when the interactive page is triggered. Determine the reference image frame from each image frame of the video, and for each image frame in the video, automatically determine the similarity between the image frame and the reference image frame, obtain the image similarity corresponding to the image frame, and based on the image similarity corresponding to each image frame in the video, automatically determine the similarity change between each group of adjacent image frames in the video, and then automatically determine the key image frame from each image frame of the video according to the similarity change between each group of adjacent image frames, and the similarity change value between the key image frame and the previous adjacent image frame of the key image frame is the largest. Compared with the traditional method of manually detecting key frames, the present application detects key frame images from the video in an automated manner, which can save labor costs and improve the detection efficiency of key frames.
[0083] In one embodiment, based on the image similarities corresponding to each image frame in the video, the change in similarity between each group of adjacent image frames in the video is determined, including: curve fitting based on the image similarities corresponding to each image frame in the video to obtain a similarity change curve corresponding to the video; key image frames are determined from each image frame in the video according to the similarity change between each group of adjacent image frames, including: derivatizing the similarity change curve to obtain a similarity derivative curve corresponding to the video; the image frame corresponding to the derivative peak value of the similarity derivative curve is used as the key image frame determined from each image frame of the video; wherein the derivative peak value is used to indicate that the similarity change value between the key image frame and the previous adjacent image frame of the key image frame is the largest.
[0084] The similarity change curve can be used to reflect the similarity change between each group of adjacent image frames in the video. The similarity derivative curve can be used to reflect the magnitude of the similarity change values corresponding to each group of adjacent image frames in the video. The derivative peak value is the peak value corresponding to the similarity derivative curve.
[0085] Specifically, the computer device may perform curve fitting based on the image similarities corresponding to each image frame in the video to obtain a similarity change curve corresponding to the video. It can be understood that the horizontal coordinate of the similarity change curve is the frame number corresponding to each image frame in the video, and the frame number can be used to uniquely identify the image frame. The vertical coordinate of the similarity change curve is the image similarity corresponding to each image frame in the video. The computer device may derive the similarity change curve to obtain a similarity derivative curve corresponding to the video, and use the image frame represented by the frame number corresponding to the derivative peak of the similarity derivative curve as the key image frame determined from each image frame of the video.
[0086] In one embodiment, Figure 3As shown, 301 is a similarity change curve, and 302 is a similarity derivative curve obtained by deriving the similarity change curve 301. Figure 3 It can be seen that the frame number corresponding to the derivative peak of the similarity derivative curve is the 58th image frame in the video, and the 58th image frame in the video is the key image frame determined from the image frames of the video. It can be understood that the picture content of the 57th image frame in the video is quite different from the picture content of the 58th image frame in the video, and the picture of the image frame in the video suddenly changes from the picture of the 57th image frame to the picture of the 58th image frame.
[0087] In one embodiment, a step of performing curve fitting based on image similarities corresponding to each image frame in a video to obtain a similarity change curve corresponding to the video includes: taking the frame number corresponding to each image frame in the video as the horizontal coordinate, and taking the image similarity corresponding to each image frame in the video as the vertical coordinate to obtain a discrete point set corresponding to the video; each discrete point in the discrete point set is used to represent each image frame in the video; and each discrete point in the discrete point set is curve fitted to obtain a similarity change curve corresponding to the video.
[0088] In one embodiment, the step of performing curve fitting on each discrete point in the discrete point set to obtain a similarity change curve corresponding to the video includes: assigning values to parameters of an interpolation function through a frame number array and a similarity array, and determining the interpolation parameters through the interpolation function after the assignment; the frame number array is composed of frame numbers of image frames corresponding to each discrete point in the discrete point set; the similarity array is composed of image similarities corresponding to each discrete point in the discrete point set; assigning values to parameters of a fitting function through a frame number array and an interpolation parameter, and obtaining the similarity change curve corresponding to the video by drawing the fitting function after the assignment.
[0089] In one embodiment, the discrete point set corresponding to the video can be obtained by:
[0090] y = sim_arr;
[0091] x=np.arange(0,len(y)).
[0092] Among them, x is the frame number of the image frame, that is, the horizontal coordinate, and y is the image similarity corresponding to the image frame, that is, the vertical coordinate. sim_arr represents the similarity array, np.arange() is the frame number array generation function, and np.arange(0, len(y)) represents the frame number array. It can be understood that (x, y) can be used to represent each discrete point in a discrete point set.
[0093] In one embodiment, the similarity change curve corresponding to the video can be obtained by drawing the following method:
[0094] tck=scipy.interpolate.splrep(x,y,s=0);
[0095] xnew=np.arange(0,len(y));
[0096] ynew=scipy.interpolate.splev(xnew,tck,der=0).
[0097] Among them, scipy.interpolate.splrep() represents the interpolation function, scipy.interpolate.splrep(x, y, s = 0) represents the interpolation function after assignment, tck represents the interpolation parameter, scipy.interpolate.splev() is the fitting function, scipy.interpolate.splev(xnew, tck, der = 0) is the fitting function after assignment, and ynew is the similarity change curve corresponding to the video. It can be understood that xnew also represents the frame number of the image frame, s is one of the parameters of the interpolation function, and in the case of obtaining the interpolation parameter, s = 0. der is one of the parameters of the fitting function, and in the case of obtaining the similarity change curve, der = 0.
[0098] In one embodiment, the similarity derivative curve corresponding to the video can be drawn in the following way:
[0099] ynew_deriv=scipy.interpolate.splev(xnew,tck,der=1).
[0100] Wherein, der is one of the parameters of the fitting function, and in the case of obtaining the similarity derivative curve, der = 1. ynew_deriv represents the similarity derivative curve corresponding to the video. It can be understood that the similarity derivative curve ynew_deriv is the curve obtained by deriving the similarity change curve ynew.
[0101] In the above embodiment, the image similarities corresponding to each image frame in the video are fitted into a similarity change curve, and the image frame pointed to by the derivative peak of the similarity derivative curve corresponding to the similarity change curve is determined. Since the derivative peak can represent that the similarity change value between the key image frame and the previous adjacent image frame of the key image frame is the largest, that is, the picture content of the image frame corresponding to the derivative peak has a sudden change in picture content compared with the picture content of the previous adjacent image frame of the image frame corresponding to the derivative peak in the video. It can be understood that the degree of change of the picture content of other image frames in the video except the image frame corresponding to the derivative peak is not as large as the degree of change of the picture content of the image frame corresponding to the derivative peak in the video. Therefore, by automatically taking the image frame pointed to by the derivative peak as the key image frame, the accuracy of detecting the key image frame from the video can be improved. At the same time, by directly taking the image frame corresponding to the derivative peak of the similarity derivative curve corresponding to the video as the key image frame detected from each image frame of the video, the detection efficiency of the key image frame can be further improved.
[0102] In one embodiment, the key image frame includes a trigger key frame; the trigger key frame is a key frame entering the trigger stage; determining the reference image frame from each image frame of the video, including: determining the trigger critical frame from each image frame of the video; the trigger critical frame is an image frame in the video before the trigger operation and located at the trigger critical point; using the image area in the trigger critical frame for displaying the trigger position information as a reference image frame; wherein the trigger position information is used to indicate the position where the trigger operation acts in the interactive interface.
[0103] Among them, the trigger stage is the stage between the start time of the trigger operation and the end time of the trigger operation. The image frame at the trigger critical point refers to the image frame before the image frame on which the trigger operation acts, that is, an image frame after the trigger critical frame will be triggered by the trigger operation. For example, if the application includes a game application, the interactive interface includes a game interactive interface, and when the game player performs a trigger operation on the game interactive interface, a video will be recorded for the trigger response process. If the image frame when the trigger operation triggers the game interactive interface is the second frame, then the first frame in the video is the trigger critical frame.
[0104] Specifically, the computer device can determine the trigger critical frame from each image frame of the video to be detected, and use the image area in the trigger critical frame for displaying the trigger position information as a reference image frame. For each image frame in the video, the computer device can determine the similarity between the image frame and the reference image frame to obtain the image similarity corresponding to the image frame. Furthermore, the computer device can determine the change in similarity between each group of adjacent image frames in the video based on the image similarity corresponding to each image frame in the video, and determine the trigger key frame from each image frame of the video according to the change in similarity between each group of adjacent image frames, wherein the change value of the similarity between the trigger key frame and the previous adjacent image frame of the trigger key frame is the largest.
[0105] In one embodiment, the video is a game video, the application is a game application, and the interactive page is a game interactive page. Figure 4 The trigger critical frame presented by the game application is shown. It can be understood that the game player can trigger the "start game" control presented in the game interaction page, and the trigger critical frame is the image frame in the game video before the user triggers the "start game" control and is located at the trigger critical.
[0106] In one embodiment, Figure 5 As shown, 501 is a similarity change curve, and 502 is a similarity derivative curve obtained by deriving the similarity change curve 501. Figure 5 It can be seen that the frame number corresponding to the derivative peak of the similarity derivative curve is the 38th image frame in the game video, and the 38th image frame in the game video is the trigger key frame determined from the image frames of the game video. It can be understood that the picture content of the 37th image frame in the game video is quite different from the picture content of the 38th image frame in the game video, and the picture of the image frame in the game video suddenly changes from the picture of the 37th image frame to the picture of the 38th image frame.
[0107] In one embodiment, Figure 6 The trigger key frame determined from each image frame of the game video is shown. It can be seen that the trigger key frame only has the image area used to display the trigger position information changed compared to the trigger critical frame, that is, the trigger position information displayed in the trigger critical frame is "abscissa: 0.0, ordinate: 0.0". The trigger position information displayed in the trigger key frame is "abscissa: 187.0, ordinate: 199.0".
[0108] In the above embodiment, since the trigger critical frame is an image frame in the video that is before the trigger operation and is located at the trigger critical point, the trigger critical frame can be detected from each image frame of the video by using the image area in the trigger critical frame that is used to display the trigger position information as a reference image frame, thereby improving the detection accuracy of the trigger key frame.
[0109] In one embodiment, the key image frame includes a start key frame; the response process for the trigger operation includes a response start stage; the start key frame is a key frame entering the response start stage; determining the reference image frame from each image frame of the video, including: determining the trigger critical frame from each image frame of the video, and using the trigger critical frame as a reference image frame; wherein the trigger critical frame is an image frame in the video that is before the trigger operation and is located at the trigger critical.
[0110] Specifically, the computer device can determine the trigger critical frame from each image frame of the video to be detected, and use the trigger critical frame as a reference image frame. For each image frame in the video, the computer device can determine the similarity between the image frame and the reference image frame to obtain the image similarity corresponding to the image frame. Furthermore, the computer device can determine the change in similarity between each group of adjacent image frames in the video based on the image similarity corresponding to each image frame in the video, and determine the start key frame from each image frame of the video according to the change in similarity between each group of adjacent image frames, wherein the change in similarity between the start key frame and the previous adjacent image frame of the start key frame is the largest.
[0111] In one embodiment, Figure 7 As shown, 701 is a similarity change curve, and 702 is a similarity derivative curve obtained by deriving the similarity change curve 701. Figure 7 It can be seen that the frame number corresponding to the derivative peak of the similarity derivative curve is the 63rd image frame in the game video, and the 63rd image frame in the game video is the starting key frame determined from each image frame in the game video. It can be understood that the picture content of the 62nd image frame in the game video is quite different from the picture content of the 63rd image frame in the game video, and the picture of the image frame in the game video suddenly changes from the picture of the 62nd image frame to the picture of the 63rd image frame.
[0112] In one embodiment, Figure 8 The figure shows the start key frame determined from each image frame of the game video. It can be seen that the start key frame has undergone a significant change in content compared to the trigger key frame image.
[0113] In the above embodiment, since the trigger critical frame is an image frame in the video that is before the trigger operation and is located at the trigger critical point, the start key frame can be detected from each image frame of the video by using the trigger critical frame as a reference image frame, thereby improving the detection accuracy of the start key frame.
[0114] In one embodiment, the key image frame includes an end key frame; the response process for the trigger operation includes a response end stage; the end key frame is a key frame entering the response end stage; determining the reference image frame from each image frame of the video includes: determining the response end frame from each image frame of the video, and using the response end frame as a reference image frame; wherein the response end frame is an image frame in the video after the response trigger operation ends.
[0115] Specifically, the computer device may determine the response end frame from each image frame of the video to be detected, and use the response end frame as a reference image frame. For each image frame in the video, the computer device may determine the similarity between the image frame and the reference image frame, and obtain the image similarity corresponding to the image frame. Furthermore, the computer device may determine the change in similarity between each group of adjacent image frames in the video based on the image similarity corresponding to each image frame in the video, and determine the end key frame from each image frame of the video according to the change in similarity between each group of adjacent image frames, wherein the change value of the similarity between the end key frame and the previous adjacent image frame of the end key frame is the largest.
[0116] In one embodiment, Fig. 9 As shown, 901 is a similarity change curve, and 902 is a similarity derivative curve obtained by deriving the similarity change curve 901. Fig. 9 It can be seen that the frame number corresponding to the derivative peak of the similarity derivative curve is the 79th image frame in the game video, and the 79th image frame in the game video is the end key frame determined from each image frame in the game video. It can be understood that the picture content of the 78th image frame in the game video is quite different from the picture content of the 79th image frame in the game video, and the picture of the image frame in the game video suddenly changes from the picture of the 78th image frame to the picture of the 79th image frame.
[0117] In one embodiment, Fig.10 The figure shows the ending key frame determined from each image frame of the game video. It can be seen that the content of the ending key frame has also changed significantly compared to the starting key frame.
[0118] In the above embodiment, since the response end frame is an image frame in the video after the response trigger operation is completed, by using the response end frame as a reference image frame, the end key frame can be detected from each image frame of the video, thereby improving the detection accuracy of the end key frame.
[0119] In one embodiment, the video stops recording after the response trigger operation ends; the response end frame includes the last image frame in the video; the response end frame is determined from each image frame of the video, and the response end frame is used as a reference image frame, including: determining the last image frame from each image frame of the video, and using the last image frame as a reference image frame.
[0120] Specifically, the video is recorded before the trigger operation is started on the interactive page of the application, and the recording is stopped after the response trigger operation is completed. Therefore, the response end frame includes the last image frame in the video. The computer device can determine the last image frame from each image frame of the video to be detected, and directly use the last image frame of the video as a reference image frame. It can be understood that after obtaining the reference image frame, the end key frame can be determined from each image frame of the video based on the reference image frame.
[0121] In the above embodiment, since the video stops recording after the response trigger operation ends, the response end frame can be the last image frame in the video. By using the last image frame in the video as a reference image frame, the end key frame can be detected from each image frame of the video, thereby improving the detection accuracy of the end key frame.
[0122] In one embodiment, obtaining a video to be detected includes: obtaining an initial video; the initial video is recorded when a trigger operation is performed on an interactive page of an application; for each image frame in the initial video, obtaining a frame difference value corresponding to the image frame based on a pixel difference value between the image frame and a previous adjacent image frame of the image frame; based on the frame difference values corresponding to each image frame in the initial video, filtering at least part of the image frames from each image frame of the initial video to obtain the video to be detected; wherein the frame difference value corresponding to the filtered image frame is greater than the frame difference value corresponding to the remaining image frames; the remaining image frames are image frames in the initial video other than the filtered image frames.
[0123] Among them, the pixel difference between the image frame and the previous adjacent image frame of the image frame includes the pixel value corresponding to each pixel point in the image frame and the pixel difference between the pixel value corresponding to each pixel point in the previous adjacent image frame of the image frame. It can be understood that the pixel difference between the image frame and the previous adjacent image frame of the image frame is a pixel difference matrix. The frame difference corresponding to the image frame is the pixel difference matrix between the image frame and the previous adjacent image frame of the image frame.
[0124] Specifically, the computer device can obtain an initial video, which is recorded when a trigger operation is performed on an interactive page of a preset application. For each image frame in the initial video, the computer device can obtain a pixel difference matrix based on the pixel value corresponding to each pixel point in the image frame and the pixel difference between the pixel value corresponding to each pixel point in the previous adjacent image frame of the image frame, and use the pixel difference matrix as the frame difference corresponding to the image frame. The computer device can filter at least part of the image frames from each image frame of the initial video based on the size of the frame difference corresponding to each image frame in the initial video to obtain the video to be detected. It can be understood that the frame difference corresponding to the filtered image frame is greater than the frame difference corresponding to the remaining image frames, and the remaining image frames are the image frames in the initial video except the filtered image frames.
[0125] In one embodiment, the computer device can compare the frame differences corresponding to each image frame in the initial video in pairs, and use the image frames corresponding to the frame differences with a preset number of frame differences larger than the compared frame differences as the image frames screened from the image frames of the initial video to obtain the video to be detected.
[0126] In one embodiment, Fig.11 As shown, the initial image includes 72 image frames, namely, the 1st image frame 0.jpg to the 72nd image frame 71.jpg. Among them, the picture content corresponding to the 1st image frame 0.jpg to the 36th image frame 35.jpg has only very slight changes, and the overall picture is relatively repetitive. The picture content corresponding to the 37th image frame 36.jpg to the 48th image frame 47.jpg has only very slight changes, and the overall picture is relatively repetitive. The picture content corresponding to the 49th image frame 48.jpg to the 72nd image frame 71.jpg has only very slight changes, and the overall picture is relatively repetitive. To avoid excessive redundancy of the picture, the computer device can filter at least some of the image frames (such as 48.jpg) from each image frame of the initial video based on the frame difference corresponding to each image frame in the initial video. Fig.12 The 12 image frames shown in FIG. 1 are used to obtain the video to be detected.
[0127] In the above embodiment, the initial video has image frames with a large number of repeated screen contents. By screening at least some image frames from each image frame of the initial video based on the frame differences corresponding to each image frame in the initial video, a video to be detected is obtained. The redundancy of image frames in the video to be detected can be eliminated, thereby improving the detection efficiency of subsequent key image frames.
[0128] In one embodiment, based on frame difference values corresponding to each image frame in an initial video, at least part of the image frames are screened from each image frame of the initial video to obtain a video to be detected, including: obtaining a frame difference array composed of frame difference values corresponding to each image frame in the initial video; sliding a sliding window on the frame difference array, splicing the frame difference values covered by the sliding window at adjacent sliding positions on the frame difference array to obtain a plurality of frame difference splicing arrays; for each frame difference splicing array, according to the window length of the sliding window and the frame difference splicing array, screening at least part of the image frames from the image frames corresponding to the frame difference values in the frame difference splicing array to obtain the video to be detected.
[0129] Among them, the frame difference array includes the frame difference values corresponding to each image frame in the initial video. It can be understood that the frame difference values corresponding to each image frame in the initial video are elements in the frame difference array. The adjacent sliding position includes the first sliding position and the second sliding position. The first sliding position is the position where the sliding window first slides on the frame difference array, and the second sliding position is the position where the sliding window slides on the frame difference array later. The coverage area of the sliding window at the first sliding position is adjacent to the coverage area of the sliding window at the second sliding position. The window length is used to characterize the number of frame difference values covered when the sliding window does not slide.
[0130] Specifically, the computer device can obtain a frame difference array composed of frame difference values corresponding to each image frame in the initial video. The computer device can obtain a sliding window, and slide the sliding window on the frame difference array, and splice the frame difference values covered by the sliding window at at least two adjacent sliding positions on the frame difference array to obtain multiple frame difference splicing arrays. It can be understood that the frame difference splicing array includes the frame difference values covered by the sliding window at adjacent sliding positions on the frame difference array, and the number of frame difference values included in the frame difference splicing array is greater than the number of frame difference values covered when the sliding window does not slide. For each frame difference splicing array, the computer device can filter at least part of the image frames corresponding to the frame difference values in the frame difference splicing array according to the window length of the sliding window and the frame difference splicing array to obtain the video to be detected.
[0131] In one embodiment, for each frame difference stitching array, the computer device can assign values to the parameters in the key frame detection function through the window length of the sliding window and the frame difference stitching array, and through the assigned key frame detection function, filter at least part of the image frames from the image frames corresponding to the frame difference values in the frame difference stitching array to obtain the video to be detected.
[0132] In one embodiment, the computer device may splice the frame difference values covered by the sliding window at three adjacent sliding positions on the frame difference array to obtain multiple frame difference splicing arrays. Specifically, the adjacent sliding positions include a previous sliding position, a current sliding position, and a subsequent sliding position. The computer device may splice the frame difference values respectively covered by the sliding window at the previous sliding position, the current sliding position, and the subsequent sliding position on the frame difference array to obtain a frame difference splicing array.
[0133] In one embodiment, the video to be detected can be determined by:
[0134] window_len = fps ÷ 2;
[0135] hash = 'hanning';
[0136] s=np.r_[2*x[0]-x[window_len:1:1-], X, 2*x[-1]-x[-1:window_len:-1]];
[0137] w=getattr(np,hash)(window_len);
[0138] y=np.convolve(w / (w.sum), s, mode='same');
[0139] y[window_len-1:window_len+1].
[0140] It can be understood that fps is the frame rate of the initial video, and window_len is the window length of the sliding window. hash = 'hanning' means that key frame detection is performed by the Hamming method. 2*x[0]-x[window_len:1:1-] represents the array of frame differences covered by the sliding window at the previous sliding position, X represents the array of frame differences covered by the sliding window at the current sliding position, and 2*x[-1]-x[-1:window_len:-1] represents the array of frame differences covered by the sliding window at the subsequent sliding position. s represents the frame difference splicing array. getattr() represents the dynamic attribute value acquisition function, and w represents the attribute parameter obtained. w / (w.sum) represents the array to be processed currently. It can be understood that the array to be processed currently includes at least one frame difference, and mode = 'same' represents the array length of the output array y[window_len-1:window_len+1], which is consistent with the array length of the array to be processed currently. It can be understood that the output y[window_len-1:window_len+1] can be used to represent the image frames filtered out from the initial video.
[0141] In one embodiment, Fig.13 As shown, the computer device can obtain a frame difference array (i.e., [d0, d1, d2, d3, d4, d5]) composed of frame difference values corresponding to each image frame in the initial video (i.e., f0, f1, f2, f3, f4, f5). The computer device can obtain a sliding window, and slide the sliding window on the frame difference array, and splice the frame difference values covered by the sliding window at at least two adjacent sliding positions on the frame difference array to obtain multiple frame difference splicing arrays. For each frame difference splicing array, the computer device can filter at least part of the image frames corresponding to the frame difference values in the frame difference splicing array to obtain the video to be detected. It can be understood that the video to be detected includes image frames (i.e., f0, f2, f4) filtered from image frames corresponding to the frame difference values in each frame difference splicing array.
[0142] In the above embodiment, since the number of frame difference values in the frame difference stitching array is greater than the number of frame difference values covered by the sliding window, by filtering at least part of the image frames corresponding to the frame difference values in each frame difference stitching array to obtain the video to be detected, the redundancy of the image frames in the video to be detected can be further reduced, thereby further improving the detection efficiency of subsequent key image frames.
[0143] In one embodiment, the computer device may slide a sliding window on the frame difference array, and combine the frame difference values covered by the sliding window on the frame difference array to obtain a frame difference subarray. It can be understood that the number of frame difference values included in the frame difference subarray is equal to the number of frame difference values covered when the sliding window does not slide. For each frame difference subarray, the computer device may filter at least part of the image frames corresponding to the frame difference values in the frame difference subarray according to the window length of the sliding window and the frame difference subarray to obtain the video to be detected.
[0144] In one embodiment, obtaining a video to be detected includes: obtaining an initial video; the initial video is recorded when a trigger operation is performed on an interactive page of an application running on a target device; the screen in the image frame of the initial video presents the target device; determining the coordinates corresponding to the key points of the screen contour of the target device to obtain the corrected coordinates; cropping and correcting each image frame in the initial video according to the corrected coordinates to obtain the video to be detected; the video to be detected includes image frames obtained by cropping and correcting each image frame in the initial video.
[0145] The screen outline key points are key points used to determine the screen outline of the target device. The screen outline is the outline of the screen of the target device. For example, the screen outline key points may include various vertices of the screen of the target device.
[0146] Specifically, the computer device can obtain an initial video, which is recorded when a trigger operation is performed on an interactive page of an application running on a target device, and the target device is presented in the image frame of the initial video. The computer device can obtain the coordinates corresponding to the key points of the screen contour of the target device, and use the coordinates corresponding to the key points of the screen contour as correction coordinates. The computer device can perform cropping correction on each image frame in the initial video according to the correction coordinates. It can be understood that the picture presented by the screen of the target device can be cropped from each image frame in the initial video based on the correction coordinates, and the video to be detected can be obtained based on the cropped picture presented by the screen of the target device. It can be understood that the video to be detected includes the cropped picture presented by the screen of the target device.
[0147] In one embodiment, the screen contour key points of the target device may be manually calibrated, and the coordinates of the screen contour key points in the image frames of the initial video may be used as the coordinates corresponding to the screen contour key points to obtain the corrected coordinates.
[0148] In the above embodiment, since the screen contour key points of the target device can quickly determine the plane of the target device from the image frame, the image frames in the initial video are cropped and corrected respectively through the correction coordinates corresponding to the screen contour key points of the target device to obtain the video to be detected. The picture content presented by the screen of the non-target device in the image frame can be cropped, so that only the picture content presented by the screen of the target device is retained in the video to be detected, avoiding the redundancy of the picture in the video to be detected, thereby improving the detection efficiency of the key image frame.
[0149] In one embodiment, an initial video is recorded by a camera at a target shooting position for an application running on a target device; the coordinates corresponding to the screen contour key points of the target device are determined to obtain correction coordinates, including: obtaining a correction reference image frame; the correction reference image frame is obtained by shooting a reference picture presented on the screen of the target device by a camera at the target shooting position; the reference picture is different from the shooting background of the camera; the picture area vertices corresponding to the reference picture are used as screen contour key points, and the coordinates corresponding to the picture area vertices in the correction reference image frame are used as correction coordinates.
[0150] The reference picture is a picture used for reference in the process of acquiring the key points of the screen contour, and the picture area vertices are vertices of the picture area corresponding to the reference picture.
[0151] Specifically, a reference picture that is significantly different from the shooting background of the camera can be presented on the screen of the target device, and the camera can shoot the reference picture presented on the screen of the target device at the target shooting position to obtain a corrected reference image frame. The computer device can use the vertices of the picture area corresponding to the reference picture as the key points of the screen contour, and use the coordinates corresponding to the vertices of the picture area in the corrected reference image frame as the corrected coordinates.
[0152] In one embodiment, the reference picture may specifically be a desktop image presented by the screen of the target device. It is understood that the desktop image is an image displayed by the system of the target device itself, not an image presented by an application. For example, if the target device is a mobile phone, the reference picture may specifically be a desktop wallpaper image presented by the screen of the mobile phone.
[0153] In one embodiment, Fig.14 As shown, the computer device can obtain the correction reference image frame (i.e. Fig.14The computer device converts the denoised image frame into a grayscale image and performs binarization processing on the grayscale image (i.e., the image only includes black and white) to obtain an initial black-and-white image. The edge of the initial black-and-white image has many burrs. The computer device can perform corrosion processing on the edge of the initial black-and-white image to obtain a target black-and-white image without burrs. The computer device can perform Laplace transformation on the target black-and-white image to extract the target device (i.e., Fig.14 The outline of the screen of the mobile phone in the figure is obtained by dividing the vertices of the outline of the screen (i.e. Fig.14 The vertices in the image are used as the key points of the screen contour, and the coordinates corresponding to the vertices of the picture area in the corrected reference image frame are used as the corrected coordinates. Then, the computer device performs frame-by-frame cropping and correction on each image frame in the initial video according to the corrected coordinates to obtain the video to be detected. It can be understood that the video to be detected includes the cropped picture presented by the screen of the target device, that is, the black edge portion in each image frame in the initial video is cropped.
[0154] In the above embodiment, since the correction reference image frame is obtained by photographing the reference picture presented on the screen of the target device by the camera at the target shooting position, and the reference picture is significantly different from the shooting background of the camera, the accuracy of obtaining the screen contour key points of the target device can be improved by using the vertices of the picture area corresponding to the reference picture as the screen contour key points, and then the accuracy of obtaining the correction coordinates can be improved by using the coordinates corresponding to the vertices of the picture area in the correction reference image frame as the correction coordinates.
[0155] In one embodiment, obtaining a video to be detected includes: obtaining an initial video; the initial video is recorded when a trigger operation is performed on an interactive page of an application; determining a pixel histogram corresponding to each image frame in the initial video; and when it is determined based on the brightness distribution of pixels in the pixel histogram that there is no exposure frame in the initial video, using the initial video as the video to be detected.
[0156] The pixel histogram is an image used to present the brightness distribution of each pixel in the image. The exposure frame is an image frame in which the number of highlight pixels is greater than the preset number of pixels, and the highlight pixels are pixels in the image whose brightness value is greater than the preset brightness.
[0157] Specifically, the computer device can obtain an initial video and convert each image frame in the initial video into a grayscale image. Furthermore, the computer device can determine the pixel histograms corresponding to each image frame in the initial video based on each grayscale image. The computer device can determine whether there is an exposure frame in each image frame in the initial video based on the pixel histogram. In the case where it is determined based on the brightness distribution of the pixels in the pixel histogram that there is no exposure frame in the initial video, the initial video is used as the video to be detected. In the case where it is determined based on the brightness distribution of the pixels in the pixel histogram that there is an exposure frame in the initial video, the initial video is deleted and re-recorded to obtain a new initial video, and then the exposure detection is performed on the new initial video.
[0158] In one embodiment, Fig.15 As shown in (a) in FIG. 1 , if the brightness distribution of the pixels in the pixel histogram is uniform, it is determined that there is no exposure frame in each image frame in the initial video. Fig.15 As shown in (b) in FIG. 1 , if the brightness distribution of the pixels in the pixel histogram is uneven, it is determined that there are exposure frames in each image frame in the initial video, such as Fig.16 As shown, it is the determined exposure frame. It can be understood that there are more pixels with higher brightness in the exposure frame, resulting in unclear picture content.
[0159] In the above embodiment, since the pixel histogram can reflect the distribution of brightness corresponding to each pixel in the image frame, it is possible to quickly determine whether there is an exposure frame in each image frame of the initial video through the brightness distribution of the pixel points in the pixel histogram. By using the initial video as the video to be detected when there is no exposure frame in the initial video, the image quality of each image frame in the video can be improved, thereby further improving the detection accuracy of the key image frame.
[0160] In one embodiment, Fig.17 As shown, the computer device can obtain a video stream and divide the video stream into frames to obtain an initial video (for example, the initial video includes n image frames). The initial video is recorded when the interactive page of the application running on the target device is triggered. When the interactive page is triggered, the screen changes, and the screen in the image frame of the initial video presents the target device. The computer device can determine the coordinates corresponding to the key points of the screen contour of the target device to obtain the corrected coordinates. The computer device can perform cropping correction on each image frame in the initial video (i.e., the tth frame, the initial value of t is 0, and t is less than n-1) according to the corrected coordinates to obtain the corrected image frame. The computer device can perform exposure detection on the corrected image frame, and when it is determined that the corrected image frame is an exposure frame, the initial video corresponding to the corrected image frame is discarded. When it is determined that none of the corrected image frames are exposure frames, the initial video is used as the video to be detected.
[0161] In one embodiment, for each image frame in a video, the similarity between the image frame and a reference image frame is determined to obtain the image similarity corresponding to the image frame, including: for each image frame in the video, determining the correlation coefficient between the image frame and the reference image frame, and determining the normalization coefficient between the image frame and the reference image frame; the correlation coefficient is used to characterize the degree of correlation between the image frame and the reference image frame; the normalization coefficient is used to map the correlation coefficient to a preset range; based on the ratio of the correlation coefficient to the normalization coefficient, determining the similarity between the image frame and the reference image frame, and obtaining the image similarity corresponding to the image frame.
[0162] In one embodiment, for each image frame in the video, the computer device may determine the correlation coefficient between the image frame and the reference image frame, and determine the normalization coefficient between the image frame and the reference image frame. Furthermore, the computer device may directly use the ratio of the correlation coefficient to the normalization coefficient as the similarity between the image frame and the reference image frame to obtain the image similarity corresponding to the image frame.
[0163] In one embodiment, the similarity between the image frame and the reference image frame can be calculated using the following formula:
[0164]
[0165] Where I(x,y) represents the image frame in the video, and T(x',y') represents the reference image frame. The reference image frame can slide on the image frame, and I(x+x',y+y') represents the image area covered by the reference image frame in the image frame. ∑ x',y' (T(x',y')I(x+x',y+y')) represents the correlation coefficient between the image frame and the reference image frame. represents the normalization coefficient between the image frame and the reference image frame. R(x, y) represents the similarity between the image frame and the reference image frame.
[0166] In the above embodiment, since the correlation coefficient between the image frame and the reference image frame can be used to characterize the degree of correlation between the image frame and the reference image frame, the normalization coefficient between the image frame and the reference image frame can be used to map the correlation coefficient to within a preset range, therefore, the similarity between the image frame and the reference image frame is determined by the ratio of the correlation coefficient to the normalization coefficient, and the image similarity corresponding to the image frame is obtained, which can improve the calculation accuracy of the image similarity.
[0167] In one embodiment, Fig.18As shown, the computer device can obtain a video stream, and divide the video stream into frames to obtain an initial video including multiple image frames. The initial video is recorded when the interactive page of the application running on the target device is triggered. When the interactive page is triggered, the screen changes, and the screen in the image frame of the initial video presents the target device. The computer device can determine the coordinates corresponding to the key points of the screen contour of the target device, obtain the correction coordinates, and perform cropping correction on each image frame in the initial video according to the correction coordinates to obtain the corrected image frame (i.e., the correction frame). The computer device can perform exposure detection on the corrected image frame, and when it is determined that the corrected image frame is an exposure frame, the initial video corresponding to the corrected image frame is discarded. When it is determined that none of the corrected image frames are exposure frames, the initial video is used as the video to be detected. The computer device can determine a reference image frame from each image frame of the video to be detected, and for each image frame in the video, determine the similarity between the image frame and the reference image frame to obtain the image similarity corresponding to the image frame. Furthermore, the computer device can perform curve fitting based on the image similarity corresponding to each image frame in the video to obtain a similarity change curve corresponding to the video. The computer device can derive the similarity change curve to obtain a similarity derivative curve corresponding to the video, and use the image frame corresponding to the derivative peak of the similarity derivative curve as the key image frame determined from the image frames of the video.
[0168] like Fig.19 As shown, in one embodiment, a key frame detection method is provided. The method can be applied to a computer device, which can be a terminal or a server. The method can be executed by the terminal or the server itself, or can be implemented through interaction between the terminal and the server. This embodiment is described by taking the method applied to a computer device as an example. The method specifically includes the following steps:
[0169] Step 1902, obtain the initial video; the initial video is recorded when the interactive page of the application running on the target device is triggered; the screen changes when the interactive page is triggered; the screen in the image frame of the initial video shows the target device.
[0170] Step 1904 , for each image frame in the initial video, a frame difference value corresponding to the image frame is obtained according to a pixel difference value between the image frame and a previous adjacent image frame of the image frame.
[0171] Step 1906, based on the frame difference values corresponding to each image frame in the initial video, at least part of the image frames are filtered out from each image frame of the initial video to obtain a first video; the frame difference values corresponding to the filtered image frames are greater than the frame difference values corresponding to the remaining image frames; the remaining image frames are the image frames in the initial video except the filtered image frames.
[0172] Step 1908, determining the coordinates corresponding to the key points of the screen contour of the target device, and obtaining the corrected coordinates.
[0173] Step 1910, crop and correct each image frame in the first video according to the correction coordinates to obtain a second video; the second video includes image frames after cropping and correcting each image frame in the first video.
[0174] Step 1912: Determine the pixel histogram corresponding to each image frame in the second video.
[0175] Step 1914: when it is determined based on the brightness distribution of the pixels in the pixel histogram that there is no exposure frame in the second video, the second video is used as the video to be detected.
[0176] Step 1916, determining a reference image frame from each image frame of the video.
[0177] Step 1918, for each image frame in the video, determine the correlation coefficient between the image frame and the reference image frame, and determine the normalization coefficient between the image frame and the reference image frame; the correlation coefficient is used to characterize the degree of correlation between the image frame and the reference image frame; the normalization coefficient is used to map the correlation coefficient to within a preset range.
[0178] Step 1920, determining the similarity between the image frame and the reference image frame according to the ratio of the correlation coefficient to the normalization coefficient, and obtaining the image similarity corresponding to the image frame.
[0179] Step 1922, performing curve fitting based on the image similarities corresponding to each image frame in the video, to obtain a similarity change curve corresponding to the video.
[0180] Step 1924, deriving the similarity change curve to obtain a similarity derivative curve corresponding to the video.
[0181] Step 1926, the image frame corresponding to the derivative peak value of the similarity derivative curve is used as the key image frame determined from the image frames of the video; the derivative peak value is used to indicate that the similarity change value between the key image frame and the previous adjacent image frame of the key image frame is the largest.
[0182] In one embodiment, the key image frame includes a trigger key frame; the trigger key frame is a key frame entering the trigger stage; determining the reference image frame from each image frame of the video, including: determining the trigger critical frame from each image frame of the video; the trigger critical frame is an image frame in the video before the trigger operation and located at the trigger critical point; using the image area in the trigger critical frame for displaying the trigger position information as a reference image frame; wherein the trigger position information is used to indicate the position where the trigger operation acts in the interactive interface.
[0183] In one embodiment, the key image frame includes a start key frame; the response process for the trigger operation includes a response start stage; the start key frame is a key frame entering the response start stage; determining the reference image frame from each image frame of the video, including: determining the trigger critical frame from each image frame of the video, and using the trigger critical frame as a reference image frame; wherein the trigger critical frame is an image frame in the video that is before the trigger operation and is located at the trigger critical.
[0184] In one embodiment, the key image frame includes an end key frame; the response process for the trigger operation includes a response end stage; the end key frame is a key frame entering the response end stage; determining the reference image frame from each image frame of the video includes: determining the response end frame from each image frame of the video, and using the response end frame as a reference image frame; wherein the response end frame is an image frame in the video after the response trigger operation ends.
[0185] The present application also provides an application scenario, which applies the above-mentioned key frame detection method. Specifically, the key frame detection method can be applied to a key frame detection scenario for a game video in a game scenario. Specifically, the application in the present application includes a game application, the interactive page includes a game interactive page, the video to be detected includes a game video recorded when a trigger operation is performed on a game interactive page of the game application, the image frames in the video include game image frames in the game video, and the target device includes a mobile phone. It can be understood that in a specific game scenario, a game application is running on a mobile phone, and Zhang San can use the mobile phone as a game player to play games. During the process of Zhang San triggering the game interactive page of the game application, a camera can be used to record the video to obtain an initial game video. It can be understood that the screen in the game image frame of the initial game video presents a mobile phone.
[0186] For each game image frame in the initial game video, the computer device can obtain a frame difference value corresponding to the game image frame according to a pixel difference value between the game image frame and a previous adjacent game image frame of the game image frame. Based on the frame difference values corresponding to each game image frame in the initial game video, at least part of the game image frames are filtered out from each game image frame of the initial game video to obtain a first game video; wherein the frame difference value corresponding to the filtered game image frame is greater than the frame difference value corresponding to the remaining game image frames; the remaining game image frames are game image frames in the initial game video other than the filtered game image frames.
[0187] The computer device can determine the pixel histogram corresponding to each game image frame in the first game video. When it is determined based on the brightness distribution of the pixel points in the pixel histogram that there is no exposure frame in the first game video, the first game video is used as the second game video. The coordinates corresponding to the key points of the screen contour of the mobile phone are determined to obtain the corrected coordinates. According to the corrected coordinates, each game image frame in the second game video is cropped and corrected to obtain the game video to be detected; the game video to be detected includes the game image frames after the cropping and correction of each game image frame in the second game video.
[0188] The computer device can determine a reference game image frame from each game image frame of the game video; the reference game image frame is a game image frame whose image is stable after responding to the trigger operation and has a sudden image change relationship with the key game image frame to be detected. For each game image frame in the game video, determine the correlation coefficient between the game image frame and the reference game image frame, and determine the normalization coefficient between the game image frame and the reference game image frame; the correlation coefficient is used to characterize the degree of correlation between the game image frame and the reference game image frame; the normalization coefficient is used to map the correlation coefficient to a preset range. According to the ratio of the correlation coefficient to the normalization coefficient, determine the similarity between the game image frame and the reference game image frame, and obtain the image similarity corresponding to the game image frame.
[0189] The computer device may perform curve fitting based on the image similarities corresponding to each game image frame in the game video to obtain a similarity change curve corresponding to the game video. The similarity change curve is derived to obtain a similarity derivative curve corresponding to the game video. The game image frame corresponding to the derivative peak value of the similarity derivative curve is used as the key game image frame determined from each game image frame of the game video; wherein the derivative peak value is used to indicate that the similarity change value between the key game image frame and the previous adjacent game image frame of the key game image frame is the largest.
[0190] The present application also provides an application scenario, which applies the above-mentioned key frame detection method. Specifically, the key frame detection method can be applied to the key frame detection scenario in the process of beautifying an image. Specifically, the application in the present application includes a Meitu application, the interactive page includes a Meitu interactive page, and the video to be detected includes a Meitu video recorded when a trigger operation is performed on the Meitu interactive page of the Meitu application. The key frame detection method of the present application can quickly detect key image frames from each image frame of the Meitu video, thereby improving the efficiency of key frame detection.
[0191] It should be understood that, although each step in the flow chart of the above-mentioned embodiments is shown in order, these steps are not necessarily performed in order. Unless there is a clear explanation in this article, the execution of these steps does not have strict order restrictions, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the above-mentioned embodiments may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in order, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0192] In one embodiment, Fig. 20 As shown, a key frame detection device 2000 is provided. The device can adopt a software module or a hardware module, or a combination of the two to form a part of a computer device. The device specifically includes:
[0193] The acquisition module 2002 is used to acquire the video to be detected; the video is recorded when the interactive page of the preset application is triggered; when the interactive page is triggered, the screen changes;
[0194] A determination module 2004, configured to determine a reference image frame from each image frame of the video;
[0195] The determination module 2004 is also used to determine, for each image frame in the video, the similarity between the image frame and the reference image frame, and obtain the image similarity corresponding to the image frame; based on the image similarities corresponding to each image frame in the video, determine the change in similarity between each group of adjacent image frames in the video; determine the key image frame from each image frame in the video according to the change in similarity between each group of adjacent image frames; the similarity change value between the key image frame and the previous adjacent image frame of the key image frame is the largest.
[0196] In one embodiment, the determination module 2004 is also used to perform curve fitting based on the image similarities corresponding to each image frame in the video to obtain a similarity change curve corresponding to the video; the similarity change curve is derived to obtain a similarity derivative curve corresponding to the video; the image frame corresponding to the derivative peak value of the similarity derivative curve is used as the key image frame determined from each image frame of the video; wherein the derivative peak value is used to indicate that the similarity change value between the key image frame and the previous adjacent image frame of the key image frame is the largest.
[0197] In one embodiment, the key image frame includes a trigger key frame; the trigger key frame is a key frame that enters the trigger stage; the determination module 2004 is also used to determine the trigger critical frame from each image frame of the video; the trigger critical frame is an image frame in the video that is before the trigger operation and is located at the trigger critical point; the image area in the trigger critical frame used to display the trigger position information is used as a reference image frame; wherein the trigger position information is used to indicate the position where the trigger operation acts in the interactive interface.
[0198] In one embodiment, the key image frame includes a start key frame; the response process for the trigger operation includes a response start stage; the start key frame is a key frame entering the response start stage; the determination module 2004 is also used to determine the trigger critical frame from each image frame of the video, and use the trigger critical frame as a reference image frame; wherein the trigger critical frame is an image frame in the video before the trigger operation and located at the trigger critical.
[0199] In one embodiment, the key image frame includes an end key frame; the response process for the trigger operation includes a response end stage; the end key frame is a key frame entering the response end stage; the determination module 2004 is also used to determine the response end frame from each image frame of the video, and use the response end frame as a reference image frame; wherein the response end frame is an image frame in the video after the response trigger operation ends.
[0200] In one embodiment, the video stops recording after the response trigger operation ends; the response end frame includes the last image frame in the video; the determination module 2004 is also used to determine the last image frame from each image frame of the video, and use the last image frame as a reference image frame.
[0201] In one embodiment, the acquisition module 2002 is also used to acquire an initial video; the initial video is recorded when a trigger operation is performed on an interactive page of an application; for each image frame in the initial video, a frame difference corresponding to the image frame is obtained based on a pixel difference between the image frame and a previous adjacent image frame of the image frame; based on the frame differences corresponding to each image frame in the initial video, at least part of the image frames are filtered out from each image frame of the initial video to obtain a video to be detected; wherein the frame difference corresponding to the filtered image frame is greater than the frame difference corresponding to the remaining image frames; the remaining image frames are image frames in the initial video other than the filtered image frames.
[0202] In one embodiment, the acquisition module 2002 is further used to obtain a frame difference array composed of frame difference values corresponding to each image frame in the initial video; slide a sliding window on the frame difference array, and splice the frame difference values covered by the sliding window at adjacent sliding positions on the frame difference array to obtain multiple frame difference splicing arrays; for each frame difference splicing array, according to the window length of the sliding window and the frame difference splicing array, filter at least part of the image frames from the image frames corresponding to the frame difference values in the frame difference splicing array to obtain the video to be detected.
[0203] In one embodiment, the acquisition module 2002 is also used to acquire an initial video; the initial video is recorded when a trigger operation is performed on an interactive page of an application running on a target device; the screen in the image frame of the initial video presents the target device; the coordinates corresponding to the key points of the screen contour of the target device are determined to obtain the corrected coordinates; each image frame in the initial video is cropped and corrected according to the corrected coordinates to obtain a video to be detected; the video to be detected includes image frames after each image frame in the initial video is cropped and corrected.
[0204] In one embodiment, the initial video is recorded by a camera at a target shooting position for an application running on a target device; the acquisition module 2002 is also used to obtain a correction reference image frame; the correction reference image frame is obtained by shooting a reference picture presented on the screen of the target device by a camera at the target shooting position; the reference picture is different from the shooting background of the camera; the vertices of the picture area corresponding to the reference picture are used as screen contour key points, and the coordinates corresponding to the vertices of the picture area in the correction reference image frame are used as correction coordinates.
[0205] In one embodiment, the acquisition module 2002 is also used to acquire an initial video; the initial video is recorded when a trigger operation is performed on an interactive page of an application; a pixel histogram corresponding to each image frame in the initial video is determined; when it is determined based on the brightness distribution of pixel points in the pixel histogram that there is no exposure frame in the initial video, the initial video is used as the video to be detected.
[0206] In one embodiment, the determination module 2004 is also used to determine, for each image frame in the video, a correlation coefficient between the image frame and a reference image frame, and to determine a normalization coefficient between the image frame and the reference image frame; the correlation coefficient is used to characterize the degree of correlation between the image frame and the reference image frame; the normalization coefficient is used to map the correlation coefficient to a preset range; based on the ratio of the correlation coefficient to the normalization coefficient, the similarity between the image frame and the reference image frame is determined to obtain the image similarity corresponding to the image frame.
[0207] The above-mentioned key frame detection device obtains the video to be detected, which is recorded when the interactive page of the preset application is triggered, and the screen changes when the interactive page is triggered. Determine the reference image frame from each image frame of the video, and automatically determine the similarity between the image frame and the reference image frame for each image frame in the video, and obtain the image similarity corresponding to the image frame. Based on the image similarities corresponding to each image frame in the video, automatically determine the similarity change between each group of adjacent image frames in the video, and then automatically determine the key image frame from each image frame of the video according to the similarity change between each group of adjacent image frames. The similarity change value between the key image frame and the previous adjacent image frame of the key image frame is the largest. Compared with the traditional method of manually detecting key frames, the present application detects key frame images from the video in an automated manner, which can save labor costs and improve the detection efficiency of key frames.
[0208] Each module in the key frame detection device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0209] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.21 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a key frame detection method is implemented.
[0210] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig. 22As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a key frame detection method is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.
[0211] Those skilled in the art will understand that Fig.21 and Fig. 22 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0212] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0213] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0214] In one embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0215] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0216] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0217] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0218] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A key frame detection method, characterized in that: The method comprises: Acquire a video to be detected; the video is recorded when a trigger operation is performed on an interactive page of a preset application; when the interactive page is triggered, a screen change occurs; Determining a reference image frame from each image frame of the video; For each image frame in the video, determine the similarity between the image frame and the reference image frame to obtain the image similarity corresponding to the image frame; Determine the change in similarity between groups of adjacent image frames in the video based on the image similarities respectively corresponding to the image frames in the video; A key image frame is determined from each of the image frames of the video according to the change in similarity between each group of adjacent image frames; the key image frame has the largest similarity change value with a previous adjacent image frame of the key image frame.
2. The method according to claim 1, characterized in that The determining, based on the image similarities respectively corresponding to the image frames in the video, the similarity change between each group of adjacent image frames in the video comprises: Performing curve fitting based on the image similarities corresponding to each of the image frames in the video to obtain a similarity change curve corresponding to the video; The step of determining a key image frame from each of the image frames of the video according to the change in similarity between each group of adjacent image frames comprises: Deriving the similarity change curve to obtain a similarity derivative curve corresponding to the video; The image frame corresponding to the derivative peak value of the similarity derivative curve is used as the key image frame determined from the image frames of the video; The guide peak value is used to indicate that a similarity change value between the key image frame and a previous adjacent image frame of the key image frame is the largest.
3. The method according to claim 1, characterized in that The key image frame includes a trigger key frame; The trigger key frame is a key frame entering the trigger phase; The determining of the reference image frame from each image frame of the video includes: Determine a trigger critical frame from each of the image frames of the video; the trigger critical frame is an image frame in the video before the trigger operation and located at the trigger critical position; Using the image area for displaying the trigger position information in the trigger critical frame as a reference image frame; The trigger position information is used to indicate the position where the trigger operation acts in the interactive interface.
4. The method according to claim 1, characterized in that: The key image frame includes a start key frame; the response process for the trigger operation includes a response start phase; the start key frame is a key frame for entering the response start phase; The determining of the reference image frame from each image frame of the video includes: Determine a trigger critical frame from each of the image frames of the video, and use the trigger critical frame as a reference image frame; The trigger critical frame is an image frame in the video that is before the trigger operation and is located at the trigger critical point.
5. The method according to claim 1, characterized in that The key image frame includes an end key frame; the response process for the trigger operation includes a response end stage; the end key frame is a key frame for entering the response end stage; The determining of the reference image frame from each image frame of the video includes: Determine a response end frame from each of the image frames of the video, and use the response end frame as a reference image frame; The response end frame is an image frame in the video after the response to the trigger operation ends.
6. The method according to claim 5, characterized in that The video stops recording after responding to the trigger operation; the response end frame includes the last image frame in the video; The step of determining a response end frame from each of the image frames of the video and using the response end frame as a reference image frame includes: A last image frame is determined from each of the image frames of the video, and the last image frame is used as a reference image frame.
7. The method according to claim 1, characterized in that The step of obtaining the video to be detected includes: Obtaining an initial video; the initial video is recorded when a trigger operation is performed on an interactive page of the application; For each image frame in the initial video, obtaining a frame difference value corresponding to the image frame according to a pixel difference value between the image frame and a previous adjacent image frame of the image frame; Based on the frame difference values respectively corresponding to the image frames in the initial video, at least part of the image frames are selected from the image frames in the initial video to obtain a video to be detected; Among them, the frame difference value corresponding to the filtered image frame is greater than the frame difference value corresponding to the remaining image frames; the remaining image frames are image frames in the initial video except the filtered image frame.
8. The method according to claim 7, characterized in that The step of selecting at least part of the image frames from the image frames of the initial video based on the frame difference values respectively corresponding to the image frames in the initial video to obtain the video to be detected includes: Obtaining a frame difference array composed of frame difference values corresponding to each of the image frames in the initial video; Sliding a sliding window on the frame difference array, splicing the frame difference values covered by the sliding window at adjacent sliding positions on the frame difference array, to obtain a plurality of frame difference splicing arrays; For each frame difference stitching array, at least part of the image frames are screened from the image frames corresponding to the frame difference values in the frame difference stitching array according to the window length of the sliding window and the frame difference stitching array to obtain the video to be detected.
9. The method according to claim 1, characterized in that: The step of obtaining the video to be detected includes: Acquire an initial video; the initial video is recorded when a trigger operation is performed on an interactive page of the application running on the target device; the target device is shown in an image frame of the initial video; Determine the coordinates corresponding to the key points of the screen contour of the target device, and obtain the corrected coordinates; The image frames in the initial video are cropped and corrected according to the correction coordinates to obtain a video to be detected; the video to be detected includes image frames obtained by cropping and correcting the image frames in the initial video.
10. The method according to claim 9, characterized in that The initial video is recorded by a camera at a target shooting position for the application running on the target device; The determining the coordinates corresponding to the key points of the screen contour of the target device to obtain the corrected coordinates includes: Acquire a calibration reference image frame; the calibration reference image frame is obtained by shooting a reference picture presented on the screen of the target device by the camera at the target shooting position; the reference picture is different from the shooting background of the camera; The picture area vertices corresponding to the reference picture are used as the screen contour key points, and the coordinates corresponding to the picture area vertices in the corrected reference image frame are used as the corrected coordinates.
11. The method according to claim 1, characterized in that: The step of obtaining the video to be detected includes: Obtaining an initial video; the initial video is recorded when a trigger operation is performed on an interactive page of the application; Determine a pixel histogram corresponding to each image frame in the initial video; When it is determined based on the brightness distribution of the pixels in the pixel histogram that there is no exposure frame in the initial video, the initial video is used as the video to be detected.
12. The method according to any one of claims 1 to 11, characterized in that The step of determining, for each image frame in the video, a similarity between the image frame and the reference image frame to obtain an image similarity corresponding to the image frame includes: For each image frame in the video, determining a correlation coefficient between the image frame and the reference image frame, and determining a normalization coefficient between the image frame and the reference image frame; the correlation coefficient is used to characterize the degree of correlation between the image frame and the reference image frame; the normalization coefficient is used to map the correlation coefficient to within a preset range; The similarity between the image frame and the reference image frame is determined according to the ratio of the correlation coefficient to the normalization coefficient, and the image similarity corresponding to the image frame is obtained.
13. A key frame detection device, characterized in that: The device comprises: An acquisition module is used to acquire a video to be detected; the video is recorded when a trigger operation is performed on an interactive page of a preset application; when the interactive page is triggered, a screen change will occur; A determination module, used to determine a reference image frame from each image frame of the video; The determination module is also used to determine, for each image frame in the video, the similarity between the image frame and the reference image frame, and obtain the image similarity corresponding to the image frame; based on the image similarities corresponding to each of the image frames in the video, determine the change in similarity between each group of adjacent image frames in the video; determine a key image frame from each of the image frames in the video according to the change in similarity between the groups of adjacent image frames; the similarity change value between the key image frame and the previous adjacent image frame of the key image frame is the largest.
14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.
15. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.
Citation Information
Cited By
Quality detection method and device for image acquisition of humanoid robot
CN120088258A
