开发者

How to programmatically blur an area in a movie (in python)?

开发者 https://www.devze.com 2022-12-26 07:32 出处:网络
I have a movie, and I want to produce a new movie out of it with an area blurred (e.g. an object, a writing or a face). The area is moving, so I must have fine control of the current frame and move th

I have a movie, and I want to produce a new movie out of it with an area blurred (e.g. an object, a writing or a face). The area is moving, so I must have fine control of the current frame and move the position of the blur area accordingly. Blur is an option, but also a dark mask is fine too.

Now, I have a question open at superuser on which software to use, but since I suspect I will have to buy adobe premiere to do something like this, and I don't want to shell out a kidney for something I have开发者_如何学Python to do once, I am thinking about coding it myself in python.

What are the best libraries available for this task ?


Definetively you'll need to use OpenCV, mainly due to performance issues you may have to process it in Python. See the Smooth function from the Image Filtering section of the Python documentation from OpenCV.


Blurring is easy, either Avisynth or openCV will do that. If you need to track the position of a moving object then avisynth requires you to manually select the position, you should be able to write a decent object tracker in openCV easily.

I don't know of any free video editors that do this automatically - if you you only need to do it once you could use a trial version of something like premiere.

0

精彩评论

暂无评论...
验证码 换一张
取 消