Creating an image from an input video's frames
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
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!):
After the video starts playing, besides the original video we can simultaneously see the frame average color and also the frame number:
This means that in the 88th frame of the video, the average color is (124,119,139)
or #7C7788
; so the 88th vertical bar in the final picture has the color of #7C7788
!
You can also watch the process of the program in the timeline frame:
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:)
ℹ For enhancing the speed of the process, you can comment the frame color and timeline sections.
Here are some other pictures that are created from other input videos: