Scan Line Video Creator
Create videos straight out of the '80s with only a single input image.
The Objective
The Scan Line Video Creator project aims to transform a single input image into an engaging video, simulating the gradual line-by-line drawing of the image on screen. The original impetus behind this endeavor stemmed from the captivating introduction of Halloween III.
The Tech
The project was developed using the Python programming language and leveraged the image processing and video creation capabilities of the OpenCV2 library.
The Implementation
IMAGE PREPARATION:
The initial phase involves image preparation, wherein OpenCV2's Canny edge detection method is employed to extract the predominant shapes from the image.
Subsequently, a customized method is executed to compute the average color values within each identified shape. This strategic step aims to efficiently curtail the spectrum of colors within the image to a manageable range.
The culminating step in the image processing phase entails splitting the image into multiple components, each representing a distinct color. These segmented images are then cataloged in a list, arranged in descending order based on the volume of colored pixels they encapsulate.
VIDEO CREATION:
With the segmented and ranked images at hand, the video creation process ensues.
Vertical divisions are established across the height of the image, demarcating regions for colored lines and those left blank.
The animation of line-drawing is initiated, commencing with the zoomed-out depiction of the whole image. This panoramic perspective facilitates the observation of the silhouette taking form.
As the animation progresses, the degree of zoom intensifies in correspondence with the diminishing size of the region being colored. This dual-purpose strategy enhances the visibility of the drawing process and adds an element of suspense to the final image reveal.
Once the drawing of the image has concluded, the zoom reverts to the original state, culminating in the grand revelation of the completed image.