Skip to content

amir78729/cv2-video-art

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VID-ART

Creating an image from an input video's frames

Table of Contents


Install

This project uses NumPy, tkinter and cv2. Go check them out if you don't have them locally installed.

pip install numpy
pip install tkinter
pip install cv2

How does it work?

This program uses an input video and then it creates an image from every frame of the input video. Every vertical bar of the output image has a color that is calculated from the average color of each pixel of the frame. for example, we use this video as an input for our program(You can click on the image to watch it!):

sample-video

Frame information:

After the video starts playing, besides the original video we can simultaneously see the frame average color and also the frame number:

frame-info

This means that in the 88th frame of the video, the average color is (124,119,139) or #7C7788 #7C7788; so the 88th vertical bar in the final picture has the color of #7C7788!

Timeline

You can also watch the process of the program in the timeline frame:

timeline

Output:

After the program detects all of the frames of the video and saves the average colors in a 2D array, then we can create our art:)

vid-art

ℹ For enhancing the speed of the process, you can comment the frame color and timeline sections.


Other examples:

Here are some other pictures that are created from other input videos:

Family Guy: Season 11, Episode 4

vid-art

Rick and Morty: Season 4, Episode 9

vid-art

Money Heist: Season 3, Episode 1

vid-art

About

Creating an image from an input video's frames

Topics

Resources

Stars

Watchers

Forks

Languages