Video special effects testing method, device, computer equipment and storage medium

By extracting reference video frames from standard videos, matching the effective range of target special effects, and comparing, the video special effects inspection is automated, and the problems of low inspection efficiency and accuracy dependence in the prior art are solved, and the efficiency and accuracy of the inspection are improved.

CN113596436BActive Publication Date: 2025-04-25TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110095756.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-25
Publication Date
2025-04-25
Estimated Expiration
2041-01-25

AI Technical Summary

Technical Problem

The prior art is inefficient when testing video special effects functions and the accuracy depends on the technical level of code analysts, making it difficult to ensure the accuracy of the inspection.

Method used

By obtaining reference video frames extracted from standard videos that meet the corresponding effects of the target special effects, matching the effective range of the target special effects, comparing them to obtain the special effects inspection results, and automatic inspection of the special effects addition function is achieved.

Benefits of technology

It improves the efficiency and accuracy of video special effects inspection, avoids dependence on the technical level of code analysts, and ensures the accuracy and time accuracy of special effects addition functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113596436B_ABST
    Figure CN113596436B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, computer equipment and storage medium for testing video special effects. The method includes: obtaining a reference video frame extracted from a standard video that meets the target special effect corresponding effect; the standard video is obtained by adding the target special effect to the initial video; the reference video frame matches the effective range of the target special effect in the standard video; taking the target special effect corresponding effect as the expected effect, the initial video is processed for adding special effects to obtain a special effects video to be tested; extracting a test video frame in the special effects video that matches the effective range; comparing the test video frame with the reference video frame to obtain a first comparison result, and obtaining a special effect test result of the special effects video based on the first comparison result. Only in this way can the method of the present application improve the efficiency and accuracy of video special effects testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, apparatus, computer device and storage medium. Background Art

[0002] With the development of image processing technology, users have increasing requirements for the diversity of multimedia content. Users will use various special effects when editing images or videos to make the multimedia content more colorful. Therefore, whether the special effects function can be implemented normally in actual applications is a key factor in ensuring user experience.

[0003] In the related art, it is usually necessary to check whether the special effect function is normal from the implementation code level of the special effect function. However, this method is not only inefficient, but also restricted by the technical level of the code analyst, and the accuracy of the test is difficult to guarantee. Summary of the invention

[0004] Based on this, it is necessary to provide a method, device, computer equipment and storage medium for inspecting video special effects that can improve the inspection efficiency and accuracy of video special effects in response to the above-mentioned technical problems.

[0005] A method for testing video special effects, the method comprising:

[0006] Obtaining a reference video frame extracted from a standard video that meets the corresponding effect of the target special effect;

[0007] The standard video is obtained by adding the target special effect to the initial video; the reference video frame matches the effective range of the target special effect in the standard video;

[0008] Taking the target special effect corresponding effect as the expected effect, performing special effect adding processing on the initial video to obtain the special effect video to be tested;

[0009] Extracting a test video frame in the special effect video that matches the effective range;

[0010] The inspection video frame and the reference video frame are compared to obtain a first comparison result, and a special effect inspection result of the special effect video is obtained according to the first comparison result.

[0011] A device for testing video special effects, the device comprising:

[0012] A reference video frame acquisition module is used to acquire a reference video frame extracted from a standard video that meets the corresponding effect of the target special effect; the standard video is obtained by adding the target special effect to the initial video; the reference video frame matches the effective range of the target special effect in the standard video;

[0013] A special effect adding processing module, used to perform special effect adding processing on the initial video with the target special effect corresponding effect as the expected effect, so as to obtain the special effect video to be tested;

[0014] A test video frame extraction module, used to extract a test video frame matching the effective range in the special effect video;

[0015] A comparison module is used to compare the inspection video frame with the reference video frame to obtain a first comparison result, and obtain a special effect inspection result of the special effect video according to the first comparison result.

[0016] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0017] Obtaining a reference video frame extracted from a standard video that meets the corresponding effect of the target special effect;

[0018] The standard video is obtained by adding the target special effect to the initial video; the reference video frame matches the effective range of the target special effect in the standard video;

[0019] Taking the target special effect corresponding effect as the expected effect, performing special effect adding processing on the initial video to obtain the special effect video to be tested;

[0020] Extracting a test video frame in the special effect video that matches the effective range;

[0021] The inspection video frame and the reference video frame are compared to obtain a first comparison result, and a special effect inspection result of the special effect video is obtained according to the first comparison result.

[0022] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0023] Obtaining a reference video frame extracted from a standard video that meets the corresponding effect of the target special effect;

[0024] The standard video is obtained by adding the target special effect to the initial video; the reference video frame matches the effective range of the target special effect in the standard video;

[0025] Taking the target special effect corresponding effect as the expected effect, performing special effect adding processing on the initial video to obtain the special effect video to be tested;

[0026] Extracting a test video frame in the special effect video that matches the effective range;

[0027] The inspection video frame and the reference video frame are compared to obtain a first comparison result, and a special effect inspection result of the special effect video is obtained according to the first comparison result.

[0028] The above-mentioned video special effect inspection method, device, computer equipment and storage medium obtain a reference video frame extracted from a standard video that meets the target special effect corresponding effect. Since the standard video is obtained by adding the target special effect to the initial video, and the reference video frame matches the effective range of the target special effect, the reference video frame can accurately present the special effect corresponding to the target special effect. The terminal further takes the target special effect corresponding effect as the expected effect, performs special effect adding processing on the initial video to obtain the special effect video to be inspected, and extracts the inspection video frame that matches the effective range in the special effect video. When the special effect function of the terminal is normal, the extracted inspection video frame can accurately present the special effect corresponding to the target special effect. Therefore, the inspection video frame and the reference video frame can be compared to obtain a first comparison result, and the special effect inspection result of the special effect video is obtained according to the first comparison result, thereby realizing the automatic inspection of the special effect adding function. Compared with the related art of inspecting whether the special effect function is normal from the implementation code level of the special effect function, the automatic inspection method is not only more efficient, but also will not be restricted by the technical level of the code analyst, and has higher accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 A diagram showing an application environment of a method for testing video special effects in one embodiment;

[0030] Figure 2 1 is a flow chart of a method for testing video special effects in one embodiment;

[0031] Figure 3 A schematic diagram of a flow chart of a step of generating the initial video frame in an embodiment;

[0032] Figure 4 A schematic diagram of a flow chart of testing video special effects in another embodiment;

[0033] Figure 5 A histogram of a difference map corresponding to a test video frame in one embodiment;

[0034] Fig. 6A is a schematic diagram of a basic video frame in one embodiment;

[0035] Figure 6B is a schematic diagram of an action video frame in one embodiment;

[0036] Figure 6C A schematic diagram of a target special effect corresponding to an effect in an embodiment;

[0037] Fig. 7A A schematic diagram of a special effect when a face is recognized in one embodiment;

[0038] Figure 7B is a schematic diagram of a special effect triggered when a blinking action is detected in one embodiment;

[0039] Figure 7C is a schematic diagram of a difference map in one embodiment;

[0040] Fig. 8A is a schematic diagram of an action video frame in another embodiment;

[0041] Figure 8 is a structural block diagram of a video special effect testing device in one embodiment;

[0042] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0043] 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.

[0044] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0045] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0046] Computer Vision (CV) is a science that studies how to make machines "see". To put it more specifically, it refers to using cameras and computers to replace human eyes to identify, follow and measure targets, and further process images so that the computer processes them into images that are more suitable for human observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multi-dimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and map construction, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.

[0047] Machine Learning (ML) is a multi-disciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning usually include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.

[0048] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, etc. I believe that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.

[0049] The solution provided in the embodiments of the present application involves technologies such as artificial intelligence computer vision, which is specifically described by the following embodiments:

[0050] The video special effects inspection 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, and the terminal 102 includes multiple, for example, 102a, 102b. The terminal 102 can be provided with a video client, and the server 104 is a background server corresponding to the video client, storing the initial video and the standard video, wherein the standard video is a video that meets the corresponding effect of the target special effect, and the standard video is obtained by adding the target special effect to the initial video. The terminal can obtain the initial video and the standard video from the server, extract the video frame that matches the effective range of the target special effect from the standard video as the reference video frame, take the corresponding effect of the target special effect as the expected effect, add the special effect to the initial video, obtain the special effect video to be tested, and further extract the video that matches the effective range of the target special effect from the special effect video as the test video frame, after which the terminal can compare the test video frame with the reference video frame to obtain a first comparison result, and obtain the special effect test result of the special effect video according to the first comparison result.

[0051] The terminal 102 may be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.

[0052] In one embodiment, Figure 2 As shown, a method for testing video special effects is provided, and the method is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:

[0053] Step 202, obtain a reference video frame extracted from a standard video that meets the corresponding effect of the target special effect; the standard video is obtained by adding the target special effect to the initial video; the reference video frame matches the effective range of the target special effect in the standard video.

[0054] Among them, special effects refer to video special effects, which are specific patterns or animations added to video frames. For example, adding glasses to a face in a video frame containing a face; for another example, adding a snowing animation to a video frame containing a face. When the video special effects adding function is normal, the video special effects are usually triggered by specific content in the video. For example, in a video frame containing a face, the video special effects can be triggered by the face. The target special effect refers to the special effect that needs to be checked whether it can be added normally. The corresponding effect of the target special effect refers to the effect at the graphic level after the target special effect is added normally. It can be understood that when the video special effect is a pattern, the corresponding effect of the target special effect is the image effect presented by the pattern; when the video special effect is an animation, the corresponding effect of the target special effect is the animation effect presented by the animation.

