CUVI library comes with a lot of image processing building blocks that can be used to build countless applications. For example the Feature Detection & Tracking module of CUVI can be used for motion detection in a live video stream, intrusion detection and tracking an object of interest throughout a video stream or series of cameras. The processing pipeline for motion detection goes as follows:

  • Read a frame from the camera stream
  • Select Strong Features in that Frame using CUVI
  • Read next frame
  • Track features of first frame in the second frame using CUVI

This is the basic process of motion detection. The results may not be perfect due to noise or poor lightning conditions. They can be improved further by preprocessing the video frame before feature selection. Preprocessing includes different image enhancement techniques like applying Gaussian smoothing filter or adjusting the brightness. These operations can be achieved in CUVI by using cuvi::imFilter() and cuvi::adjust() functions respectively.

The CUVI functions used in this example are cuvi::selectGoodFeatures and cuvi::trackFeatures(). For ease of use we do image I/O using OpenCV for this particular example Attached below, is a sample C++ code for motion detection as well as a demo video: Example Code