OpenCV* People Counter

This example counts (or measures) the number of people who enter a designated area. You may be familiar with people counting systems, found in small shops, libraries and convenience stores, that use infrared sensors to detect people. When an infrared beam is cut (a person intercepts it by entering or exiting a door, for example) the system increments a count. This technology has limitations when it comes to instances of occlusion (when one person A blocks person B and person B doesn't get counted). An appropriately designed computer vision-based people counting system can be more robust in handling cases of occlusion. Here we utilize the OpenCV* libraries and apply the Histograms of Oriented Gradients (HOG) algorithm to create a computer vision application for people detection/counting.

What you’ll learn

  • How to run a basic people counter computer vision application

Gather your materials

  • UP²* board
  • OpenCV version 3.3.0
  • A UVC webcam

This code sample continues on GitHub*.

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