[0055] The standard video is a video whose special effect adding effect meets the corresponding effect of the target special effect. Since the special effect adding effect of the standard video meets the corresponding effect of the target special effect, the standard video can be used as a reference to test the special effect adding function of the terminal. The standard video is obtained by adding the target special effect to the initial video. Here, adding the target special effect to the initial video can be a technician manually adding the target special effect to the initial video; or the video application automatically adds the target special effect after reading the initial video. At this time, in order to ensure the accuracy of the inspection, the automatically added special effects can be manually confirmed to ensure that the special effect adding effect of the standard video meets the corresponding effect of the target special effect. The initial video here refers to the original video without special effects added. Usually, the initial video contains specific content that can trigger the target special effect.

[0056] In one embodiment, the initial video may be a video collected from the Internet and containing specific content that can trigger the target special effect. For example, if the specific content that can trigger the target special effect is a human face, then the initial video is a video containing a human face.

[0057] It can be understood that when there are multiple target special effects, multiple special effects can be added to the initial video to obtain a standard video; or each target special effect can be added to the initial video separately to obtain a standard video of each target special effect. At this time, the standard video only contains one target special effect.

[0058] The reference video frame matches the effective range of the target special effect in the standard video. Among them, the effective range of the target special effect can be the effective time range of the target special effect or the serial number range of the effective video frame of the target special effect. For example, the effective range of a certain target special effect can be 3.0 seconds to 3.2 seconds; for another example, the effective range of a certain target special effect can be the 90th frame to the 105th frame in the video. Correspondingly, the reference video frame matches the effective range of the target special effect, which means that the time of the reference video frame is within the effective time range of the target special effect or the video frame serial number of the reference video frame is within the serial number range of the effective video frame of the target special effect. For example, in the above example, when the effective range of the target special effect can be 3.0 seconds to 3.2 seconds, the time of the reference video frame needs to be within the time period of 3.0 seconds to 3.2 seconds; when the effective range of the target special effect is from the 90th frame to the 105th frame, the video frame serial number of the reference video frame needs to be between the 90th frame and the 105th frame.

[0059] Specifically, a video client is provided on the terminal, and the video client may be a web client or an APP (Application) client. The video client has a function of adding special effects. The terminal tests the function of adding special effects to the video client according to a preset period. When testing, the terminal extracts a reference video frame from a standard video as a basis for the special effect test.

[0060] In one embodiment, before the first inspection, the terminal obtains the initial video and the standard video from the server, and saves the initial video and the standard video locally. For each subsequent inspection, the terminal can obtain the initial video and the standard video locally, and extract the video frame that matches the effective range of the target special effect from the standard video as the reference video frame. In other embodiments, the terminal can also save the reference video frame locally when the reference video frame is extracted for the first time, so that the terminal can directly obtain the reference video frame locally in subsequent inspections, thereby improving the efficiency of special effect inspection.

[0061] It can be understood that in other embodiments, in order to save local storage space, the terminal may not save the initial video and the standard video locally, and send a request to the server to obtain the initial video and the standard video each time the special effects are checked, and extract the video frames that match the effective range of the target special effects from the standard video as reference video frames.

[0062] Step 204, taking the target special effect corresponding effect as the expected effect, performing special effect adding processing on the initial video to obtain the special effect video to be tested.

[0063] Specifically, the terminal adds special effects to the initial video. During the process of adding special effects, the target special effect corresponding effect is used as the expected effect to obtain a special effects video to be tested. At this time, the special effects video is the video after the special effects are added. Whether the target special effects are added normally to the special effects video is unknown, and it is necessary to use a reference video extracted from the standard video as a basis for testing.

[0064] In one embodiment, the terminal can detect the video content of the initial video with the target special effect corresponding effect as the expected effect, and when the trigger content corresponding to the target special effect is detected, the terminal adds special effects to the initial video to obtain the special effects video to be tested.

[0065] Step 206: extract the test video frame that matches the effective range in the special effect video.

[0066] Specifically, since the terminal uses the reference video frame as the basis when performing special effects testing, the reference video frame is obtained from a standard video that meets the corresponding effect of the target special effect and matches the effective time of the reference video. Then the reference video frame can accurately present the special effects corresponding to the target special effect. For the terminal, when the special effects adding function is normal, the special effects video to be tested obtained by the terminal through special effects processing of the initial video will present the special effects of the target special effect within the effective range of the target special effect. Then the terminal can extract a video frame that matches the effective range of the target special effect from the special effects video to be tested as a test video frame, and judge whether the special effects adding function of the terminal is normal by judging whether the test video frame adds the target special effect normally.

[0067] In one embodiment, the terminal may first determine the effective time range of the target special effect, extract a video frame with a time range within the effective time range from the special effect video to be tested as a video frame that matches the effective range of the target special effect, and obtain a test video frame. For example, assuming that the effective time range of the target special effect is 3.0S-3.2S, then any frame within the time period of 3.0S-3.2S in the special effect video to be tested may be selected as a test video frame. It is understandable that, in a specific implementation, in order to ensure the accuracy of subsequent comparisons, the terminal may obtain the exact time of the reference video frame, and obtain a video frame with the same exact time as the reference video frame from the special effect video to be tested as a test video frame.

[0068] In another embodiment, the terminal may first determine the serial number range of the effective video frames of the target special effect, extract the video frames with the video frame serial number range in the serial number range from the special effect video to be tested as the video frames matching the effective range of the target special effect, and obtain the test video frames. For example, assuming that the effective range of the target special effect is the 90th frame to the 105th frame, then any frame from the 90th frame to the 105th frame of the special effect video to be tested may be selected as the test video frame. It can be understood that in a specific implementation, in order to ensure the accuracy of subsequent comparison, the terminal may obtain the exact serial number of the reference video frame, and obtain the video frame with the same exact serial number as the reference video frame from the special effect video to be tested as the test video frame.

[0069] Step 208 , compare the inspection video frame with the reference video frame to obtain a first comparison result, and obtain a special effect inspection result of the special effect video according to the first comparison result.

[0070] Specifically, since the standard video and the special effects video to be tested are obtained by adding the same special effects to the same initial video, and the special effects added to the standard video are consistent with the corresponding effects of the target special effects, then when the special effects function of the terminal is added normally, the test video frame extracted from the effective time of the target special effects in the special effects video to be tested is similar to the special effects presented by the reference video extracted from the effective time of the target special effects in the standard video. The terminal can then compare the test video frame with the reference video frame, and obtain the special effects test result of the special effects video to be tested based on the comparison result. The special effects test result includes two types: the special effects added by the terminal are abnormal, or the special effects added by the terminal are normal.

[0071] In one embodiment, when comparing the test video frame with the reference video frame, the terminal may compare the similarity between the test video frame and the reference video frame. In other embodiments, when comparing the test video frame with the reference video frame, the terminal may also compare the difference between the test video frame and the reference video frame.

[0072] In one embodiment, the terminal may obtain a result identifier for characterizing the special effect test result according to the first comparison result. For example, "1" is used to identify the special effect test result of the terminal adding normal special effects, and "0" is used to identify the special effect test result of the terminal adding abnormal special effects.

[0073] In one embodiment, when the special effect inspection result shows that the special effect addition is abnormal, the terminal can generate an alarm message and send the alarm message to the server. The server can notify relevant technical personnel to improve the special effect adding function or conduct further manual inspection.

[0074] In one embodiment, when the special effect inspection result is that the special effect is added normally, it means that the special effect video to be inspected also meets the corresponding effect of the target special effect, then the terminal can save the special effect video during this inspection process as the standard video for the next inspection.

[0075] In the above-mentioned video special effects inspection method, by obtaining a reference video frame extracted from a standard video that meets the target special effect corresponding effect, since the standard video is obtained by adding the target special effect to the initial video, and the reference video frame matches the effective range of the target special effect, then the reference video frame can accurately present the special effect effect corresponding to the target special effect. The terminal further takes the target special effect corresponding effect as the expected effect, performs special effect adding processing on the initial video, obtains the special effect video to be inspected, and extracts the inspection video frame that matches the effective range in the special effect video. When the special effect function of the terminal is normal, the extracted inspection video frame can accurately present the special effect effect corresponding to the target special effect. Therefore, the inspection video frame and the reference video frame can be compared to obtain a first comparison result, and the special effect inspection result of the special effect video is obtained according to the first comparison result, thereby realizing the automatic inspection of the special effect adding function. Compared with the related technology of inspecting whether the special effect function is normal from the implementation code level of the special effect function, the automatic inspection method is not only more efficient, but also will not be restricted by the technical level of the code analyst, and has higher accuracy.

[0076] In one embodiment, taking the effect of the target special effect as the expected effect, adding special effects to the initial video to obtain the special effects video to be tested includes: taking the effect corresponding to the target special effect as the expected effect, detecting the video content of the initial video, and when the triggering content corresponding to the target special effect is detected, adding special effects to the initial video to obtain the special effects video to be tested.

[0077] Among them, the trigger content corresponding to the target special effect refers to the video content used to trigger the addition of the target special effect. The trigger content corresponding to the target special effect includes at least one of the target object and the target action corresponding to the target object. The target object can specifically be an independent life form or object, such as a natural person, an animal, a vehicle, a virtual character, etc., or a specific part, such as a face, a hand, etc. For example, the implementation of the target special effect is to add glasses to a human face in a video frame containing a human face, in which case the human face is the target object. The target action corresponding to the target object refers to the action formed by the subject movement corresponding to the target object. The target action can be an action performed by an independent life form, such as a facial feature movement or a limb movement of the human body. The target action can also be the movement of an object, for example, the target action can be the driving of a vehicle. It can be understood that for different target special effects, the target objects can be the same or different.

[0078] Specifically, the terminal takes the target special effect corresponding effect as the expected effect, and performs frame-by-frame detection on the video frames of the initial video to detect the video content of the initial video, and when the trigger content corresponding to the target special effect is detected, the initial video is processed to add special effects to obtain the special effects video to be tested. During the detection process, the terminal can input the video frames in the initial video frame by frame into the detection model corresponding to the trigger content corresponding to the target special effect to obtain the detection result. The detection model here refers to a machine learning model that can detect video frames. It can be understood that the detection model is different for different trigger contents. For example, when the trigger content is a target object, the detection model can be an object detection model; when the trigger content is a target action, the detection model is a target action detection model.

