People flow counter

People flow counter

One of my clients (I'll call it Joe) needed to monitor how many people/vehicles entered and exited his shop.  He works in the retail industry and wants to better understand his advertising ROI and in-store conversion rate. This case study outlines how I helped him achieve his goal with a lightweight, cost-effective solution.

Key issues

Existing commercial solutions have a sustainable price for single/small installations only. Since Joe wanted to install tens of devices, a low-cost alternative was needed. Turns out that if you don't need extreme detection precision, you can setup a people counting system leveraging AI-enabled cameras at 25$ / each. All while preserving customers' privacy!

Problem statement

This project is about deploying a cheap camera device that monitors h24 his field of view and counts how many people cross it from top-bottom and bottom-up (or left-right, depending on the rotation). The camera is not bounded to only detect people. You can recognize any sort of objects (e.g. vehicles in a warehouse) after proper training.

To preserve your customers' privacy, the detection algorithm runs locally on the device and never reaches the internet. Also, everything runs in real-time, so you don't need to store any frame.

How To

As simple as it is, the system continuously takes frames and applies computer vision and machine learning to detect moving objects. Once it starts detecting one, it follows it across the few next frames to infer the direction of motion. This way you can know if it is entering or exiting the field of view.  There are 3 steps involved:

  1. a fast motion detection algorithm checks if something is moving in the frame
  2. an object detection algorithm checks if that something is an object of interest
  3. once an object is detected, it is tracked across frames

This means that the camera can differentiate between e.g. humans vs pets, to keep the detection count as clean as possible from noise. It can be repurposed to track vehicles or livestocks, if needed.

How much does it cost?

Apart from my development cost, you can purchase an AI-capable camera for around 25$. For comparison, commercial solutions are available from 200$. Now, if you only need a single device, go buy a commercial product - it will cost you less than my work. But if you need many devices, you can consider amortizing my fixed cost by drastically reducing hardware costs.