Use OpenCV image operation + Moviepy to achieve video overlay case

☞ ░Go to LaoYuanPython blog https://blog.csdn.net/LaoYuanPython

Note : This article is a paid column. If you have not subscribed to the paid column and do not want to subscribe to the related paid column, please read the corresponding free article " OpenCV Image Operation + Moviepy to Realize Video Rotation and Overlay ".

I. Introduction

In " OpenCV-Python Commonly Used Image Operations: Addition , Subtraction, Multiplication, Division, and Power Extraction Logarithm and Bit Operations " introduces the main image operations of OpenCV. The video is composed of one frame of images. Through the flexible use of OpenCV and Moviepy, some special operations can be achieved. Special effects. This article will introduce how to realize the transparent effect of video overlay through OpenCV image operation + Moviepy.

Second, the program is realized

This case implements a general method that can superimpose a rotating video or rotating picture on the video, and supports the superposition of two videos with different content sizes. In order to support the superimposed object as a picture, the picture needs to be converted into a video. In order to highlight the content of the picture as much as possible, the background color of the picture is converted to black before the picture is converted to a video.
Related programs include the following functions:

  1. adjustImgAccordingToRefImg: Adjust the size of the upper layer video with reference to the size of the bottom layer video, which is framed

Guess you like

Origin blog.csdn.net/LaoYuanPython/article/details/109206777