A method and system for composing video special effects based on dual regions

By dividing the special effect video into two areas, using the first image to display the special effect content and the second image to adjust the transparency, the smooth integration of the special effect video and the background video is achieved, solving the problem of a large amount of manual intervention in the prior art and improving work efficiency.

CN119788937APending Publication Date: 2025-04-08SHENZHEN YUANSU CHUANGDA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411927490.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The existing green screen technology requires a lot of manual intervention when dealing with complex scenarios, resulting in unnatural synthesis and inability to fully automate.

Method used

Using a dual-area automated video special effects synthesis method, by dividing the special effects video into a first image and a second image, the first image is used to display the special effects content, and the second image is used to adjust the transparency to achieve a smooth fusion of the special effects video and the background video.

Benefits of technology

The smooth integration of special effects video and background video is achieved, which reduces manual intervention, improves work efficiency, and solves the problem of unnatural synthesis effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119788937A_ABST
    Figure CN119788937A_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for automatic video special effects synthesis based on dual regions. The method divides the special effects video into a first image for performing shader processing on the texture of the special effects video and a second image for adjusting the transparency adaptation between the special effects video and a background video. The transparency of the first image is dynamically adjusted to adapt to the background video based on the second image, so as to achieve smooth fusion synthesis of the special effects video and the background video, so that the synthesis transition between the two will not be abrupt or inconsistent. In addition, the present invention programs the synthesis steps of the special effects video, realizes automatic synthesis of the background video and the special effects video, reduces manual intervention, and improves work efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of special effect video processing, and in particular to a dual-region automatic video special effect synthesis method and system. Background Art

[0002] Special effects video production is a method of filming actors' performances in front of a green or blue screen, and then using technical software and tools to replace or synthesize the green or blue screen with the desired scenes or special effects. This method is generally used in commercial fields such as film and television production, advertising, and live broadcasting.

[0003] There are some obvious defects in the existing green screen technology. Since the background color needs to be removed, when the special effects content appears in the same color as the background color, it will be mistakenly deleted, resulting in content errors. At the same time, green screen technology does not contain transparency information, which makes the synthesized effect have abrupt video edges or unnatural transitions. When dealing with complex scenes, a lot of manual intervention is required to optimize the synthesis effect, and it cannot be fully automated. Therefore, there is an urgent need for a dual-area automatic video special effects synthesis method and system to solve the above-mentioned technical problems. Summary of the invention

[0004] In view of the shortcomings of the above-mentioned technologies, such as unnatural transition of synthesized images and the need for a large amount of manual intervention to optimize the synthesis effect, the present invention provides a dual-region automatic video special effects synthesis method and system.

[0005] To achieve the above object, the present invention provides a dual-region automatic video special effects synthesis method, comprising the following steps: S1, first input and load the data of the background video and the special effect video for decoding, and divide the special effect video into independent dual areas; S2, unifying the time streams of the decoded background video and special effect video, and adjusting the transparency of the special effect video based on the dual regions; S3, fusing the processed special effect video with the background video to finally generate a corresponding fused video; S4, encodes the fused video into a video format and outputs it for storage; S5, programming the steps of S1-S4 to achieve subsequent automatic video synthesis.

[0006] Among them, in S1, the special effects video is divided into two video areas, a first image and a second image. The first image is used to display the special effects content and merge with the background image, and the second image is used to control the transparency of the special effects video. The first image is adjusted to match the transparency of the second image with the background video to improve the fusion of the first image and the background image.

[0007] In S2, the background video and the special effect video are texture loaded and shader processed through OpenGL, and the video texture of the first image is shader processed to improve the color fidelity of the first image.

[0008] Among them, the transparency of the second image control is 0%~100%. When the transparency of the second image control is 0%, only the special effect video is displayed; when the transparency of the second image control is 100%, only the background video is displayed; when the transparency of the second image control is between 0% and 100%, both the special effect video and the background video are displayed.

