Make your videos glow with a simple Python code

Make your videos glow with a simple Python code using Edge Detection. This is a Glow effect using Python with edge detection and Gaussian blur.

So, let’s take a video as an example.

You can see the glow effects in the second video, right?

So, all I did was detect edges, color them, and add them to the original image frame.

You have to process image frames from the video, then do Canny Edge Detection, and also perform Gaussian blur. Then color the edge image, and add it to the original frame. Finally, save the video.

But the video will be so slow as its speed will be changed. I just sped it up in Microsoft Clipchamp but you can change the FPS in the code and save the video again.

I’ll show you one more video that had some dramatic glow work.

Video credits to wave video, But see the glow effect on it

OpenCV is a great library when you have to work with videos or images. So, if you made something like this, show me.

What challenges did I face?

Mainly, I had a problem with deciding how much to dilate and erode after detecting the edges using the Canny function.

A link to learn the basics

After you get a threshold value by trial and error, you find the required edges. Then perform the coloring operation. Just change the color by converting the image to grayscale. Do remember that while saving the image, sometimes the image colors change. Check for that.

Then, hey, you have a simple Glow Filter effect.

If you have any more ideas like this, tell me!

Keep smiling!

Leave a comment

Discover more from Musing and Realizing

Subscribe now to keep reading and get access to the full archive.

Continue reading