CN112637674A - Video transition effect processing method and device, electronic equipment and storage medium - Google Patents

Video transition effect processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112637674A
CN112637674A CN202011464688.0A CN202011464688A CN112637674A CN 112637674 A CN112637674 A CN 112637674A CN 202011464688 A CN202011464688 A CN 202011464688A CN 112637674 A CN112637674 A CN 112637674A
Authority
CN
China
Prior art keywords
background
target
information
similarity
transition effect
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011464688.0A
Other languages
Chinese (zh)
Other versions
CN112637674B (en
Inventor
曹晖
张范容
欧阳勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Jiyuan Digital Technology Development Co ltd
Original Assignee
Shenzhen Jiyuan Digital Technology Development Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Jiyuan Digital Technology Development Co ltd filed Critical Shenzhen Jiyuan Digital Technology Development Co ltd
Priority to CN202011464688.0A priority Critical patent/CN112637674B/en
Publication of CN112637674A publication Critical patent/CN112637674A/en
Application granted granted Critical
Publication of CN112637674B publication Critical patent/CN112637674B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44016Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving splicing one content stream with another content stream, e.g. for substituting a video clip
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/23424Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving splicing one content stream with another content stream, e.g. for inserting or substituting an advertisement
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/25Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
    • H04N21/262Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • H04N5/91Television signal processing therefor
    • H04N5/915Television signal processing therefor for field- or frame-skip recording or reproducing

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Databases & Information Systems (AREA)
  • Image Analysis (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The embodiment of the invention provides a method and a device for processing a video transition effect, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a video to be processed; performing target detection and background detection on two adjacent frames of images in the video to be processed to obtain first target information and first background information of a current frame and second target information and second background information of a previous frame; calculating the target similarity of the first target information and the second target information, and judging whether the target similarity is smaller than a preset target similarity threshold value; if the target similarity is smaller than the preset similarity threshold, generating or matching a corresponding transition effect frame according to the first background information and the second background information; and inserting the transition effect frame between the current frame and the previous frame to obtain a target video. According to the invention, the transition effect does not need to be added manually, and the adding efficiency of the transition effect is improved.

Description

Video transition effect processing method and device, electronic equipment and storage medium
Technical Field
The invention relates to the field of artificial intelligence, in particular to a method and a device for processing a video transition effect, electronic equipment and a storage medium.
Background
With the popularization of computer technology and the development of self-media, people can create content which they want to express through videos, and in order to enable the video content to express the intention of the creator simply, the videos are required to be edited. In the video clip, video streams in different time periods need to be cut and spliced, further, in the video splicing process, two videos which are not continuous in time can be directly spliced, and if the two videos are directly spliced, a transition is abrupt, so that the video watching experience is reduced, and therefore, a certain transition effect can be added when the videos are spliced. However, the existing transition effect requires the video creator to make or find the template and then add the template between two videos, which is complex and not friendly to the creator who just contacts the video creation. Therefore, the conventional video clip has a problem that the transition effect addition efficiency is low.
Disclosure of Invention
The embodiment of the invention provides a processing method of a video transition effect, which can intelligently add the video transition effect, reduce the workload of manually adding transition and improve the adding efficiency of the transition effect.
In a first aspect, an embodiment of the present invention provides a method for processing a video transition effect, where the method includes:
acquiring a video to be processed;
performing target detection and background detection on two adjacent frames of images in the video to be processed to obtain first target information and first background information of a current frame and second target information and second background information of a previous frame;
calculating the target similarity of the first target information and the second target information, and judging whether the target similarity is smaller than a preset target similarity threshold value;
if the target similarity is smaller than the preset similarity threshold, generating or matching a corresponding transition effect frame according to the first background information and the second background information;
and inserting the transition effect frame between the current frame and the previous frame to obtain a target video.
Optionally, the method further includes:
if the target similarity is greater than or equal to the preset similarity threshold, calculating the background similarity between the first background information and the second background information, and judging whether the background similarity is smaller than the preset first background similarity threshold;
and if the background similarity is smaller than the preset first background similarity threshold, generating a corresponding transition effect frame according to the first background information and the second background information.
Optionally, if the background similarity is smaller than the preset first background similarity threshold, generating a corresponding transition effect frame according to the first background information and the second background information, including:
if the background similarity is smaller than the preset first background similarity threshold, generating N frames of background intermediate frames by taking the second background information as a background head frame and the first background information as a background tail frame;
and generating a background transition effect frame according to the background head frame, the background tail frame and the background intermediate frame.
Optionally, before generating a background transition effect frame according to the background head frame, the background tail frame, and the background intermediate frame, if the background similarity is smaller than the preset first background similarity threshold, generating a corresponding transition effect frame according to the first background information and the second background information, further including:
calculating motion information of a target corresponding to N frames according to the first target information and the second target information;
and correspondingly fusing the target into the N frames of background intermediate frames according to the motion information of the N frames.
Optionally, if the target similarity is smaller than the preset similarity threshold, generating or matching a corresponding transition effect frame according to the first background information and the second background information, including:
if the target similarity is smaller than the preset similarity threshold, calculating the background similarity between the first background information and the second background information, and judging whether the background similarity is smaller than a preset second background similarity threshold;
if the background similarity is smaller than the preset second background similarity threshold, matching a corresponding transition effect frame according to the first background information and the second background information;
and if the background similarity is greater than or equal to the preset second background similarity threshold, generating a corresponding transition effect frame according to the first background information and the second background information.
Optionally, if the background similarity is smaller than the preset second background similarity threshold, matching a corresponding transition effect frame according to the first background information and the second background information, including:
splicing the first background information and the second background information to obtain third background information;
extracting the features of the third background information to obtain background features;
acquiring transition characteristics of the transition effect frame, wherein the transition characteristics are stored in a transition database and are obtained by extracting the characteristics of the transition effect frame;
and calculating the feature similarity of the background features and the transition features, and taking a transition effect frame corresponding to the transition features with high feature similarity as a matching result.
Optionally, if the background similarity is greater than or equal to the preset second background similarity threshold, generating a corresponding transition effect frame according to the first background information and the second background information, including:
and if the background similarity is greater than or equal to the preset second background similarity threshold, fusing the first background information and the second background information to obtain a corresponding transition effect frame.
In a second aspect, an embodiment of the present invention further provides an apparatus for processing a video transition effect, where the apparatus includes:
the acquisition module is used for acquiring a video to be processed;
the detection module is used for carrying out target detection and background detection on two adjacent frames of images in the video to be processed to obtain first target information and first background information of a current frame and second target information and second background information of a previous frame;
the first calculation module is used for calculating the target similarity of the first target information and the second target information and judging whether the target similarity is smaller than a preset target similarity threshold value or not;
the first processing module is used for generating or matching a corresponding transition effect frame according to the first background information and the second background information if the target similarity is smaller than the preset similarity threshold;
and the inserting module is used for inserting the transition effect frame between the current frame and the previous frame to obtain a target video.
In a third aspect, an embodiment of the present invention provides an electronic device, including: the invention further provides a method for processing video transition effects, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program to realize the steps in the method for processing video transition effects according to any one of the embodiments of the invention.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements the steps in the processing method for video transition effect provided by the embodiment of the present invention.
In the embodiment of the invention, a video to be processed is obtained; performing target detection and background detection on two adjacent frames of images in the video to be processed to obtain first target information and first background information of a current frame and second target information and second background information of a previous frame; calculating the target similarity of the first target information and the second target information, and judging whether the target similarity is smaller than a preset target similarity threshold value; if the target similarity is smaller than the preset similarity threshold, generating or matching a corresponding transition effect frame according to the first background information and the second background information; and inserting the transition effect frame between the current frame and the previous frame to obtain a target video. Whether transition occurs or not can be automatically judged by carrying out target detection and background detection on two adjacent frames of images in a video to be processed, and corresponding transition effect frames are automatically generated or matched to insert under the condition that transition occurs, so that the transition effect does not need to be artificially added, and the transition effect adding efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method for processing a video transition effect according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a device for processing a video transition effect according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart of a method for processing a video transition effect according to an embodiment of the present invention, as shown in fig. 1, including the following steps:
101. and acquiring a video to be processed.
In the embodiment of the present invention, the to-be-processed video may be a video uploaded by a user, and further, the to-be-processed video may be a video obtained by directly splicing multiple segments of videos.
It should be noted that the video to be processed includes multiple frames of images, and the multiple frames of images are sorted in time sequence.
102. And performing target detection and background detection on two adjacent frames of images in the video to be processed to obtain first target information and first background information of the current frame and second target information and second background information of the previous frame.
In the embodiment of the present invention, the target detection may be performed by a convolutional neural network having a target detection function, and the background detection may be obtained based on a target detection process, for example, when the target detection is performed, target information is detected, and image information except the target information in a frame image is background information.
The target information refers to a target image, and the target can be determined according to a video type, for example, when the video type is a content type such as life, work, travel and the like of people, the target can be an image of people; when the video type is a content type such as pet life, feeding and the like, the target can be an image of the pet; when the video type is the content type of vehicle exhibition, evaluation and the like, the target can be the image of the vehicle; when the video type is a content type such as article use display, evaluation and the like, the target can be an image of the article.
Further, the convolutional neural network may be trained to detect multiple types of objects, for example, the convolutional neural network may be trained to detect the detection of multiple types of objects such as people, pets, cars, and objects. Specifically, training data sets of multiple types of targets can be prepared, and the same convolutional neural network is trained to obtain a trained neural network by detecting multiple types of targets.
In a possible embodiment, the context information may also be detected by a separate context detection network. Specifically, the dynamic background reconstruction may be performed according to gaussian distribution to obtain a distribution situation with static pixel points, and further obtain background information. In the dynamic background reconstruction, continuous frame images are required to be used as samples, in the continuous frame images, the change of the corresponding value of the pixel point is small and is considered as a static pixel point, the change of the corresponding value of the pixel point is large and is considered as a dynamic pixel point, the dynamic pixel point can further represent a moving target, and the static pixel point can further represent a static background. In this way, complete background information can be obtained by dynamic background reconstruction.
The first object information may be further understood as a first object image, and the second object information may be further understood as a second object image. Whether the video is a splicing position or not can be judged by comparing the first target image with the second target image, and whether the video is a transition effect adding position or not is judged.
103. And calculating the target similarity of the first target information and the second target information, and judging whether the target similarity is smaller than a preset target similarity threshold value.
In the embodiment of the present invention, the target similarity between the first target information and the second target information may be a similarity between the first target image and the second target image, and the target similarity between the first target information and the second target information is determined by calculating the similarity between the first target image and the second target image.
The greater the similarity between the objects, the more similar the first object information and the second object information, and the smaller the similarity between the objects, the more different the first object information and the second object information.
When the similarity of the objects is large to a certain degree, the first object information and the second object information are information corresponding to the same object. Therefore, in the embodiment of the present invention, a target similarity threshold may be preset, and when the target similarity is greater than or equal to the preset target similarity threshold, it may be stated that the first target information and the second target information are the same target, and further, it may be stated that the target does not make a transition. When the target similarity is smaller than the preset target similarity threshold, the first target information is different from the second target information, and further the target is transitioned.
In a possible embodiment, the first target information includes one or more target images, the second target information also includes one or more target images, for example, the first target information includes person a, item a, and pet a, the second target information includes person a and item B, and the target similarity is
104. And if the target similarity is smaller than a preset target similarity threshold, generating or matching a corresponding transition effect frame according to the first background information and the second background information.
In the embodiment of the present invention, if the target similarity is smaller than the preset target similarity threshold, it indicates that the first target information is different from the second target information, and further indicates that the target has a transition, that is, the previous frame and the current frame belong to two different front and rear video segments, respectively, and a transition effect needs to be inserted.
The transition effect frame may be performed in a transition effect library, in which a plurality of transition effect frames are stored, and the transition effect frame may be one or more frames. The transition effect frames in the transition effect library may also be referred to as transition effect templates. Specifically, the corresponding transition effect frame may be matched in the transition effect library according to the first background information and the second background information.
The transition effect frame may also be generated automatically, and specifically may be generated according to the first background information and the second background information. The generated transition effect frame can be stored in a transition effect library for convenient multiplexing.
105. And inserting the transition effect frame between the current frame and the previous frame to obtain the target video.
In the embodiment of the invention, the transition effect frame is generated or matched according to the first background information and the second background information, so that the transition effect is more natural. The transition effect frame is inserted between the current frame and the previous frame, so that the target video is smoother in appearance.
In the embodiment of the invention, a video to be processed is obtained; performing target detection and background detection on two adjacent frames of images in the video to be processed to obtain first target information and first background information of a current frame and second target information and second background information of a previous frame; calculating the target similarity of the first target information and the second target information, and judging whether the target similarity is smaller than a preset target similarity threshold value; if the target similarity is smaller than the preset similarity threshold, generating or matching a corresponding transition effect frame according to the first background information and the second background information; and inserting the transition effect frame between the current frame and the previous frame to obtain a target video. Whether transition occurs or not can be automatically judged by carrying out target detection and background detection on two adjacent frames of images in a video to be processed, and corresponding transition effect frames are automatically generated or matched for insertion under the condition of transition, so that the transition effect does not need to be artificially added.
It should be noted that the method for processing a video transition effect provided by the embodiment of the present invention may be applied to a device such as a mobile phone, a computer, or a server, which can perform processing of the video transition effect.
Optionally, after step 103, if the target similarity is greater than or equal to the preset target similarity threshold, the background similarity between the first background information and the second background information may be calculated, and it is determined whether the background similarity is smaller than the preset first background similarity threshold. And if the background similarity is smaller than the preset first background similarity threshold, generating a corresponding transition effect frame according to the first background information and the second background information.
The first background information may be further understood as a first background image, and the second background information may be further understood as a second background image. Whether the video is a splicing position or not can be judged by comparing the first background image with the second background image, and whether the video is a transition effect adding position or not is further judged. Specifically, because the first background information and the second background information are background images of two adjacent frames of images, if the first background information is not similar to the second background information, it is indicated that the two adjacent frames of images belong to videos with two different backgrounds, and a transition effect frame needs to be inserted. The first background similarity threshold is used when the target similarity is greater than or equal to a preset target similarity threshold, that is, the first background similarity threshold is used for determining whether a background transition occurs in the same target.
It can be understood that, when the background similarity is greater than or equal to the first background similarity threshold, it indicates that two adjacent frames of images (which may be understood as a current frame and a previous frame) have the same or similar target, and the same or similar background does not constitute a transition; when the background similarity is smaller than the first background similarity threshold, it indicates that two adjacent frames of images have the same or similar target, but do not have the same background, and it can be considered that background transition occurs, and the two adjacent frames of images are two segments of videos with different backgrounds and the same target, and the two segments of videos can be transitioned.
Optionally, if the background similarity is smaller than a preset first background similarity threshold, generating N frames of background intermediate frames by using the second background information as a background head frame and the first background information as a background tail frame; and generating a background transition effect frame according to the background head frame, the background tail frame and the background intermediate frame.
In this embodiment of the present invention, the second background information is background information of a previous frame, the first background information is background information of a current frame, and in order to make a transition effect natural, the second background information may be used as a background head frame, and the first background information is used as a background tail frame, so that the previous frame in the video may naturally transition to the current frame through the transition effect, thereby making transition of two sections of video more natural. The N frames of background intermediate frames may be referred to by an intermediate interpolation method, for example, if a background pixel point of a previous frame is 10, a background pixel point corresponding to a current frame is 100, and the N is 8, the background pixel point corresponding to the background intermediate frame may be 20, 30, 40, 50, 60, 70, 80, 90, or the like.
Optionally, before generating the background transition effect frame according to the background head frame, the background tail frame, and the background intermediate frame, motion information of the target corresponding to the N frames may be calculated according to the first target information and the second target information; and correspondingly fusing the target into N frames of background intermediate frames according to the motion information of the N frames. The motion information refers to how many pixel points the target moves from the previous frame to the current frame, namely, the distance from the previous position to the current position of the target, the target displacement in each frame in the N frames is calculated according to the distance, the position of the target in the background intermediate frame is further determined, and then the target and the corresponding background intermediate frame are fused. Thus, the transition effect can be more naturally transited.
Optionally, if the target similarity is smaller than a preset similarity threshold, calculating a background similarity between the first background information and the second background information, and determining whether the background similarity is smaller than the preset second background similarity threshold; if the background similarity is smaller than a preset second background similarity threshold, matching the corresponding transition effect frame according to the first background information and the second background information; and if the background similarity is greater than or equal to a preset second background similarity threshold, generating a corresponding transition effect frame according to the first background information and the second background information.
In the embodiment of the present invention, if the target similarity is smaller than the preset target similarity threshold, it indicates that two adjacent frames belong to two different segments of videos, respectively, and the first background information may be further understood as a first background image, and the second background information may be further understood as a second background image. Whether the background transition exists in the video transition can be judged by comparing the first background image with the second background image. Specifically, under the condition that the first target information is not similar to the second target information, it may be determined that the transition position is between the previous frame and the current frame, and since the first background information and the second background information are background images of two adjacent frames of images, if the first background information is not similar to the second background information, it is indicated that the two adjacent frames of images respectively belong to videos of two different backgrounds and different targets, and the difference between the two videos is large. The second background similarity threshold is used for the situation that the target similarity is smaller than a preset target similarity threshold, namely the second background similarity threshold is used for judging the difference degree of two videos under different targets, and when the difference degree of the two videos is larger, the difficulty is higher for generating a transition effect frame, so that the transition effect frame can be matched more completely.
It can be understood that, when the background similarity is smaller than the second background similarity threshold, it indicates that two adjacent frames of images (which may be understood as a current frame and a previous frame) have different targets and a background with a larger difference, and a transition with a larger video difference is formed, where the two adjacent frames of images have different targets and are two segments of videos with different backgrounds and different targets; when the background similarity is greater than or equal to the second background similarity threshold, it indicates that two adjacent frames of images have different targets but the same background, and it can be considered that target transition occurs, and the two videos have the same background but different targets, and can be transitioned.
Optionally, if the background similarity is smaller than a preset second background similarity threshold, the first background information and the second background information may be spliced to obtain third background information; extracting the features of the third background information to obtain background features; acquiring transition characteristics of a transition effect frame, wherein the transition characteristics are stored in a transition database and are obtained by extracting the characteristics of the transition effect frame; and calculating the feature similarity of the background features and the transition features, and taking the transition effect frame corresponding to the transition features with high feature similarity as a matching result. The transition characteristics are obtained by splicing the head frame and the tail frame of the transition effect frame and then extracting the characteristics. The transition feature and the background feature are extracted by the same feature extraction engine or the same feature extraction algorithm.
Optionally, if the background similarity is greater than or equal to the preset second background similarity threshold, the first background information and the second background information may be fused to obtain a corresponding transition effect frame. Specifically, the fusion of the first background information and the second background information may be a pixel average value of corresponding pixels in the first background information and the second background information.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a video transition effect processing apparatus according to an embodiment of the present invention, and as shown in fig. 2, the apparatus includes:
an obtaining module 201, configured to obtain a video to be processed;
the detection module 202 is configured to perform target detection and background detection on two adjacent frames of images in the video to be processed to obtain first target information and first background information of a current frame, and second target information and second background information of a previous frame;
the first calculating module 203 is configured to calculate a target similarity between the first target information and the second target information, and determine whether the target similarity is smaller than a preset target similarity threshold;
a first processing module 204, configured to generate or match a corresponding transition effect frame according to the first background information and the second background information if the target similarity is smaller than the preset similarity threshold;
an inserting module 205, configured to insert the transition effect frame between the current frame and the previous frame to obtain a target video.
Optionally, the apparatus further comprises:
the second calculation module is used for calculating the background similarity between the first background information and the second background information if the target similarity is greater than or equal to the preset similarity threshold, and judging whether the background similarity is smaller than the preset first background similarity threshold or not;
and the second processing module is used for generating a corresponding transition effect frame according to the first background information and the second background information if the background similarity is smaller than the preset first background similarity threshold.
Optionally, the second processing module includes:
a first generating unit, configured to generate N frames of background intermediate frames by using the second background information as a background header frame and the first background information as a background tail frame if the background similarity is smaller than the preset first background similarity threshold;
and the second generating unit is used for generating a background transition effect frame according to the background head frame, the background tail frame and the background intermediate frame.
Optionally, the second processing module further includes:
the first calculation unit is used for calculating motion information of a target corresponding to N frames according to the first target information and the second target information;
and the first fusion unit is used for correspondingly fusing the target into the N frames of background intermediate frames according to the motion information of the N frames.
Optionally, the first processing module 204 includes:
a second calculating unit, configured to calculate a background similarity between the first background information and the second background information if the target similarity is smaller than the preset similarity threshold, and determine whether the background similarity is smaller than a preset second background similarity threshold;
a matching unit, configured to match a corresponding transition effect frame according to the first background information and the second background information if the background similarity is smaller than the preset second background similarity threshold;
and a second generating unit, configured to generate a corresponding transition effect frame according to the first background information and the second background information if the background similarity is greater than or equal to the preset second background similarity threshold.
Optionally, the matching unit includes:
the splicing subunit is configured to splice the first background information and the second background information to obtain third background information;
a feature extraction subunit, configured to perform feature extraction on the third background information to obtain a background feature;
the acquisition subunit is used for acquiring transition characteristics of the transition effect frame, wherein the transition characteristics are stored in a transition database and are obtained by performing characteristic extraction on the transition effect frame;
and the calculating subunit is used for calculating the feature similarity between the background feature and the transition feature, and taking the transition effect frame corresponding to the transition feature with high feature similarity as a matching result.
Optionally, the second generating unit is further configured to fuse the first background information and the second background information to obtain a corresponding transition effect frame if the background similarity is greater than or equal to the preset second background similarity threshold.
The processing apparatus for video transition effect provided by the embodiment of the present invention can be applied to devices such as a mobile phone, a computer, and a server that can perform processing of video transition effect.
The processing device for the video transition effect provided by the embodiment of the invention can realize each process realized by the processing method for the video transition effect in the method embodiment, and can achieve the same beneficial effect. To avoid repetition, further description is omitted here.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, as shown in fig. 3, including: a memory 302, a processor 301, and a computer program stored on the memory 302 and executable on the processor 301, wherein:
the processor 301 is configured to call the computer program stored in the memory 302, and execute the following steps:
acquiring a video to be processed;
performing target detection and background detection on two adjacent frames of images in the video to be processed to obtain first target information and first background information of a current frame and second target information and second background information of a previous frame;
calculating the target similarity of the first target information and the second target information, and judging whether the target similarity is smaller than a preset target similarity threshold value;
if the target similarity is smaller than the preset similarity threshold, generating or matching a corresponding transition effect frame according to the first background information and the second background information;
and inserting the transition effect frame between the current frame and the previous frame to obtain a target video.
Optionally, the processor 301 further performs the following steps:
if the target similarity is greater than or equal to the preset similarity threshold, calculating the background similarity between the first background information and the second background information, and judging whether the background similarity is smaller than the preset first background similarity threshold;
and if the background similarity is smaller than the preset first background similarity threshold, generating a corresponding transition effect frame according to the first background information and the second background information.
Optionally, the generating, by the processor 301, a corresponding transition effect frame according to the first background information and the second background information if the background similarity is smaller than the preset first background similarity threshold includes:
if the background similarity is smaller than the preset first background similarity threshold, generating N frames of background intermediate frames by taking the second background information as a background head frame and the first background information as a background tail frame;
and generating a background transition effect frame according to the background head frame, the background tail frame and the background intermediate frame.
Optionally, before the generating a background transition effect frame according to the background head frame, the background tail frame, and the background intermediate frame, if the background similarity is smaller than the preset first background similarity threshold, the processor 301 generates a corresponding transition effect frame according to the first background information and the second background information, and further includes:
calculating motion information of a target corresponding to N frames according to the first target information and the second target information;
and correspondingly fusing the target into the N frames of background intermediate frames according to the motion information of the N frames.
Optionally, the generating or matching, by the processor 301, a corresponding transition effect frame according to the first background information and the second background information if the target similarity is smaller than the preset similarity threshold includes:
if the target similarity is smaller than the preset similarity threshold, calculating the background similarity between the first background information and the second background information, and judging whether the background similarity is smaller than a preset second background similarity threshold;
if the background similarity is smaller than the preset second background similarity threshold, matching a corresponding transition effect frame according to the first background information and the second background information;
and if the background similarity is greater than or equal to the preset second background similarity threshold, generating a corresponding transition effect frame according to the first background information and the second background information.
Optionally, the matching, executed by the processor 301, of the corresponding transition effect frame according to the first background information and the second background information if the background similarity is smaller than the preset second background similarity threshold includes:
splicing the first background information and the second background information to obtain third background information;
extracting the features of the third background information to obtain background features;
acquiring transition characteristics of the transition effect frame, wherein the transition characteristics are stored in a transition database and are obtained by extracting the characteristics of the transition effect frame;
and calculating the feature similarity of the background features and the transition features, and taking a transition effect frame corresponding to the transition features with high feature similarity as a matching result.
Optionally, the generating, by the processor 301, a corresponding transition effect frame according to the first background information and the second background information if the background similarity is greater than or equal to the preset second background similarity threshold includes:
and if the background similarity is greater than or equal to the preset second background similarity threshold, fusing the first background information and the second background information to obtain a corresponding transition effect frame.
The electronic device provided by the embodiment of the invention can realize each process realized by the processing method of the video transition effect in the method embodiment, and can achieve the same beneficial effect, and the details are not repeated here to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the processing method for video transition effect provided in the embodiment of the present invention, and can achieve the same technical effect, and is not described herein again to avoid repetition.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present invention, and it is therefore to be understood that the invention is not limited by the scope of the appended claims.

Claims (10)

1. A method for processing video transition effect is characterized by comprising the following steps:
acquiring a video to be processed;
performing target detection and background detection on two adjacent frames of images in the video to be processed to obtain first target information and first background information of a current frame and second target information and second background information of a previous frame;
calculating the target similarity of the first target information and the second target information, and judging whether the target similarity is smaller than a preset target similarity threshold value;
if the target similarity is smaller than the preset target similarity threshold, generating or matching a corresponding transition effect frame according to the first background information and the second background information;
and inserting the transition effect frame between the current frame and the previous frame to obtain a target video.
2. The method of claim 1, wherein the method further comprises:
if the target similarity is greater than or equal to the preset target similarity threshold, calculating the background similarity between the first background information and the second background information, and judging whether the background similarity is smaller than a preset first background similarity threshold;
and if the background similarity is smaller than the preset first background similarity threshold, generating a corresponding transition effect frame according to the first background information and the second background information.
3. The method of claim 2, wherein if the background similarity is smaller than the preset first background similarity threshold, generating a corresponding transition effect frame according to the first background information and the second background information, comprises:
if the background similarity is smaller than the preset first background similarity threshold, generating N frames of background intermediate frames by taking the second background information as a background head frame and the first background information as a background tail frame;
and generating a background transition effect frame according to the background head frame, the background tail frame and the background intermediate frame.
4. The method as claimed in claim 3, wherein before the generating a background transition effect frame according to the background head frame, the background tail frame and the background intermediate frame, if the background similarity is smaller than the preset first background similarity threshold, generating a corresponding transition effect frame according to the first background information and the second background information, further comprising:
calculating motion information of a target corresponding to N frames according to the first target information and the second target information;
and correspondingly fusing the target into the N frames of background intermediate frames according to the motion information of the N frames.
5. The method of claim 1, wherein if the target similarity is smaller than the preset target similarity threshold, generating or matching a corresponding transition effect frame according to the first background information and the second background information comprises:
if the target similarity is smaller than the preset target similarity threshold, calculating the background similarity between the first background information and the second background information, and judging whether the background similarity is smaller than a preset second background similarity threshold;
if the background similarity is smaller than the preset second background similarity threshold, matching a corresponding transition effect frame according to the first background information and the second background information;
and if the background similarity is greater than or equal to the preset second background similarity threshold, generating a corresponding transition effect frame according to the first background information and the second background information.
6. The method of claim 5, wherein the matching a corresponding transition effect frame according to the first background information and the second background information if the background similarity is smaller than the preset second background similarity threshold comprises:
splicing the first background information and the second background information to obtain third background information;
extracting the features of the third background information to obtain background features;
acquiring transition characteristics of the transition effect frame, wherein the transition characteristics are stored in a transition database and are obtained by extracting the characteristics of the transition effect frame;
and calculating the feature similarity of the background features and the transition features, and taking a transition effect frame corresponding to the transition features with high feature similarity as a matching result.
7. The method of claim 5, wherein if the background similarity is greater than or equal to the preset second background similarity threshold, generating a corresponding transition effect frame according to the first background information and the second background information, comprises:
and if the background similarity is greater than or equal to the preset second background similarity threshold, fusing the first background information and the second background information to obtain a corresponding transition effect frame.
8. An apparatus for processing video transition effects, the apparatus comprising:
the acquisition module is used for acquiring a video to be processed;
the detection module is used for carrying out target detection and background detection on two adjacent frames of images in the video to be processed to obtain first target information and first background information of a current frame and second target information and second background information of a previous frame;
the first calculation module is used for calculating the target similarity of the first target information and the second target information and judging whether the target similarity is smaller than a preset target similarity threshold value or not;
the first processing module is used for generating or matching a corresponding transition effect frame according to the first background information and the second background information if the target similarity is smaller than the preset similarity threshold;
and the inserting module is used for inserting the transition effect frame between the current frame and the previous frame to obtain a target video.
9. An electronic device, comprising: memory, processor and computer program stored on the memory and executable on the processor, the processor implementing the steps in the processing method of video transition effect according to any of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, carries out the steps in the face generation method according to any one of claims 1 to 7.
CN202011464688.0A 2020-12-14 2020-12-14 Video transition effect processing method and device, electronic equipment and storage medium Active CN112637674B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011464688.0A CN112637674B (en) 2020-12-14 2020-12-14 Video transition effect processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011464688.0A CN112637674B (en) 2020-12-14 2020-12-14 Video transition effect processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112637674A true CN112637674A (en) 2021-04-09
CN112637674B CN112637674B (en) 2022-10-25

Family

ID=75312460

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011464688.0A Active CN112637674B (en) 2020-12-14 2020-12-14 Video transition effect processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112637674B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113473184A (en) * 2021-07-27 2021-10-01 咪咕音乐有限公司 Video color ring tone blocking processing method, terminal equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002204392A (en) * 2000-12-28 2002-07-19 Canon Inc Apparatus for image processing, system therefor, method therefor and recording medium
CN104424295A (en) * 2013-09-02 2015-03-18 联想(北京)有限公司 Information processing method and electronic equipment
CN110675420A (en) * 2019-08-22 2020-01-10 华为技术有限公司 Image processing method and electronic equipment
CN110969682A (en) * 2019-11-27 2020-04-07 深圳追一科技有限公司 Virtual image switching method and device, electronic equipment and storage medium
CN111915587A (en) * 2020-07-30 2020-11-10 北京大米科技有限公司 Video processing method, video processing device, storage medium and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002204392A (en) * 2000-12-28 2002-07-19 Canon Inc Apparatus for image processing, system therefor, method therefor and recording medium
CN104424295A (en) * 2013-09-02 2015-03-18 联想(北京)有限公司 Information processing method and electronic equipment
CN110675420A (en) * 2019-08-22 2020-01-10 华为技术有限公司 Image processing method and electronic equipment
CN110969682A (en) * 2019-11-27 2020-04-07 深圳追一科技有限公司 Virtual image switching method and device, electronic equipment and storage medium
CN111915587A (en) * 2020-07-30 2020-11-10 北京大米科技有限公司 Video processing method, video processing device, storage medium and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113473184A (en) * 2021-07-27 2021-10-01 咪咕音乐有限公司 Video color ring tone blocking processing method, terminal equipment and storage medium
CN113473184B (en) * 2021-07-27 2023-10-20 咪咕音乐有限公司 Video Color Ring Back Tone (CRBT) clamping and processing method, terminal equipment and storage medium

Also Published As

Publication number Publication date
CN112637674B (en) 2022-10-25

Similar Documents

Publication Publication Date Title
CN108446390B (en) Method and device for pushing information
CN111988638B (en) Method and device for acquiring spliced video, electronic equipment and storage medium
CN111327945A (en) Method and apparatus for segmenting video
CN110188829B (en) Neural network training method, target recognition method and related products
CN112381104A (en) Image identification method and device, computer equipment and storage medium
CN111667001B (en) Target re-identification method, device, computer equipment and storage medium
CN110879974B (en) Video classification method and device
CN113627402B (en) Image identification method and related device
CN107992937B (en) Unstructured data judgment method and device based on deep learning
EP3989158A1 (en) Method, apparatus and device for video similarity detection
CN105657514A (en) Method and apparatus for playing video key information on mobile device browser
CN113542865A (en) Video editing method, device and storage medium
CN111652181B (en) Target tracking method and device and electronic equipment
CN111432206A (en) Video definition processing method and device based on artificial intelligence and electronic equipment
CN111836118A (en) Video processing method, device, server and storage medium
CN113572976A (en) Video processing method and device, electronic equipment and readable storage medium
CN112637674B (en) Video transition effect processing method and device, electronic equipment and storage medium
CN113825012A (en) Video data processing method and computer device
CN113689440A (en) Video processing method and device, computer equipment and storage medium
CN112488072A (en) Method, system and equipment for acquiring face sample set
CN110636322B (en) Multimedia data processing method and device, intelligent terminal and storage medium
US20240062545A1 (en) Information processing device, information processing method, and recording medium
CN114064968A (en) News subtitle abstract generating method and system
CN114240992A (en) Method and system for labeling target object in frame sequence
CN110489592B (en) Video classification method, apparatus, computer device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant