Brussels / 2 & 3 February 2019


Video Analysis using CUDA and OpenCV

Detecting scene changes in videos using CUDA and OpenCV

CUDA has gained popularity as the programming language for GPUs.

OpenCV remains the most popular library for computer vision.

The aim of the talk is to introduce people to harness both the technologies to build high performance models for image and video processing, by using the simple problem of detecting scene changes in a video.

Detecting scene changes in videos using CUDA and OpenCV.

CUDA is a parallel computing platform and application programming interface (API) model created by Nvidia. It allows software developers and software engineers to use a CUDA-enabled graphics processing unit (GPU) for GPGPU (General-Purpose computing on Graphics Processing Units).

OpenCV stands for Open Source Computer Vision Library. It has C++, python and Java interfaces.

The scene change detection problem is can be defined formally as - given two frames, do they belong to the same scene, or different scenes? The content-aware scene change detection finds all areas in a video where the difference between two subsequent frames exceeds a threshold value. This allows to detect cuts between scenes.

The proposed algorithm has the following steps - * Decode the video. * For each frame -

       * Convert the frame to HSV colour space.
       * For each channel, find the average pixel by pixel difference with the previous frame
       * Average the difference over the number of channels.
       * If greater than a given threshold declare the frame as a scene change

The pixel-by-pixel operation of each channel can be optimised to execute in parallel. This can be achieved using CUDA.

The simple algorithm above can be optimised to execute on a GPU and achieve 10x improvements in speed.

All the code is written in C++


Sam Radhakrishnan