People counting Intelligent module from Macroscop is now in high demand for practical and commercial needs. Automatic counting makes attendance monitoring possible. It allows one to assess effectiveness of marketing activities and improve safety.
Automatic counting systems are primarily installed in retail (shopping centers, stores), as well as manufacturing facilities, stadiums, subways, and other crowded places. Traffic data can be used for marketing activities planning and staff assessments. It guarantees optimization of a facility’s resources allocation and improves its operational decision-making.
There are several methods of automatic People counting, based on turnstile sensors, heat and infrared ray crossing sensors, or based on video stream analysis. Compared to all other methods, the video stream analysis method benefits from the fact that it does not delay visitors like a mechanical turnstile does. Also, it can operate at in a higher density crowd, unlike thermal and infrared sensors.
There are several approaches to the People counting task using video stream analysis. This article focuses on two of them: direct and indirect.
Direct approach. People counting based on tracking
This method involves the construction of moving objects’ pathways within certain perimeters and capturing a virtual Entrance/Exit lines crossing. Let’s consider this algorithm of tracking and the methods for pathway construction in greater detail.
Pathway construction - Method #1
The analysis of a video snapshot sequence is performed in order to construct a pathway of moving objects within a video stream. Theoretically, one snapshot can contain several moving objects. That is why software should not only build a pathway, but distinguish between these objects and, also, their movements. When moving objects cross a line one at a time, there is no difficulty in tracking them. It is only necessary to determine the direction of line crossing correctly.
This task can be handled by a counting method based on the simplest version of tracking, analyzing foreground objects (moving objects) in consecutive snapshots. At first, areas with movement, which are different from the background, are highlighted on current and preceding snapshots. Then, analyzing speed, direction of objects’ movements, as well as their sizes, is performed, along with the probable calculation of objects’ transition from one point of the preceding snapshot to another point in the current snapshot. The most likely moves of each object construct its pathway.
Pathway construction - Method #2
Objects in the frame can move in different ways: their pathways may intersect or overlap, and their movement zones may come together in one area. If that is the case, the software program should be able to identify each object, or separate groups of objects, and perform People counting based on a virtual line crossing in one direction or another.
In these cases, the task of exact pathway building for individual objects becomes more complicated. The method of building a pathway based on two snapshots is not suitable for such situations. It may result in high deviations and error. A different method, which is based on video stream analysis and continuous post-processing of results, is used to deal with these complex situations. The software builds columns and analyses objects’ transitions from one location (position) to another. Furthermore, it analyzes speed, its direction of movement, position, and color characteristics. An output results in a set of the most probable movement of an object or its pathway.
The difference between these two methods (method #1 and #2) is that the processing of snapshot sequence takes into consideration not only the current position of the object but keeps track of its past movements as well. This approach allows one to improve accuracy in difficult situations with motion intersection and the appearance and disappearance of objects.
We should also consider the situation when visitors cross entrance/exit line in groups. In order to perform People counting correctly, it is necessary to determine their number in a group accurately. This can be done in several ways. The first method is based on detection of visitors’ heads. The software determines how many objects, identified as a head, crossed a certain virtual line. Another way analyzes the square footage of an object crossing a line, and compares it with an average of square footage of a person for this video stream. This approach allows us to estimate the number of people within a moving object.
The method of counting heads is more accurate since a large size object may not only be a group of people but a person with a large object, such as a shopping cart, as well.
The most accurate result is achieved with a small mutual overlap of moving objects when they can be easily separated from each other.
Indirect approach: Optical flow based People counting analysis
If the direct approach to People counting finds an object in a video stream and follows its movement, indirect approach watches a virtual entrance/exit line and analyzes the movement of color pixels passing through it. This method keeps track of certain area movement, its brightness, color, and its crossing of a line; calculates characteristics of an image (edges, corners, singular points, texture, etc.) However, this method captures only the fact of object’s movement through a certain line, but does not define what object it was or how many people crossed it. Head counting and square footage analysis approaches are also used for determining the number of moving people who have crossed the line.
This indirect method can also be used in situations with high-density crowds when traditional methods of moving objects tracking are inapplicable. The most accurate results are achieved when crowds have a homogeneous density.
There are several approaches to People counting. Two main methods have been considered in this article. The first one, direct method, uses algorithms of pathway building of moving objects (tracking). The second one, indirect method, works with an optical flow. The exact number of people is determined by detecting images of their heads, along with the square footage analysis of objects crossing an entrance/exit line. It improves the accuracy of counting considerably.
The location of a video camera plays a major role in the quality of counting modules working. The most accurate results can be achieved when a camera is placed at the highest possible position. The device should be hanging from the ceiling, facing either straight down or with the minor deviation.
Download Macroscop Demo to check how it works!