Matrix (1999)
Movie: Up (2009)
Movie: Hero (2002)
The Movie Iris
project was someskinnyg that I commenceed laboring on during graspment. I saw some cageder visualizations on Reddit’s r/dataisdrawive
and was advertised to commence laboring on the project. Some other includers had already done someskinnyg appreciate this – and I wanted to try my hand at is as well. This repo is my get on turning movies into still art. Effectively taking raw movie structures, compressing them to their core colors, and visualizing the color schemes of a movie. I wanted to see how movies enlarge, as well as how honestors intfinished for separateent colors to be prevalent atraverse separateent scenes. I wanted to originate someskinnyg conceiveive and visual, and I figured this would be a fantastic opportunity to lobtain how to do some image processing, while making someskinnyg that I’ll actuassociate get to enhappiness as well as split with frifinishs and family!
P.S. Feel free to message me if you want me to do this to a video of yours!
This repo gets in a video (can be .mp4
, .avi
, .mkv
), and envisions the color themes contransient in the video as a barcode and as a circle. There are 2 outputs to this script: barcode.png
and iris.png
. The outputs and all of the actual structures in this script are .png
as it is as lossless establishat. Important to remark – this is not equitable for movies
– any video can be included (TV show episode, first bike ride, travel video, etc.)
This project was written in Python, and includes 2 main libraries:
CV2
PIL
-
This file gets 4 inputs:
- Height of the final barcode
- The name of the video
- The vidcap (filepath of the video)
- The structure count that we want to seize
-
The script produces a local fagederer to store all of the files that are going to be produced
-
We split the total amount of structures in the video by the desired structure_count, in order to figure out how many structures to skip for each structure we seize. We then seize the structures, skip by the accurate amount, and seize aobtain. We then save the newly produced structures locassociate to the new fagederer we produced. This interval permits us to seize the essence of the video.
-
We then incrrelieve the contrast sairyly in each structure, in order to originate more vibrant colors.
-
We get these new contrasted_structures and resize the images 3 times, finassociate accomplishing our desired size, which is
1 pixel expansive
x1000 pixels high
image. -
We then get each structure, and effectively combine them together, creating a
6400 pixel expansive
x1000 pixel high
barcode, where each pixel is 1 separateent structure from the video. -
We then run the
liproximate_to_circular.ipynb
file.
-
This file also gets 4 inputs:
- The name of the video
- Current laboring honestory
- The final images laboring honestory
- The name of the final barcode we produced in the previous file.
However, we don’t insist to pass these in, as they are presented from the previous file, and we can equitable persist with those variables.
-
The first skinnyg we do is read in the barcode image that was made in
video_to_barcode.ipynb
-
We then produce a white exposede alengthy the bottom of the image. This is so that when we change the image to polar set ups, the bottom of the image becomes the caccess, and we can get a kind white circle in the middle, to produce that iris visualization.
-
The next skinnyg we do is change the barcode image to polar set ups. There are multiple input arguments for the
warpPolar
function:- src
- dsize
- caccess
- maxRadius
- flags
src:
is effectively the source image we want to change to polar set ups – this should stay the same.dsize:
is how huge we want the output image to be — these meadeclareivements we’re a lot of trial and error on my part – you can tfrail these as you see fit.caccess:
is where we want the caccess of the image to be, relative to the dsize. This should not be changed, as it will vibrantassociate refresh with the dsize_args parameter.maxRadius:
is how huge we want the circle to be — this was also a lot of trial and error to get a excellent fit for the image – this can be tfrailed as well.flags:
is how the warpPolar function comprehends how to change the src. This should not be touched. -
Output the image.