[0079] In a specific embodiment, taking the target object as a face, a general machine learning model that can be used for face recognition can be obtained as a detection model, and face recognition can be performed frame by frame on the video frames in the initial video; or a face image with annotated face areas can be obtained as a training sample for supervised machine learning training to obtain a detection model that can be used for face recognition. During the training process, the random gradient descent algorithm, Adagrad (AdaptiveGradient) algorithm, Adadelta (an improvement of the AdaGrad algorithm), RMSprop (an improvement of the AdaGrad algorithm), Adam (Adaptive Moment Estimation) algorithm, etc. can be used to adjust the network parameters of the detection model. When the training stop condition is met, the training is completed and the trained detection model is obtained, where the training stop condition can be that the network parameters no longer change, the loss reaches the minimum value, the number of training times reaches the maximum number of iterations, and so on.

[0080] In the above embodiment, the terminal detects the video content of the initial video with the target special effect corresponding to the expected effect, and when the trigger content corresponding to the target special effect is detected, the special effect is added to the initial video to obtain the special effect video to be tested. Then, if the video special effect adding function of the terminal is normal, the target special effect should be triggered by the trigger content. Therefore, the effective range of the target special effect in the standard video can be determined according to the appearance time of the trigger content.

[0081] In one embodiment, the trigger content corresponding to the target special effect includes a target object, and the step of determining the effective time of the target special effect includes: obtaining the appearance time period of the target object; and determining the appearance time period of the target object as the effective range of the target special effect.

[0082] Specifically, when the trigger content corresponding to the target special effect includes a target object, the target special effect will be triggered when the target object appears. After the target object disappears, the target special effect also disappears. Therefore, the terminal can obtain the time period when the target object appears and determine the time period when the target object appears as the effective range of the target special effect.

[0083] In one embodiment, after acquiring the initial video, the terminal may detect the video content of the initial video to determine the appearance period of the target object in the initial video, and determine the appearance period of the target object as the effective range of the target special effect. For example, the terminal detects the video content of the initial video and determines that the appearance period of the target object in the initial video is 3.0 seconds to 3.2 seconds, then 3.0 seconds to 3.2 seconds can be determined as the effective range of the target special effect.

[0084] In other embodiments, after acquiring the initial video, the terminal may also detect the video content of the initial video to determine the video frame numbers of the video frames in which the target object appears in the initial video, and determine the video frame number range formed by the video frame numbers of the video frames in which the target object appears as the effective range of the target special effect. For example, after the terminal detects the video content of the initial video, it determines that the video frames in which the target object appears in the initial video are the 90th to 120th frames, and then it can be determined that the effective range of the target special effect is the 90th to 120th frames.

[0085] In one embodiment, the trigger content corresponding to the target special effect includes the target action corresponding to the target object; the step of determining the effective range of the target special effect includes: obtaining the occurrence time period of the target action; and determining a preset time after the occurrence time period of the target action as the effective range of the target special effect.

[0086] Specifically, when the trigger content corresponding to the target special effect includes the target action corresponding to the target object, the target special effect will be triggered after the target action is completed, and the target special effect will last for a preset period of time. Therefore, the terminal can obtain the time period of the target action. After obtaining the time period of the target action, the preset time after the time period of the target action is determined as the effective range of the target special effect. Among them, the duration of the preset time after the time period of the target action is determined according to the preset duration of the target special effect. It can be understood that in order to ensure the accuracy of the determination of the effective range, the shorter the time interval between the effective range and the time period of the target action, the better.

[0087] In one embodiment, after acquiring the initial video, the terminal may detect the video content of the initial video to determine the appearance period of the target action in the initial video, and determine a preset time after the appearance period of the target action as the effective range of the target special effect. For example, the terminal detects the video content of the initial video and determines that the appearance period of the target action in the initial video is 3.0 seconds to 3.2 seconds, then 3.3 seconds to 3.4 seconds may be determined as the effective range of the target special effect.

[0088] In one embodiment, the target action includes a target facial action of a target object, and obtaining the appearance time period of the target action includes: obtaining the appearance time period of the target facial action; determining a preset time after the appearance time period of the target action as the effective range of the target special effect includes: determining the last unit moment corresponding to the target facial action according to the appearance time period of the target facial action; obtaining the preset duration of the target special effect; and determining a preset time with the next unit moment corresponding to the last unit moment corresponding to the target facial action as the starting moment and the duration matching the preset duration as the effective range of the target special effect.

[0089] Among them, the target object is a human face, and the facial features of the target object include blinking, opening the mouth, shaking the head, nodding, raising the head, etc. The target facial features of the target object refer to the facial features of the target object that can trigger the target special effect. For example, the target special effect is to appear a heart animation when a blinking action is detected. For this target special effect, its target facial features are blinking. The preset duration of the target special effect refers to the preset effective duration of the target special effect. The unit moment can be preset, for example, it can be 0.1 seconds. The end unit moment refers to the last unit moment in the time period of the target facial features. For example, the time period of the target facial features is from 3.0 seconds to 3.2 seconds. When the unit moment is 0.1 seconds, the end unit moment of the target facial features is 3.2 seconds.

[0090] Specifically, after obtaining the initial video, the terminal can detect the video content of the initial video to determine the appearance time period of the target facial features in the initial video, determine the last unit moment in the appearance time period of the target facial features as the end unit moment corresponding to the target facial features, further obtain the preset duration of the target special effect, and then use the next unit moment of the end unit moment as the starting moment of the effective range of the target special effect, determine the end moment of the effective range of the target special effect according to the sum of the starting moment and the preset duration, and determine the period from the starting moment to the end moment of the effective range as the effective range of the target special effect.

[0091] For example, assuming that the target facial movement is a blink, after detecting the video content of the initial video, the terminal determines that the blinking action in the initial video occurs from 3.0 seconds to 3.2 seconds, that is, at 3.2 seconds, the target object completes the blinking action, then 3.2 seconds is the end moment of the blinking action, assuming that the unit time is 0.1 seconds and the preset duration of the target special effect is 0.2 seconds, then 3.3 seconds to 3.5 seconds can be determined as the effective range of the target special effect.

[0092] In the above embodiment, the terminal obtains the time period when the target facial feature movement occurs, determines the last unit moment corresponding to the target facial feature movement according to the time period when the target facial feature movement occurs, obtains the preset duration of the target special effect, and determines a preset time with the next unit moment of the last unit moment corresponding to the target facial feature movement as the starting moment and the duration matching the preset duration as the effective range of the target special effect. Since the effective range of the target special effect starts with the next unit moment of the last unit moment corresponding to the target facial feature movement as the starting moment, the obtained effective range is more accurate.

[0093] In one embodiment, the trigger content corresponding to the target special effect includes the target limb movement corresponding to the target object, and the step of determining the effective range of the target special effect includes: obtaining the time period of occurrence of the target limb movement, and obtaining the video frame rate of the initial video; determining the frame number of the last video frame of the target limb movement according to the time period of occurrence of the target limb movement and the video frame rate of the initial video frame; determining the frame number of the next video frame according to the frame number of the last video frame of the target limb movement, and obtaining the starting frame number of the target special effect; obtaining the preset duration of the target special effect, and determining the number of video frames of the target special effect according to the preset duration and the video frame rate of the initial video frame; determining the video frame number range of the target special effect according to the starting frame number of the target special effect and the number of video frames of the target special effect, and using the video frame number range of the target special effect as the effective range of the target special effect.

[0094] The body movements of the target object refer to human body movements, such as raising hands, clenching fists, kicking legs, etc. The target body movements refer to the body movements of humans that can trigger target special effects. For example, if a target special effect is to have twinkling stars appear when a hand-raising movement is detected, then hand-raising is used as the target body movement of the target special effect. The video frame rate of the initial video is known and can be directly obtained by the terminal. For example, the video frame rate can be 30 frames per second. Based on the video frame rate of the initial video, the terminal can calculate the video frame number at any time in the initial video according to the following formula (1):

[0095]

[0096] in, is the video frame number, t is the time in the initial video, is the video frame rate of the initial video.

[0097] For example, assuming that the video frame rate is 30 frames per second, the video frame number at the 2.2th second in the initial video is: 2.2*30=66.

[0098] It is understandable that, referring to the above formula (1), the number of video frames in any time period in the initial video can also be calculated. When calculating the number of video frames in any time period, t in the above formula (1) is the length of time corresponding to the time period. For example, assuming that the video frame rate can be 30 frames per second, the number of video frames in a time period of 10 seconds in the initial video is: 10*30=300.

[0099] Specifically, after acquiring the initial video, the terminal can detect the video content of the initial video to determine the appearance period of the target limb movement in the initial video, and further obtain the video frame rate of the initial video, and determine the end time of the target limb movement according to the appearance period of the target limb movement. The video frame corresponding to the end time is the end video frame of the target limb movement. Then, the terminal can refer to the above formula (1) to calculate the video frame number of the video frame corresponding to the end time, obtain the frame number of the end video frame of the target limb movement, add 1 to the frame number of the end video frame of the target limb movement to obtain the frame number of the next video frame corresponding to the end video frame, and use the frame number as the starting frame number of the target special effect. The starting frame number here is the frame number of the first video frame corresponding to the target special effect.

[0100] After obtaining the starting frame number of the target special effect, the terminal can obtain the preset duration of the target special effect, and calculate the number of video frames corresponding to the preset duration according to the above formula (1) to obtain the number of video frames of the target special effect.

[0101] After obtaining the starting frame number of the target special effect and the number of video frames of the target special effect, the terminal can determine the ending frame number of the target special effect, determine the video frame number range of the target special effect according to the starting frame number and the ending frame number, and use the video frame number range as the effective range of the target special effect. Among them, the ending frame number of the target special effect refers to the frame number of the last video frame corresponding to the target special effect.

[0102] For example, assuming that the target limb movement occurs during a period of 3.0 seconds to 3.2 seconds, and the video frame rate of the initial video is 30 frames per second, the frame number of the last video frame of the target limb movement is determined to be 66 according to the period of the target limb movement and the video frame rate of the initial video frame, and the frame number of the next video frame is determined according to the frame number of the last video frame of the target limb movement, and the starting frame number of the target special effect is 67. Assuming that the preset duration of the target special effect is 0.2 seconds, the preset duration and the video frame rate of the initial video frame determine that the number of video frames of the target special effect is 6 frames. Finally, the video frame number range of the target special effect is determined to be 67-72 according to the starting frame number of the target special effect and the number of video frames of the target special effect.

[0103] In the above embodiment, the terminal determines the frame number of the last video frame of the target limb movement according to the occurrence time period of the target limb movement and the video frame rate of the initial video frame, determines the next video frame after the target limb movement is completed as the starting video frame of the target special effect, obtains the starting frame number of the target special effect, and determines the number of video frames of the target special effect according to the preset duration of the target special effect and the video frame rate of the initial video frame, so that the video frame number range of the target special effect can be determined, and the video frame number range is used as the effective range of the target special effect. Since the effective range starts from the next video frame after the target limb movement is completed, and the effective range is determined by the video frame number, the obtained effective range is more accurate.

[0104] In one embodiment, the trigger content corresponding to the target special effect includes a target action corresponding to the target object; the steps of generating the initial video include: obtaining a basic video frame containing the target object; obtaining an action video frame corresponding to the target action; in the action video frame, the target object performs the target action; and generating the initial video based on the basic video frame and the action video frame.

[0105] The basic video frame is a video frame containing a target object. In an action video frame, the target object performs a target action, and the action video frame is a video frame whose content is the target object performing the target action.

[0106] In this embodiment, the trigger content corresponding to the target special effect includes the target action corresponding to the target object, so the video content of the generated initial video needs to include the target action. The terminal can then obtain a basic video frame, generate multiple video frames identical to the basic video frame based on the basic video frame, obtain an action video frame corresponding to the target action, generate multiple video frames identical to the action video frame based on the action video frame, combine multiple consecutive action video frames to obtain the target action, and combine the target action with other basic frames to generate the initial video.

[0107] In the above embodiment, the terminal obtains a basic video frame containing a target object, obtains an action video frame corresponding to a target action, and generates an initial video according to the basic video frame and the action video frame, thereby realizing automatic generation of the initial video and improving the generation efficiency of the initial video.

[0108] In one embodiment, Figure 3 As shown, generating an initial video frame according to the basic video frame and the action video frame includes:

[0109] Step 302, obtaining a video frame rate and a preset duration of the initial video, and determining a total number of frames of the initial video according to the video frame rate and the preset duration of the initial video frame.

[0110] Specifically, after obtaining the video frame rate and preset duration of the initial video, the terminal may refer to the above formula (1) to calculate the number of video frames of the initial video, that is, the total number of frames of the initial video.

[0111] Step 304 , obtaining the occurrence time period of the target action, and determining a first target frame number of the action video frame according to the occurrence time period of the target action and the video frame rate.

[0112] Specifically, after obtaining the occurrence time period of the target action, the terminal can determine the time of the starting video frame and the time of the ending video frame of the target action, and then refer to the above formula (1) to determine the frame number of the starting video frame and the frame number of the ending video frame of the target action, and then obtain the number of action video frames required to combine into the target action, and obtain the first target frame number.

[0113] Step 306, obtaining the difference between the total number of frames of the initial video and the first target number of frames of the action video frame, and obtaining the second target number of frames of the basic video frame.

[0114] Specifically, all video frames except the action video frames in the initial video can be basic video frames, and the terminal can obtain the difference between the total number of frames of the initial video and the target number of video frames of the action video frames to obtain the second target number of basic video frames.

[0115] Step 308, generating a first target number of video frames as video frames within the target action occurrence period according to the action video frames, and generating a second target number of video frames as video frames outside the target action occurrence period according to the basic video frames, to generate initial video frames.

[0116] Specifically, the terminal can generate video frames with a number equal to the first target number of frames and the same content as the action video frames based on the action video frames, and use these video frames as video frames within the time period when the target action occurs, and generate video frames with a number equal to the second target number of frames and the same content as the basic video frames based on the basic video frames, and use these video frames as video frames outside the time period when the target action occurs, thereby combining the action video frames with the first target number of frames with the basic video frames with the second target number of frames to obtain an initial video, in which the target action will appear in the time period when the target action occurs.

[0117] In the above embodiment, by using the action video frame as the video frame within the target action occurrence period and the basic video frame as the video frame outside the target action occurrence period to generate the initial video, any target action can be generated at any time with a high degree of freedom.

[0118] In one embodiment, Figure 4 As shown, a method for testing video special effects is provided, comprising the following steps:

[0119] Step 402, obtain a reference video frame extracted from a standard video that meets the corresponding effect of the target special effect; the standard video is obtained by adding the target special effect to the initial video; the reference video frame matches the effective range of the target special effect in the standard video.

[0120] Step 404, taking the target special effect corresponding effect as the expected effect, adding special effects to the initial video to obtain a special effects video to be tested.

[0121] Step 406: extract the test video frame that matches the effective range in the special effect video.

[0122] Step 408: Compare the inspection video frame with the reference video frame to obtain a first comparison result.

[0123] The first comparison result obtained through steps 402-408 can verify whether the terminal performs special effect adding processing on the initial video to obtain whether the effect of the target special effect in the special effect video to be tested is normal, but it cannot guarantee whether the adding time of the target special effect in the special effect video is normal. The terminal may have added the target special effect before the effective range of the target special effect. At this time, the special effect adding function of the terminal is also abnormal. In order to consider this situation, the terminal further executes the following steps 410-414 to obtain a second comparison result, and verifies the adding time of the special effect in the special effect video according to the second comparison result.

[0124] Step 410, obtaining a reference video frame extracted from the standard video; the reference video frame matches the reference range of the target special effect in the standard video; the reference range of the target special effect is before the appearance range of the triggering content in the initial video.

[0125] Among them, the control range of the target special effect can be a control time range or a control video frame serial number range. For example, the control range of a certain target special effect can be 2.7 seconds to 2.9 seconds; for another example, the control range of a certain target special effect can be the 85th to 90th frame in the video. Correspondingly, the control range of the control video frame matches the control range of the target special effect, which means that the time of the control video frame is within the control time range of the target special effect or the video frame serial number of the control video frame is within the control video frame serial number range of the target special effect. For example, in the above example, when the control range of the target special effect can be 2.7 seconds to 2.9 seconds, the time of the control video frame needs to be within the time period of 2.7 seconds to 2.9 seconds; when the control range of the target special effect is the 85th to 90th frame, the video frame serial number of the reference video frame needs to be between the 85th and 90th frames.

[0126] The trigger content includes at least one of a target object and a target action corresponding to the target object. In one embodiment, the trigger content may be a time range or a video frame number range in which the target object exists; in other embodiments, the trigger content may be a time range or a video frame number range in which the target action appears.

[0127] The control range of the target special effect is before the appearance range of the triggering content in the initial video. In one embodiment, the control range of the target special effect can be a period of time before the appearance time range of the triggering content in the initial video. For example, the appearance time range of the triggering content is 3.0 seconds to 3.2 seconds, and the control range of the target special effect can be 2.8 seconds to 2.9 seconds. In another embodiment, the control range of the target special effect can be the sequence number range before the video frame sequence number range of the triggering content in the initial video. Here, the sequence number range before the video frame sequence number range of the triggering content means that the maximum value of the sequence number range is less than the minimum value of the video frame sequence number range of the triggering content. For example, assuming that the video frame sequence number range of the triggering content is from the 100th frame to the 120th frame, the control range of the target special effect can be the 90th frame to the 95th frame.

[0128] The control video frame matches the control range of the target special effect in the standard video. The control range of the target special effect is before the appearance range of the triggered content in the initial video. Then the control video frame is the video frame before the target special effect appears in the standard video. The target special effect is not added to this video frame. The control video frame can be used as a basis to check whether the terminal has added the target special effect at a time when the target special effect should not be added, thereby ensuring the accuracy of the target special effect adding time.

[0129] Step 412: extract the test video frames in the special effect video that match the control range.

[0130] Specifically, when the special effects adding function is normal, the special effects video to be tested obtained by the terminal performing special effects processing on the initial video will present the special effects of the target special effects within the effective range of the target special effects, but will not present the special effects of the target special effects within the control range of the target special effects. Then, the terminal can also extract a video frame that matches the control range of the target special effects from the special effects video to be tested as a control video frame, and determine whether the special effects adding function of the terminal is normal by judging whether the control video frame does not add the target special effects.

[0131] In one embodiment, the terminal may first determine the control time range of the target special effect, extract video frames with a time range within the control time range from the special effects video to be tested as video frames that match the control range of the target special effect, and obtain a test video frame that matches the control time. For example, assuming that the control time range of the target special effect is 2.6 seconds to 2.7 seconds, any frame within the time period of 2.6 seconds to 2.7 seconds in the special effects video to be tested may be selected as a test video frame. It is understandable that, in a specific implementation, in order to ensure the accuracy of subsequent comparisons, the terminal may obtain the exact time of the control video frame, and obtain a video frame with the same exact time as the control video frame from the special effects video to be tested as a test video frame that matches the control time.

[0132] In another embodiment, the terminal may first determine the serial number range of the reference video frame of the target special effect, extract the video frames with the video frame serial number range in the serial number range from the special effects video to be tested as the video frames matching the reference range of the target special effect, and obtain the test video frames matching the reference time. For example, assuming that the reference range of the target special effect is the 80th to 85th frames, then any one frame from the 80th to 85th frames of the special effects video to be tested may be selected as the test video frame. It is understandable that, in a specific implementation, in order to ensure the accuracy of subsequent comparisons, the terminal may obtain the exact serial number of the reference video frame, and obtain the video frame with the same exact serial number as the reference video frame from the special effects video to be tested as the test video frame matching the reference time.

