Deep neural networks tend to outperform other classification techniques. However, with IoT devices, there is not a large amount of RAM, compute, or storage. On constrained devices, RAM and storage are often in MB and not in GB, making traditional classifiers not possible. Some video classification services in the cloud charge over $10,000 per device for live streaming video. OpenCV's Haar classifiers have the same underlying principles as a convolutional neural network but at a fraction of the compute and storage. OpenCV is available in multiple languages and runs on some of the most constrained devices.
In this recipe, we are going to set up a Haar Cascade to detect if a person is close to the camera. This is often used in Kiosk and other interactive smart devices. The Haar Cascade can be run at a high rate of speed and when it finds a face that is close to the machine it can send that image via a cloud service or a different onboard machine...