Python* Code Samples for Video Analytics with OpenCV

Video Analytics with OpenCV

Computer vision technologies for both video analytics and attribution are becoming increasingly important across a number of vertical markets. In support of computer vision development efforts, we've created a GitHub* repository of twelve computer vision code samples. These code samples are a good starting point for developers who wish to develop more robust computer vision and analytic solutions. We use the Retail, Digital Signage market in these examples but the technology can be used in a variety of different markets.

The twelve computer vision code samples have been optimized using Intel® Integrated Performance Primitives (Intel® IPP) and the Intel® Math Kernel Library (Intel® MKL). By installing these libraries and others, developers will be able to see performance improvements over the basic installation of OpenCV. Written in Python* and leveraging the Open Source Computer Vision (OpenCV) Library, developers will be able to step through the process and begin experimenting with OpenCV code samples.


Code Samples

Under the tutorials folder on the GitHub site linked below, developers will find the twelve code samples. We provide a high-level overview for the code samples and how to deploy them. It is recommended, once you’ve insured that all the pre-requisites have been met, that developers step through the code samples in a sequential order.

The twelve samples are grouped into two categories: diagnostic and application. The diagnostic samples cover setup and configuration of OpenCV to ensure everything has been installed properly, and a few basic functional tests to verify the enabled hardware acceleration features. The application samples demonstrate OpenCV building blocks to get you started on developing an end-to-end analytics application using computer vision, including features such as face detection and real-time tracking.


  • OpenCV Information
  • OpenCV Build Information
  • OpenCV Image Test
  • OpenCV Video Test
  • OpenCV with OpenCL™
  • OpenCV Hardware Info


  • OpenCV Video Capture
  • OpenCV Digital On-Screen Graphic (DOG) Image
  • OpenCV DOG Video
  • OpenCV Face and Eyes Detection - Still Image
  • OpenCV Real-Time Video Face Detection and Tracking
  • OpenCV Real-Time Video People Counter using Face Detection

To learn more about the use of computer vision and video analytics in digital signage check out an Introduction to Developing and Optimizing Display Technology.

To install OpenCV for the tutorial samples, see Installing OpenCV for Python .

Visit on GitHub

For more complete information about compiler optimizations, see our Optimization Notice.