[0009] The present invention also provides a dual-region automatic video special effects synthesis system, which is used to implement the dual-region automatic video special effects synthesis method, including: A loading module is used to input and load the data of background video and special effect video; The decoding and matching module is used to decode the background video and the special effect video, and to match the time streams of the background video and the special effect video to be consistent.

[0010] The dual-area segmentation module is used to divide the special effects video into two independent areas.

[0011] The fusion processing module is used to adjust the parameters of the special effect video, fuse the background video and the special effect video, and generate a fused video.

[0012] The output module is used to fuse the video, encode it, and output it for storage.

[0013] Among them, the dual-area segmentation module segments the special effect video into a first image and a second image, the first image is used to normally display the content of the special effect video, and the second image is used to compare with the background video to adjust the transparency of the first image.

[0014] The fusion processing module mainly performs texture loading on the background video and special effect video, and performs shader processing on each frame of the video.

[0015] Among them, the transparency of the second image control is 0%~100%. When the transparency of the second image control is 0%, only the special effect video is displayed; when the transparency of the second image control is 100%, only the background video is displayed; when the transparency of the second image control is between 0% and 100%, both the special effect video and the background video are displayed.

[0016] The beneficial effects of the present invention are as follows: compared with the prior art, the present invention provides a dual-region automatic video special effects synthesis method and system, which divides the special effects video into a first image for performing shader processing on the texture of the special effects video and a second image for adjusting the transparency adaptation between the special effects video and the background video by performing independent dual-region segmentation on the special effects video. The first image dynamically adjusts the transparency adapted to the background video based on the second image, so as to achieve smooth fusion synthesis of the special effects video and the background video, so that the synthesis transition between the two will not be abrupt or discordant. In addition, the present invention programs the synthesis steps of the special effects video, realizes automatic synthesis of the background video and the special effects video, reduces manual intervention, and improves work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is a flow chart of the method of the present invention; Figure 2 It is a module interaction diagram of the present invention. DETAILED DESCRIPTION

[0018] In order to more clearly illustrate the present invention, the present invention is further described below in conjunction with the accompanying drawings.

[0019] In the following description, the example details are given to provide a deeper understanding of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all embodiments. It should be understood that the specific embodiments are only used to explain the present invention and are not used to limit the present invention.

[0020] It should be understood that when the terms "include" and / or "comprises" are used in this specification, they indicate the existence of the stated features, integers, steps, operations, elements or components, but do not exclude the existence or addition of one or more other features, integers, steps, operations, elements, components or combinations thereof.

[0021] See also Figure 1-Figure 2 The present invention provides a dual-region automatic video special effects synthesis method, comprising the following steps: S1, first input and load the data of the background video and the special effect video for decoding, and divide the special effect video into respective independent dual areas; input and load the data of the background video and the special effect video for decoding, and divide the special effect video into respective independent dual areas, for example, input the background video file path background_path and the special effect video file path effect_path, use the video decoder to read the video data in background_path and effect_path, decode the video data into a frame sequence, detect the dual areas in the special effect video, determine the boundary of the special effect, and divide the special effect video into two independent areas, which are respectively used to adjust the display of the special effect video and the transparency of the special effect video.

[0022] S2, unifies the time streams of the decoded background video and special effect video, and adjusts the transparency of the special effect video based on the dual areas; synchronizes the timestamps of the background video and the special effect video to ensure that the two are aligned on the timeline, or adjusts the frame rate of the special effect video to match the background video; for each area of ​​the special effect video, adjusts the transparency according to the fusion effect, generally adjusting the Alpha channel of each pixel.

[0023] S3, fusing the processed special effects video with the background video to finally generate a corresponding fused video; fusing the special effects video and the background video according to the actual special effects video and the background video, for example, combining the Alpha channel of the special effects video with the pixel value of the background video.

[0024] S4, encodes the fused video into a video format and outputs it for storage; encodes the synthesized video frame sequence into a video file, selects appropriate encoding format and parameters, such as H.264, MP4, etc., and saves the encoded video data to a specified output file path.