[0133] Step 414, comparing the inspection video frame that matches the control range with the control video frame to obtain a second comparison result.

[0134] Step 416, obtaining a special effect inspection result of the special effect video according to the first comparison result and the second comparison result.

[0135] Specifically, since the standard video and the special effects video to be tested are obtained by adding the same special effects to the same initial video, and the special effects added to the standard video are consistent with the corresponding effects of the target special effects, then when the special effects function of the terminal is added normally, the test video frame extracted from the control time of the target special effects in the special effects video to be tested, like the reference video extracted from the control time of the target special effects in the standard video, both have no special effects added. Then the terminal can compare the test video frame with the reference video frame, and obtain the special effects test result of the special effects video to be tested based on the comparison result.

[0136] In one embodiment, when comparing the test video frame with the reference video frame, the terminal may compare the similarity between the test video frame and the reference video frame. In other embodiments, when comparing the test video frame with the reference video frame, the terminal may also compare the difference between the test video frame and the reference video frame.

[0137] Finally, the terminal combines the first comparison result with the second comparison result to determine the special effects inspection result of the special effects video, ensuring that the special effects added by the terminal's special effects adding function are consistent with the corresponding effects of the target special effects and the adding time is consistent with the adding time corresponding to the target special effects, that is, the added effect is accurate and the adding time is accurate.

[0138] In the above embodiment, the terminal obtains a control video frame extracted from the standard video, and the control video frame matches the control range of the target special effect in the standard video. The control range of the target special effect is the range before the trigger range of the trigger content in the special effect video. The terminal further extracts a test video frame that matches the control time in the special effect video, and compares the test video frame that matches the control time with the control video frame to obtain a second comparison result. Finally, the first comparison result and the second comparison result are combined to obtain the special effect test result of the special effect video, which can simultaneously test the effect accuracy and time accuracy of the special effect added, thereby further improving the accuracy of the special effect test.

[0139] In one embodiment, the initial video contains trigger content corresponding to the target special effect; the trigger content corresponding to the target special effect includes a target action corresponding to the target object; before obtaining a reference video frame extracted from the standard video, the method also includes: obtaining the time period of occurrence of the target action; and determining a preset time period before the time period of occurrence of the target action as a reference range of the target special effect.

[0140] In this embodiment, the initial video contains trigger content corresponding to the target special effect, and the trigger content corresponding to the target special effect includes the target action corresponding to the target object. Then, the standard video of this embodiment takes effect after the appearance period of the target action, and the video frame before the appearance period of the target action will not present the special effect of the target special effect. Then, for the terminal, when the special effect adding function is normal, it will not present the special effect of the target special effect during the time period when the special effect of the target special effect is not presented in the standard video. Then, the terminal can obtain the appearance period of the target action, and determine a preset time before the appearance period of the target action as the control range of the target special effect.

[0141] It can be understood that in the video frame before the target action's appearance period, the greater the time interval between the video frame and the target action's appearance period, the less likely the video frame is to be mistakenly added with the target special effect. Therefore, when determining the comparison range, a preset time with a time interval as short as possible with the target action's appearance period can be selected. In a specific embodiment, the starting moment of the target action's appearance period can be obtained, the previous moment of the starting moment is determined as the end moment of the comparison range, and a preset time ending with the end moment is determined as the comparison range. For example, assuming that the target action's appearance period is 3.0 seconds to 3.2 seconds, the end moment of the comparison range of the target special effect is 2.9 seconds, and 2.8-2.9 seconds can be determined as the comparison range.

[0142] In other embodiments, after obtaining the occurrence period of the target action, the terminal may also refer to formula (1) in the above embodiment to calculate the video frame number of the starting video frame of the target action, determine the previous number of the video frame number as the end video frame number of the comparison range of the target special effect, and determine the number range ending with the end video frame number as the comparison range. For example, assuming that the occurrence period of the target action is 3.0 seconds to 3.2 seconds, and the video frame rate is 30 frames / second, the video frame number of the starting video frame of the target action can be calculated to be 3*30=90, then the end video frame number of the comparison range of the target special effect is 89, and the 86th frame to the 89th frame can be determined as the comparison range of the target special effect.

[0143] In the above embodiment, the terminal obtains the occurrence period of the target action and determines a preset time before the occurrence period of the target action as the comparison range of the target special effect, so as to accurately and quickly determine the comparison range of the target special effect.

[0144] In one embodiment, comparing the test video frame with the reference video frame to obtain a first comparison result includes: calculating the similarity between the test video frame and the reference video frame; using the calculated similarity as the comparison result between the test video frame and the reference video frame to obtain the first comparison result; obtaining the special effect inspection result of the special effect video according to the first comparison result includes: determining the special effect inspection result of the special effect video according to the size relationship between the similarity and a preset similarity threshold.

[0145] The similarity is used to characterize the similarity between the test video frame and the reference video frame. The greater the similarity, the greater the similarity between the test video frame and the reference video frame, and the greater the possibility that the special effects presented by the test video frame are the same as the special effects presented by the reference video frame.

[0146] Specifically, when the terminal compares the test video frame with the reference video frame, it can calculate the similarity between the test video frame and the reference video frame, use the calculated similarity as the comparison result of the test video frame and the reference video frame, and then compare the obtained similarity with the preset similarity threshold, and determine the special effect test result of the special effect video according to the size relationship between the similarity and the preset similarity threshold. The preset similarity threshold can be preset based on experience.

[0147] In one embodiment, when the similarity between the test video frame and the reference video frame exceeds a preset similarity threshold, it can be determined that the special effects test result of the special effects video is that the special effects addition is normal; conversely, when the similarity between the test video frame and the reference video frame does not exceed the preset similarity threshold, it can be determined that the special effects test result of the special effects video is that the special effects addition is abnormal.

[0148] In another embodiment, considering that normal special effect addition includes not only normal special effect addition effect but also normal special effect addition time, the terminal can also obtain a control video frame extracted from the standard video, wherein the control video frame matches the control range of the target special effect in the standard video, and the control range of the target special effect is before the appearance range of the triggering content in the initial video, and further extracts a test video frame matching the control range in the special effect video, calculates the similarity between the test video frame matching the control range and the control video frame, and determines the special effect test result of the special effect video according to the size relationship between the similarity and a preset similarity threshold, and the size relationship between the similarity between the test video frame matching the effective time and the reference video frame and the preset similarity threshold.

[0149] In a specific embodiment, when the similarity between the test video frame matching the control range and the control video frame, and the similarity between the test video frame matching the effective time and the reference video frame both exceed a preset similarity threshold, it is determined that the special effects of the special effects video are added normally; otherwise, when any one of the similarities between the test video frame matching the control range and the control video frame, and the similarity between the test video frame matching the effective time and the reference video frame does not exceed the preset similarity threshold, it is determined that the special effects of the special effects video are added abnormally.

[0150] In one embodiment, calculating the similarity between a test video frame and a reference video frame includes: obtaining a target initial frame corresponding to a target special effect; updating the pixel value of the test video frame by using the pixel difference between the test video frame and the target initial frame; eliminating the content in the test video frame that is similar to the target initial frame according to the size relationship between the updated pixel value of the test video frame and a preset pixel difference threshold, so as to obtain a difference map corresponding to the test video frame; updating the pixel value of the reference video frame by using the pixel difference between the reference video frame and the target initial frame; eliminating the content in the reference video frame that is similar to the target initial frame according to the size relationship between the updated pixel value of the reference video frame and the preset pixel difference threshold, so as to obtain a difference map corresponding to the reference video frame; determining the similarity between the test video frame and the reference video frame based on the similarity between the difference map corresponding to the test video frame and the difference map corresponding to the reference video frame.

[0151] The target initial frame corresponding to the target special effect refers to a video frame whose content similarity with the video frame with the target special effect added, except for the target special effect, exceeds a preset threshold. In a specific embodiment, the target initial frame corresponding to the target special effect refers to a video frame whose content is exactly the same as the video frame with the target special effect added, except for the target special effect.

[0152] Specifically, the terminal can obtain the target initial frame corresponding to the target special effect from the video frame of the initial video, calculate the pixel difference between the test video frame matching the effective range and the target initial frame, and use the calculated pixel difference to update the pixel value of the test video frame. The obtained pixel value in the test video frame is the updated pixel value. The updated pixel value is obtained by the pixel difference, which can reflect the pixel difference between the test video frame and the target initial frame. Therefore, the updated pixel value can be compared with the preset pixel difference threshold. When a certain updated pixel value exceeds the preset pixel difference threshold, it means that the pixel difference between the pixel and the target initial frame is large, so the pixel can be retained; conversely, when a certain updated pixel value does not exceed the preset pixel difference threshold, it means that the pixel is relatively similar to the pixel of the target initial frame, then the pixel can be used to eliminate the content in the test video frame that is similar to the target initial frame to obtain a difference map corresponding to the test video frame.

[0153] In a specific embodiment, the content in the inspection video frame that is similar to the target initial frame can be eliminated by the following formula (2) to obtain a difference map of the inspection video frame:

[0154]

[0155] in, Represents the (R, G, B) pixel value of the (x, y)th coordinate in the difference map, To check the R (Red) pixel value of the (x, y) coordinate of the video frame, is the R pixel value of the (x, y) coordinate of the target initial frame, To check the G (Rreen) pixel value of the (x, y) coordinate of the video frame, is the G pixel value of the (x, y) coordinate of the target initial frame, To check the B pixel value of the (x,y) coordinate of the video frame, is the B (Blue) pixel value of the (x, y)th coordinate of the target initial frame, and L is the pixel difference threshold, which can be set based on experience, for example, L=20.

[0156] Further, the terminal can calculate the pixel difference between the reference video frame and the target initial frame, and use the calculated pixel difference to update the pixel value of the reference video frame. The pixel value in the obtained reference video frame is the updated pixel value. The updated pixel value is obtained by the pixel difference between the reference video frame and the target initial frame, which can reflect the pixel difference between the reference video frame and the target initial frame. Therefore, the updated pixel value can be compared with the preset pixel difference threshold. When a certain updated pixel value exceeds the preset pixel difference threshold, it means that the pixel difference between the pixel and the target initial frame is large, so the pixel can be retained; conversely, when a certain updated pixel value does not exceed the preset pixel difference threshold, it means that the pixel is similar to the pixel of the target initial frame, so the pixel can be used to eliminate the content similar to the target initial frame in the reference video frame to obtain the difference map corresponding to the reference video frame. It can be understood that at this time, only the image after adding special effects is retained in the difference map obtained.

[0157] It can be understood that, in a specific embodiment, the contents similar to the reference video frame and the target initial frame can be eliminated with reference to the above formula (2) to obtain a difference map of the reference video frame.

[0158] Further, the terminal may determine the similarity between the test video frame and the reference video frame based on the similarity between the difference map corresponding to the test video frame and the difference map corresponding to the reference video frame.

[0159] In the above embodiment, since the content similar to the target initial frame is eliminated in the difference map and only the image after the effect is added is retained, similarity calculation based on the difference map can greatly improve the accuracy and efficiency of the similarity calculation due to the reduction of redundant information.

[0160] In one embodiment, based on the similarity between the difference map corresponding to the test video frame and the difference map corresponding to the reference video frame, determining the similarity between the test video frame and the reference video frame includes: performing a histogram calculation on the difference map corresponding to the test video frame to obtain a first grayscale histogram; performing a histogram calculation on the difference map corresponding to the reference video frame to obtain a second grayscale histogram; for each grayscale value of each color channel, calculating the difference in the number of pixels between the first grayscale histogram and the second grayscale histogram, and calculating the similarity between the first grayscale histogram and the second grayscale histogram based on the calculated difference in the number of pixels; and using the calculated similarity as the similarity between the test video frame and the reference video frame.

[0161] Among them, a histogram is a statistical report graph, which is composed of a series of vertical stripes or line segments of varying heights to represent the distribution of data. Generally, the horizontal axis represents the data type, and the vertical axis represents the distribution. The grayscale histogram in the embodiment of the present application is used to represent the grayscale distribution in a digital image, and plots the number of pixels for each grayscale value in the image. The grayscale value is 0-255.

[0162] Specifically, the terminal performs histogram calculation on the difference graph corresponding to the test video frame, and counts the number of pixels corresponding to each grayscale value in each color channel in the test video frame to obtain the grayscale histogram of each color channel. Then the first grayscale histogram includes three sub-graphs, namely, the histogram corresponding to R, the histogram corresponding to G, and the histogram corresponding to B. The histogram corresponding to R is used to characterize the grayscale distribution of the red channel, the histogram corresponding to G is used to characterize the grayscale distribution of the green channel, and the histogram corresponding to B is used to characterize the grayscale distribution of the blue channel. Figure 5 , which is a histogram of a difference map corresponding to a test video frame in one embodiment.

[0163] The terminal performs a histogram calculation on the difference map corresponding to the reference video frame, counts the number of pixels corresponding to each grayscale value in each color channel in the reference video frame, and obtains the grayscale histogram of each color channel. Then the second grayscale histogram also includes three sub-maps, namely, the histogram corresponding to R, the histogram corresponding to G, and the histogram corresponding to B.

[0164] Further, for each grayscale value of each color channel, the terminal obtains the corresponding number of pixels in the first grayscale histogram and the corresponding number of pixels in the second grayscale histogram, calculates the difference between the two pixel numbers to obtain a pixel number difference, and since the pixel number difference can reflect the difference between the first grayscale histogram and the second grayscale histogram, the terminal can calculate the similarity between the first grayscale histogram and the second grayscale histogram based on the calculated pixel number difference.

[0165] In a specific embodiment, the terminal may calculate the similarity between the first grayscale histogram and the second grayscale histogram according to the following formula (3):

[0166]

[0167] in, Indicates similarity, Represents the nth data of the first grayscale histogram, Represents the nth data of the second grayscale histogram. Since each grayscale histogram includes three sub-graphs and each sub-graph includes 256 data, each grayscale histogram includes 256*3=768 data. Here, each data represents the number of pixels of the current grayscale value of the current color channel in the current histogram, so the value of N is 768.

[0168] Further, after calculating the similarity between the first grayscale histogram and the second grayscale histogram, the terminal uses the similarity as the similarity between the test video frame and the reference video frame.

[0169] In the above embodiment, the grayscale histograms corresponding to the test video frame and the reference video frame are obtained by histogram calculation, and then the similarity between the two histograms is calculated, so that whether the two difference images are similar can be quickly calculated, which is highly efficient.

[0170] In a specific embodiment, a method for testing video special effects is provided, comprising the following steps:

[0171] 1. The terminal obtains an initial video and a standard video containing triggering content of a target special effect, wherein the target special effect includes a first target special effect and a second target special effect, the triggering content of the first target special effect is a target object, and the triggering content of the second target special effect is a target action corresponding to the target object. The initial video and the standard video are generated in the following manner:

[0172] 1-1. Obtain a basic video frame containing a target object, and obtain an action video frame corresponding to a target action, wherein in the action video frame, the target object performs a target action.

[0173] For example, take the target action of "open five fingers" as an example. Fig. 6A As shown in FIG. 1 , it is a schematic diagram of a basic video frame. Figure 6B As shown, it is a schematic diagram of an action video frame. It can be seen that both the basic video frame and the action video frame contain a human body, and the human body performs a target action in the action video frame.

[0174] 1-2. Obtain a video frame rate and a preset duration of an initial video, and determine a total number of frames of the initial video according to the video frame rate and the preset duration of the initial video frame.

[0175] 1-3. Obtain the occurrence time period of the target action, and determine the first target frame number of the action video frame according to the occurrence time period of the target action and the video frame rate.

[0176] 1-4. Obtain the difference between the total number of frames of the initial video and the first target number of frames of the action video frame to obtain the second target number of frames of the basic video frame.

[0177] 1-5. Generate a first target number of video frames as video frames within the target action occurrence period based on the action video frames, and generate a second target number of video frames as video frames outside the target action occurrence period based on the basic video frames to generate initial video frames.

[0178] 1-6. Special effects are added to the initial video frame, a video frame with a target special effect is added, and the added target special effect is manually confirmed to meet the corresponding effect of the target special effect, thereby obtaining a reference video frame.

[0179] 2. The terminal obtains the appearance time period of the target object, and determines the appearance time period of the target object as the effective range of the first target special effect in the standard video.

[0180] It can be understood that in this embodiment, since the initial video is generated based on the basic video frame and the action video frame, and both the basic video frame and the action video frame include the target object, the effective range of the first target special effect is the entire video.

[0181] 3. The terminal obtains the appearance time period of the target action, and determines a preset time after the appearance time period of the target action as the effective range of the target special effect in the standard video.

[0182] The occurrence time period of the target action is known in advance and can be directly obtained by the terminal.

[0183] Specifically, after obtaining the time period of occurrence of the target action, the end unit moment corresponding to the target action is determined according to the time period of occurrence of the target action, the preset duration of the second target special effect is obtained, and a preset time with the next unit moment corresponding to the end unit moment of the target action as the starting moment and the duration matching the preset duration is determined as the effective range of the second target special effect.

[0184] 4. The terminal extracts a video frame that matches the effective range of the second target special effect from the standard video as a reference video frame.

[0185] It can be understood that in this embodiment, since the effective range of the first target special effect is the entire video, the first target special effect is also effective within the effective range of the second target special effect. Therefore, the video frame that matches the effective range of the second target special effect will include the special effects of the first target special effect and the second target special effect, and can be used as a reference video frame for these two special effects.

[0186] For example, Figure 6CAs shown in the figure, it is a video frame that matches the effective range of the first target special effect but does not match the effective range of the second target special effect. The video frame includes the first target special effect, that is, when a face is recognized, a "two rows of hats" pattern is added; in addition, in the video frame that matches the effective range of the second target special effect, the second target special effect is that a pumpkin appears in the palm of the hand when the "five fingers open" action is recognized, and it includes the effect of the first target special effect (two rows of hats) and the effect of the second target special effect (pumpkin in the palm of the hand).

[0187] 5. The terminal detects the video content of the initial video with the target special effect corresponding effect as the expected effect, and when the trigger content corresponding to the target special effect is detected, the terminal adds special effects to the initial video to obtain the special effects video to be tested.

[0188] 6. The terminal extracts a video frame that matches the effective range of the second target special effect from the special effect video as a first inspection video frame.

[0189] 7. The terminal compares the first inspection video frame with the reference video frame to obtain a first comparison result.

[0190] Specifically, the terminal calculates the similarity between the first inspection video frame and the reference video frame as a first comparison result, and the steps are as follows:

[0191] 7-1. Get the target initial frame corresponding to the target special effect.

[0192] 7-2. Update the pixel value of the first inspection video frame by using the pixel difference between the first inspection video frame and the target initial frame.

[0193] 7-3. According to the size relationship between the updated pixel value of the first inspection video frame and the preset pixel difference threshold, the content in the first inspection video frame that is similar to the target initial frame is eliminated to obtain a difference map corresponding to the first inspection video frame.

[0194] 7-4. Update the pixel value of the reference video frame by using the pixel difference between the reference video frame and the target initial frame.

[0195] 7-5. According to the size relationship between the updated pixel value of the reference video frame and the preset pixel difference threshold, the content in the reference video frame that is similar to the target initial frame is eliminated to obtain a difference map corresponding to the reference video frame;

[0196] 7-6. Perform histogram calculation on the difference map corresponding to the first inspection video frame to obtain a first grayscale histogram.

[0197] 7-7. Perform histogram calculation on the difference map corresponding to the reference video frame to obtain a second grayscale histogram.

[0198] 7-8. For each gray value of each color channel, calculate the pixel quantity difference between the first gray histogram and the second gray histogram, and calculate the similarity between the first gray histogram and the second gray histogram based on the calculated pixel quantity difference.

[0199] 7-9. The calculated similarity is used as the similarity between the first test video frame and the reference video frame.

[0200] 8. The terminal obtains the starting time of the target action occurrence period, determines the previous time of the starting time as the end time, and determines a preset time ending with the end time as the comparison range of the second target special effect in the standard video.

[0201] 9. The terminal extracts a video frame that matches the comparison range of the second target special effect from the standard video to obtain a comparison video frame.

[0202] 10. The terminal extracts a video frame that matches the comparison range of the second target special effect from the special effect video to obtain a second inspection video frame.

[0203] 11. The terminal compares the control video frame with the second test video frame to obtain a second comparison result.

[0204] Specifically, the terminal may refer to steps 7-1 to 7-9 above to calculate the similarity between the reference video frame and the second test video frame as the second comparison result.

[0205] 12. When the first comparison result exceeds the similarity threshold and the second comparison result exceeds the similarity threshold, it is determined that the special effects of the special effects video are added normally; otherwise, when at least one of the first comparison result and the second comparison result does not exceed the similarity threshold, it is determined that the special effects of the special effects video are added abnormally.

[0206] The present application also provides an application scenario, and the application scenario applies the above-mentioned video special effects inspection method. Specifically, the application of the video special effects inspection method in the application scenario is as follows:

[0207] In this application scenario, a video editing APP is set on the terminal. The video editing APP can add multiple target special effects. One of the target special effects is to add "rabbit ears" when a face is recognized, such as Fig. 7A As shown; when a blinking action is detected, the "heart" animation effect will be triggered, such as Figure 7B The terminal performs the following steps at a preset time every day (for example, nine o'clock) to check whether the APP can normally add the target special effect:

[0208] 1. Obtain the initial video and the standard video through the APP. The generation of the initial video and the acquisition of the standard video can refer to the description of the above embodiment, and this application will not repeat them here.

[0209] It should be noted that in this application scenario, it is known that the initial video duration is 10 seconds, the video frame rate is 30 frames per second, and the basic video frames used in generating the initial video frames are as follows: Fig. 6A As shown, the action video frame is Fig. 8A As shown, the blinking occurs from 3.0 seconds to 3.2 seconds in the initial video, that is, the blinking action is completed at 3.2 seconds. Then in the standard video, the "heart" animation effect will be triggered from 3.3 seconds.

[0210] 2. Use the APP to add special effects to the initial video with the target special effect corresponding effect as the expected effect, and obtain the special effects video to be tested.

[0211] 3. Extract the 3.3-second frame, i.e. the 99th frame, from the standard video and special effects video respectively to conduct “comparison after adding effects”.

[0212] It should be noted that the specific comparison method is the same for the above two moments, and the following only takes "comparison after adding effects" as an example for explanation.

[0213] 4. Subtract the 99th frame from the base video frame in the standard video and special effect video. When the difference is greater than the preset threshold, the pixel is retained. When the difference is less than the preset threshold, the pixel value is set to 0, thus obtaining a "difference map" with only added effects, such as Figure 7C As shown, it can be seen that there are only rabbit ears and hearts in the picture.

[0214] 5. Perform histogram calculation on the difference graphs corresponding to the 99th frame in the standard video and the special effect video respectively to obtain their respective corresponding histograms. The specific calculation method is described in the above embodiment, and this application will not repeat it here.

[0215] 6. Calculate the similarity of the two calculated histograms. When the similarity is greater than a preset threshold, it means that the special effects in the special effects video are consistent with those in the standard video, that is, the special effects are normal.

[0216] 7. Extract the 2.9th second, i.e. 2.9*30=87th frame, from the standard video and the special effects video respectively to perform "comparison before adding effects". When the similarity obtained from the "comparison before adding effects" is also greater than the preset threshold, it means that the time of adding the effect is accurate, that is, the APP can correctly identify the blinking action and add the heart animation triggered by the blinking animation at the correct time, which means that the special effects adding function of the APP for this target special effect is normal.

[0217] It should be understood that although Figure 2-4The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-4 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0218] In one embodiment, Figure 8 As shown, a video special effect inspection device 800 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:

[0219] The reference video frame acquisition module 802 is used to acquire a reference video frame extracted from a standard video that meets the corresponding effect of the target special effect; the standard video is obtained by adding the target special effect to the initial video; the reference video frame matches the effective range of the target special effect in the standard video;

[0220] The special effect adding processing module 804 is used to perform special effect adding processing on the initial video with the target special effect corresponding effect as the expected effect, so as to obtain the special effect video to be tested;

[0221] A test video frame extraction module 806 is used to extract a test video frame matching the effective range in the special effect video;

[0222] The comparison module 808 is used to compare the inspection video frame with the reference video frame to obtain a first comparison result, and obtain a special effect inspection result of the special effect video according to the first comparison result.

[0223] The above-mentioned video special effect inspection device obtains a reference video frame extracted from a standard video that meets the target special effect corresponding effect. Since the standard video is obtained by adding the target special effect to the initial video, and the reference video frame matches the effective range of the target special effect, the reference video frame can accurately present the special effect corresponding to the target special effect. The terminal further takes the target special effect corresponding effect as the expected effect, adds special effects to the initial video, obtains the special effect video to be inspected, and extracts the inspection video frame that matches the effective range in the special effect video. When the special effect function of the terminal is normal, the extracted inspection video frame can accurately present the special effect corresponding to the target special effect. Therefore, the inspection video frame and the reference video frame can be compared to obtain a first comparison result, and the special effect inspection result of the special effect video is obtained according to the first comparison result, thereby realizing the automatic inspection of the special effect adding function. Compared with the related technology of inspecting whether the special effect function is normal from the implementation code level of the special effect function, the automatic inspection method is not only more efficient, but also will not be restricted by the technical level of the code analyst, and has higher accuracy.

[0224] In one embodiment, the special effects adding processing module is also used to detect the video content of the initial video with the target special effect corresponding effect as the expected effect, and when the trigger content corresponding to the target special effect is detected, the special effects adding processing is performed on the initial video to obtain the special effects video to be tested.

[0225] In one embodiment, the trigger content corresponding to the target special effect includes a target object; the above-mentioned device also includes: an effective range determination module, which is used to obtain the appearance time period of the target object; and determine the appearance time period of the target object as the effective range of the target special effect.

[0226] In one embodiment, the trigger content corresponding to the target special effect includes the target action corresponding to the target object; the effective range determination module is also used to obtain the occurrence time period of the target action; and determine a preset time after the occurrence time period of the target action as the effective range of the target special effect.

[0227] In one embodiment, the target action includes the target facial movement of the target object; the effective range determination module is also used to obtain the appearance time period of the target facial movement; determine the end unit moment corresponding to the target facial movement according to the appearance time period of the target facial movement; obtain the preset duration of the target special effect; and determine a preset time with the next unit moment of the end unit moment corresponding to the target facial movement as the starting moment and the duration matching the preset duration as the effective range of the target special effect.

[0228] In one embodiment, the trigger content corresponding to the target special effect includes the target limb movement corresponding to the target object; the effective range determination module is also used to obtain the occurrence time period of the target limb movement and obtain the video frame rate of the initial video; determine the frame number of the end video frame of the target limb movement according to the occurrence time period of the target limb movement and the video frame rate of the initial video frame; determine the frame number of the next video frame according to the frame number of the end video frame of the target limb movement, and obtain the starting frame number of the target special effect; obtain the preset duration of the target special effect, and determine the number of video frames of the target special effect according to the preset duration and the video frame rate of the initial video frame; determine the video frame number range of the target special effect according to the starting frame number of the target special effect and the number of video frames of the target special effect, and use the video frame number range of the target special effect as the effective range of the target special effect.

[0229] In one embodiment, the trigger content corresponding to the target special effect includes a target action corresponding to the target object; the above-mentioned device also includes: an initial video generation module, used to obtain a basic video frame containing the target object; obtain an action video frame corresponding to the target action; in the action video frame, the target object performs the target action; and generate an initial video based on the basic video frame and the action video frame.

[0230] In one embodiment, the initial video generation module is also used to obtain the video frame rate and preset duration of the initial video, determine the total number of frames of the initial video according to the video frame rate and preset duration of the initial video frame; obtain the time period of occurrence of the target action, and determine the first target number of frames of the action video frame according to the time period of occurrence of the target action and the video frame rate; obtain the difference between the total number of frames of the initial video and the first target number of frames of the action video frame, and obtain the second target number of frames of the basic video frame; generate video frames of the first target number of frames according to the action video frame as video frames within the time period of occurrence of the target action, and generate video frames of the second target number of frames according to the basic video frame as video frames outside the time period of occurrence of the target action, so as to generate the initial video frame.

[0231] In one embodiment, the above-mentioned device also includes: a comparison module, which is used to obtain a comparison video frame extracted from a standard video; the comparison video frame matches the comparison range of the target special effect in the standard video; the comparison range of the target special effect is before the appearance range of the triggering content in the initial video; extracting a test video frame matching the comparison range in the special effect video; comparing the test video frame matching the comparison range with the control video frame to obtain a second comparison result; the comparison module is also used to obtain a special effect verification result of the special effect video based on the first comparison result and the second comparison result.

[0232] In one embodiment, the initial video contains trigger content corresponding to the target special effect; the trigger content corresponding to the target special effect includes a target action corresponding to the target object; the above-mentioned device also includes: a reference time determination module, used to obtain the occurrence time period of the target action; and determine a preset time before the occurrence time period of the target action as the reference range of the target special effect.

[0233] In one embodiment, the comparison module is also used to calculate the similarity between the test video frame and the reference video frame; the calculated similarity is used as the comparison result of the test video frame and the reference video frame to obtain a first comparison result; and the special effects inspection result of the special effects video is obtained according to the first comparison result, including: determining the special effects inspection result of the special effects video according to the size relationship between the similarity and a preset similarity threshold.

[0234] In one embodiment, the comparison module is also used to obtain a target initial frame corresponding to a target special effect; update the pixel value of the test video frame by using the pixel difference between the test video frame and the target initial frame; eliminate the content in the test video frame that is similar to the target initial frame based on the size relationship between the updated pixel value of the test video frame and a preset pixel difference threshold, so as to obtain a difference map corresponding to the test video frame; update the pixel value of the reference video frame by using the pixel difference between the reference video frame and the target initial frame; eliminate the content in the reference video frame that is similar to the target initial frame based on the size relationship between the updated pixel value of the reference video frame and a preset pixel difference threshold, so as to obtain a difference map corresponding to the reference video frame; determine the similarity between the test video frame and the reference video frame based on the similarity between the difference map corresponding to the test video frame and the difference map corresponding to the reference video frame.

[0235] In one embodiment, the comparison module is also used to perform histogram calculation on the difference map corresponding to the test video frame to obtain a first grayscale histogram; perform histogram calculation on the difference map corresponding to the reference video frame to obtain a second grayscale histogram; for each grayscale level of each color channel, calculate the difference in the number of pixels between the first grayscale histogram and the second grayscale histogram, and calculate the similarity between the first grayscale histogram and the second grayscale histogram based on the calculated difference in the number of pixels; and use the calculated similarity as the similarity between the test video frame and the reference video frame.

[0236] For the specific definition of the video special effects inspection device, please refer to the definition of the video special effects inspection method above, which will not be repeated here. Each module in the above-mentioned video special effects inspection device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0237] 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. 9 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system 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 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 achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for testing video special effects is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse, etc.

[0238] Those skilled in the art will understand that Fig. 9 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.

[0239] 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.

[0240] 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.

[0241] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-mentioned method embodiments.

[0242] 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), 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).

[0243] The technical features of the above embodiments may be combined arbitrarily. 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.

[0244] 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 method for testing video special effects, characterized in that: The method comprises: Obtaining a reference video frame extracted from a standard video that meets the corresponding effect of the target special effect; The standard video is obtained by adding the target special effect to the initial video; the reference video frame matches the effective range of the target special effect in the standard video; Taking the target special effect corresponding effect as the expected effect, performing special effect adding processing on the initial video to obtain the special effect video to be tested; Extracting a test video frame in the special effect video that matches the effective range; Comparing the inspection video frame with the reference video frame to obtain a first comparison result; Acquire a reference video frame extracted from the standard video; The reference video frame matches the reference range of the target special effect in the standard video; the reference range of the target special effect is before the appearance range of the triggering content in the initial video; Extracting a test video frame in the special effects video that matches the control range; Comparing the inspection video frame matching the control range with the control video frame to obtain a second comparison result; A special effects inspection result of the special effects video is obtained according to the first comparison result and the second comparison result.

2. The method according to claim 1, characterized in that The step of taking the target special effect corresponding effect as the expected effect, performing special effect adding processing on the initial video, and obtaining the special effect video to be tested comprises: The target special effect corresponding effect is taken as the expected effect, the video content of the initial video is detected, and when the trigger content corresponding to the target special effect is detected, the initial video is processed by adding special effects to obtain the special effects video to be tested.

3. The method according to claim 2, characterized in that The trigger content corresponding to the target special effect includes a target object; and the step of determining the effective range of the target special effect includes: Obtaining the appearance time period of the target object; The appearance period of the target object is determined as the effective range of the target special effect.

4. The method according to claim 2, characterized in that: The trigger content corresponding to the target special effect includes the target action corresponding to the target object; The step of determining the effective range of the target special effect includes: Obtaining the occurrence time period of the target action; A preset period of time after the occurrence period of the target action is determined as the effective range of the target special effect.

5. The method according to claim 4, characterized in that The target action includes the target facial features of the target object; and the acquisition of the occurrence period of the target action includes: Obtaining the occurrence time period of the target facial feature action; The step of determining a preset period of time after the occurrence period of the target action as the effective range of the target special effect includes: Determining the end unit time corresponding to the target facial feature action according to the occurrence period of the target facial feature action; Obtaining the preset duration of the target special effect; A preset time period with the next unit moment of the last unit moment corresponding to the target facial feature movement as the starting moment and a duration matching the preset duration is determined as the effective range of the target special effect.

6. The method according to claim 2, characterized in that The trigger content corresponding to the target special effect includes the target body movement corresponding to the target object; The step of determining the effective range of the target special effect includes: Obtaining the occurrence time period of the target limb movement and obtaining the video frame rate of the initial video; Determine the frame number of the last video frame of the target limb movement according to the appearance period of the target limb movement and the video frame rate of the initial video; Determine the frame number of the next video frame according to the frame number of the end video frame of the target limb action, and obtain the starting frame number of the target special effect; Obtaining a preset duration of the target special effect, and determining the number of video frames of the target special effect according to the preset duration and the video frame rate of the initial video; The video frame number range of the target special effect is determined according to the starting frame number of the target special effect and the number of video frames of the target special effect, and the video frame number range of the target special effect is used as the effective range of the target special effect.

7. The method according to claim 2, characterized in that The trigger content corresponding to the target special effect includes a target action corresponding to the target object; and the steps of generating the initial video include: Acquire a basic video frame containing the target object; Acquire an action video frame corresponding to the target action; in the action video frame, the target object performs the target action; The initial video is generated according to the basic video frame and the action video frame.

8. The method according to claim 7, characterized in that The generating the initial video according to the basic video frame and the action video frame comprises: Obtaining a video frame rate and a preset duration of the initial video, and determining a total number of frames of the initial video according to the video frame rate and the preset duration of the initial video; Acquire the occurrence time period of the target action, and determine a first target frame number of the action video frame according to the occurrence time period of the target action and the video frame rate; Obtaining a difference between the total number of frames of the initial video and the first target number of frames of the action video frame to obtain a second target number of frames of the basic video frame; A first target number of video frames is generated according to the action video frames as video frames within the target action occurrence period, and a second target number of video frames is generated according to the basic video frames as video frames outside the target action occurrence period to generate the initial video.

9. The method according to claim 1, characterized in that: The initial video contains triggering content corresponding to the target special effect; the triggering content corresponding to the target special effect includes a target action corresponding to the target object; Before acquiring the reference video frame extracted from the standard video, the method further comprises: Obtaining the occurrence time period of the target action; A preset period of time before the occurrence period of the target action is determined as a comparison range of the target special effect.

10. The method according to claim 1, characterized in that The comparing the inspection video frame with the reference video frame to obtain a first comparison result comprises: Calculating the similarity between the test video frame and the reference video frame; The calculated similarity is used as a comparison result between the inspection video frame and the reference video frame to obtain a first comparison result; The special effects inspection result of the special effects video obtained according to the first comparison result includes: The special effect inspection result of the special effect video is determined according to the magnitude relationship between the similarity and a preset similarity threshold.

11. The method according to claim 10, characterized in that The calculating the similarity between the inspection video frame and the reference video frame comprises: Obtaining a target initial frame corresponding to the target special effect; Updating the pixel value of the inspection video frame by using the pixel difference between the inspection video frame and the target initial frame; According to the size relationship between the updated pixel value of the inspection video frame and the preset pixel difference threshold, the content in the inspection video frame that is similar to the target initial frame is eliminated to obtain a difference map corresponding to the inspection video frame; Updating the pixel value of the reference video frame by using the pixel difference between the reference video frame and the target initial frame; Eliminating content in the reference video frame that is similar to the target initial frame according to a magnitude relationship between an updated pixel value of the reference video frame and the preset pixel difference threshold, so as to obtain a difference map corresponding to the reference video frame; Based on the similarity between the difference map corresponding to the test video frame and the difference map corresponding to the reference video frame, the similarity between the test video frame and the reference video frame is determined.

12. The method according to claim 11, characterized in that The determining the similarity between the test video frame and the reference video frame based on the similarity between the difference map corresponding to the test video frame and the difference map corresponding to the reference video frame comprises: Performing histogram calculation on the difference map corresponding to the inspection video frame to obtain a first grayscale histogram; Performing histogram calculation on the difference map corresponding to the reference video frame to obtain a second grayscale histogram; For each gray value of each color channel, calculating a pixel quantity difference between the first gray histogram and the second gray histogram, and calculating a similarity between the first gray histogram and the second gray histogram based on the calculated pixel quantity difference; The calculated similarity is used as the similarity between the inspection video frame and the reference video frame.

13. A video special effect testing device, characterized in that: The device comprises: A reference video frame acquisition module is used to acquire a reference video frame extracted from a standard video that meets the corresponding effect of the target special effect; the standard video is obtained by adding the target special effect to the initial video; the reference video frame matches the effective range of the target special effect in the standard video; A special effect adding processing module, used to perform special effect adding processing on the initial video with the target special effect corresponding effect as the expected effect, so as to obtain the special effect video to be tested; A test video frame extraction module, used to extract a test video frame matching the effective range in the special effect video; A comparison module, used for comparing the inspection video frame with the reference video frame to obtain a first comparison result; A comparison module is used to obtain a comparison video frame extracted from the standard video; the comparison video frame matches the comparison range of the target special effect in the standard video; the comparison range of the target special effect is before the appearance range of the trigger content in the initial video; extract a test video frame matching the comparison range in the special effect video; compare the test video frame matching the comparison range with the comparison video frame to obtain a second comparison result; The comparison module is also used to obtain a special effect inspection result of the special effect video according to the first comparison result and the second comparison result.

14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: 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.

Citation Information

Patent Citations

  • Automatic test method for video synthesis correctness

    CN111432205A