Human detection & counting using OpenCV in Python is an exciting deep learning project in which OpenCV is used for standard image processing functions, along with the deep learning object detector elements (such as histogram of oriented gradients (HOG) + support vector machines (SVM) + Non-Maximum Suppression (NMS)) to analyze the number of people in a given area. It can be used to monitor traffic in areas at any given time to identify the “power hours” at any particular place.
HOG is a feature descriptor used in computer vision and image processing for the purpose of object detection. This is one of the most popular techniques for object detection, to our fortune, OpenCV has already been implemented in an efficient way to combine the HOG Descriptor algorithm with Support Vector Machine or SVM.
SVM is a supervised machine learning algorithm which can be used for classification or regression problems. It uses a technique called the kernel trick to transform your data and then based on these transformations it finds an optimal boundary between the possible outputs.
Non-maxima suppression suppresses bounding boxes that overlap with a significant threshold. We see that multiple false bounding boxes are detected, but by applying NMS we can remove them, leaving us with the true detection in the image.