[0025] S5, programs the steps of S1-S4 to realize the subsequent automated video synthesis; writes codes through various programming languages, such as Python, Java, C++ and other programming software to complete the automation.

[0026] First, the background video and special effect video to be synthesized are loaded, and the background video and the special effect video are decoded into a readable video format, and the time streams of the background video and the special effect video are kept uniformly aligned to ensure the synchronization of the two, and the special effect video is divided into independent dual areas, and the display and transparency of the special effect video are adjusted separately; the present invention mainly adjusts the parameters of the special effect video, and then merges the processed special effect video with the background video to generate a complete fused video, and encodes and processes the fused video for storage, and the above operations are performed by means of programming, so that the above steps can automatically synthesize the special effect video, so as to improve work efficiency and reduce manual interference.

[0027] In this embodiment, regarding the dual-area segmentation of the special effect video, the specific operation is to segment the special effect video into two independent video images, one is a first image for displaying the actual special effect content, and the other is a second image for controlling the transparency of the special effect video and serving as a reference for adjusting the first image. The first image mainly processes the texture frame number of the special effect video by performing shader processing on each frame of the first image. The second image mainly adjusts the transparency of the special effect video content as a reference for adjusting the transparency of the first image. By adjusting the video transparency of the second image and integrating it with the background video, the problem of the special effect content containing the same color being misprocessed due to the background color is avoided; and the background video has no transparency information, which will cause the special effect video to be For example, there is an obvious color difference in the boundary between the green screen background and the objects in the special effects video, and the color transition and fusion between the background video and the special effects video is not naturally smooth, resulting in a relatively obvious video synthesis dividing line in the video. Therefore, the transparency of the special effects video is adjusted based on the second image through the first image, and then the shader processing of the texture of the first image is adjusted to reduce the disharmony between the background video and the special effects video, so as to achieve a smooth fusion effect between the first image and the background video, thereby ensuring that the visual effect of the final fused video is more realistic and smooth. The first image and the second image are completely decoupled, and the display and transparency of the special effects video are adjusted separately, thereby enhancing flexibility and applicability.

[0028] In order to improve the synthesis efficiency of special effects videos, based on the processing logic of the above-mentioned special effects videos and background videos, the synthesis of special effects videos and background videos can be turned into a programmed method to achieve one-click automatic synthesis of special effects videos, which greatly reduces the problem of errors caused by manual intervention. When a large number of special effects videos need to be synthesized, special effects synthesis can be performed automatically, which greatly improves work efficiency.

[0029] In this embodiment, the present invention mainly utilizes the texture features in OpenGL (Open Graphics Library) to perform shader processing on the independent texture of the first image of the special effects video, and transforms the detail features of the two-dimensional image into the object surface in the three-dimensional image by processing the image color balance, thereby enhancing the special effects of the special effects video to be close to the real texture effect, and OpenGL can automatically fuse the background video and the special effects video to automatically generate the corresponding fused video.

[0030] In this embodiment, the transparency of the second image control is 0%~100%. When the transparency of the second image control is 0%, only the special effect video is displayed; when the transparency of the second image control is 100%, only the background video is displayed; when the transparency of the second image control is between 0% and 100%, both the special effect video and the background video are displayed. The present invention also provides a dual-region automatic video special effects synthesis system, which is used to implement a dual-region automatic video special effects synthesis method, including: A loading module is used to input and load the data of background video and special effect video; The decoding and matching module is used to decode the background video and the special effect video, and to match the time streams of the background video and the special effect video to be consistent.

[0031] The dual-area segmentation module is used to divide the special effects video into two independent areas.

[0032] The fusion processing module is used to adjust the parameters of the special effect video, fuse the background video and the special effect video, and generate a fused video.

[0033] The output module is used to fuse the video, encode it, and output it for storage.

[0034] In this embodiment, the dual-region segmentation module segments the special effect video into a first image and a second image. The first image is used to normally display the content of the special effect video, and the second image is used to compare with the background video to adjust the transparency of the first image.

