top of page

Video Filter

Once we implemented the filtering for still images through our Snazzy Filter function, we tried to extent our filters to videos. In order to run the function, the function is called as:

​

singleVideoFilter(file, filter)

​

Where file is a video file to be filtered and filter is the desired filter option. The function returns a file called ‘filtered_vid.avi’ which contains the original video with the chosen filter applied to it.

We chose to implement the same seven filters as our still image filters. These can be called as follows:

‘blur’ : Blurs the detected face

‘hat’ : Places a cowboy hat above the detected face

‘nose’ : Places a mustache below the detected nose

‘tiara’ : Places a tiara above the detected face

‘flower’ : Places a flower crown above the detected face

‘glasses’ : Places sunglasses on the detected eyes

‘mask’ : Places a mask over the detected face

​

For example, to add a het filter to the file ‘test.avi’ you would call the function as:

​

singleVideoFilter(‘test.avi’,’hat’)

 

​

​

Run Time Measurements

​

Our original goal was to implement video filtering by using the KLT Algorithm. However, we had some difficulty tracking the desired features in each frame and applying the filter once the features were detected. Our video filter implementation was a hybrid of the Viola Jones Algorithm, requiring the facial features to be detected multiple times, slowing down the function.

​

Ultimately, our goal with our video filtering functions would be to be able to filter videos in real time, allowing a user to use a webcam or cell phone to take a video of themselves and have it filtered without any lag. Currently though, our video filtering function is slower than that, requiring a certain amount of time for setup and another amount of time to perform the actual filtering and output the results. In the table below you can see the time required for each of our filters to run. The first column is the setup time required to initialize all the necessary functions. The second column is the time it took for the entire function to run and filter an 8 second video clip. The results shown include time required to write the filtered video to a file. Without the video being written to a file, the total run time was reduced by about 3 seconds on average, but the setup time was unchanged.

bottom of page