[0035] In this embodiment, the fusion processing module mainly loads textures for the background video and the special effect video, and performs shader processing on each frame of the video.

[0036] In this embodiment, the transparency of the second image control is 0%~100%. When the transparency of the second image control is 0%, only the special effects video is displayed; when the transparency of the second image control is 100%, only the background video is displayed; when the transparency of the second image control is between 0% and 100%, both the special effects video and the background video are displayed.

[0037] The advantages of the present invention are: 1) The present invention divides the special effect video into two independent regions, into a first image for performing shader processing on the texture of the special effect video and a second image for adjusting the transparency adaptation between the special effect video and the background video. The transparency of the first image is dynamically adjusted to adapt to the background video based on the second image, so as to achieve smooth fusion synthesis of the special effect video and the background video, so that the synthesis transition between the two will not be abrupt or inconsistent.

[0038] 2) The present invention programs the synthesis steps of special effect videos, realizes automatic synthesis of background videos and special effect videos, reduces manual intervention, and improves work efficiency.

[0039] The above disclosures are only several specific embodiments of the present invention, but the present invention is not limited thereto, and any changes that can be conceived by those skilled in the art should fall within the protection scope of the present invention.

Claims

1. A dual-region automatic video special effects synthesis method, characterized in that: The following steps are involved: S1, first input and load the data of the background video and the special effect video for decoding, and divide the special effect video into independent dual areas; S2, unifying the time streams of the decoded background video and special effect video, and adjusting the transparency of the special effect video based on the dual regions; S3, fusing the processed special effect video with the background video to finally generate a corresponding fused video; S4, encodes the fused video into a video format and outputs it for storage; S5, programming the steps of S1-S4 to achieve subsequent automatic video synthesis.

2. The method for composing video special effects based on dual regions according to claim 1, characterized in that: In S1, the special effects video is divided into two video areas, a first image and a second image. The first image is used to display the special effects content and merge with the background image. The second image is used to control the transparency of the special effects video. The transparency of the first image is adjusted based on the second image and the background video to match the transparency so as to improve the fusion of the first image and the background image.

3. The method for composing video special effects based on dual regions according to claim 2, characterized in that: In S2, the background video and the special effect video are texture loaded and shader processed through OpenGL, and the video texture of the first image is shader processed to improve the color fidelity of the first image.

4. The method for composing video special effects based on dual regions according to claim 2, characterized in that: in, The transparency of the second image control is 0%~100%. When the transparency of the second image control is 0%, only the special effect video is displayed; when the transparency of the second image control is 100%, only the background video is displayed; when the transparency of the second image control is between 0% and 100%, both the special effect video and the background video are displayed.

5. A dual-region automatic video special effects synthesis system, used to implement the dual-region automatic video special effects synthesis method according to any one of claims 1 to 4, characterized in that: include: A loading module is used to input and load the data of background video and special effect video; A decoding and matching module is used to decode the data of the background video and the special effect video, and to match the time streams of the background video and the special effect video to be consistent; Dual-area segmentation module, used to divide special effects video into independent dual areas; A fusion processing module is used to adjust the parameters of the special effect video, fuse the background video and the special effect video, and generate a fused video; The output module is used to fuse the video, encode it, and output it for storage.

6. The dual-region automatic video special effects synthesis system according to claim 5, characterized in that: The dual-area segmentation module segments the special effect video into a first image and a second image, wherein the first image is used to normally display the content of the special effect video, and the second image is used to adjust the transparency of the first image.

7. The dual-region automatic video special effects synthesis system according to claim 6, characterized in that: in, The transparency of the second image control is 0%~100%. When the transparency of the second image control is 0%, only the special effects video is displayed; when the transparency of the second image control is 100%, only the background video is displayed; when the transparency of the second image control is between 0% and 100%, both the special effects video and the background video are displayed.

8. The dual-region automatic video special effects synthesis system according to claim 5, characterized in that: The fusion processing module mainly uses OpenGL to load textures of the background video and the special effect video, performs shader processing on each frame of the video, and fuses the background video and the special effect video.