- DIY
- A
Infrared visitor counter. Why always count heads? Maybe it’s better—count feet, count feet..?
As it is known, a horizontal infrared counter essentially counts not people but interruptions of the horizontal infrared beam caused by their passage. The height of the counter installation recommended by absolutely all manufacturers is 120–150 cm. At this height, the infrared beam targets the head and shoulders of an adult. In this case, one beam interruption should mean that one person has passed.
Oh, this horizontal infrared counter!
If the counter is installed lower, hands would complicate the counting. Even lower, and it would be legs. When the counter is installed at head level, everything is fine.
However, even in this case, some doubts may arise. Let's listen to the argument between two: a cheerful optimist and a bitter skeptic.
The optimist says: - The infrared counter is a useful thing. It is designed to count people, and it counts them excellently. (- Yes, yes - the counter seller nods. - It counts them excellently. Buy it!) - Hee-hee! - the skeptic smirks. - What if two people walk side by side in a wide passage? Or if one joker starts waving his arms in front of the counter? This counter of yours is a useless toy. You can't trust it at all.
Who is right?
Strangely enough, neither. Both the optimist and the skeptic are reasoning purely theoretically. Like children. They are just expressing their emotions. Without any mathematical specifics.
The truth is that the horizontal infrared counter, like any measuring device, has some measurement error. It is clear to anyone that the counter can make mistakes from time to time. Simply because people do not always pass through the infrared beam in the manner expected by the counter's designer. And the question is not whether there are counting errors or not, but how significant those errors are. Can we live with them?
(People also have flaws. So what now - should we not be friends with anyone?)
It is impossible to abstractly determine how significant the error of the counter is (that is, how often errors occur). It is necessary to resort to experiments. Moreover, experiments should be conducted specifically for the typical conditions in which the counter will be operated. The results of experiments with the counter installed at the height recommended by the manufacturers are presented in the article "Is the midnight discrepancy of two-beam infrared counters significant" https://habr.com/ru/articles/872892/
Now let's consider the operation of a horizontal infrared counter in other, unfavorable conditions.
Counting Schoolchildren
- What? Did I hear you right? - shouted the skeptic. - You are going to count schoolchildren with an infrared counter? You must be crazy. They run around like mad. They push each other and ride on each other's backs. You'd be better off counting hares in the forest.
At this point, the optimist decided to help me.
- Alright, alright, calm down. Don't take it to heart. Imagine it's a game. The schoolchildren suddenly became well-behaved: they walk slowly and one by one. Think: can they be counted then? Here’s a fresh pizza: eat it, come on, and please be quiet.
While the skeptic is busy with the hot pizza, I will explain the problem. It does not disappear even if the children behave well.
Schoolchildren in lower and upper grades differ significantly in height. Consequently, the requirements for the height of the infrared counter installation turn out to be contradictory.
When installed at the height recommended by the manufacturer, a typical counter counts upper-grade schoolchildren (and teachers, of course) well. But it does not count lower-grade schoolchildren at all, as their height is less than the height at which the infrared beams of the sensor system pass.
To count lower-grade schoolchildren, it would be better to lower the sensor system to the waist level of an adult. But then errors in counting upper-grade schoolchildren arise, as their hand movements create multiple interruptions in the infrared beam.
And when lowering the sensor system below the level of the hands, to the level of the legs, counting errors occur for both upper and lower-grade schoolchildren.
The extent of the distortion in counting can be seen from the experiments.
(The experiments involved adults.)
Experimental Results
A dual-beam horizontal infrared counter was used for the experiments, ready to count the next customer immediately after counting the previous one (there is no noticeable delay in time). The logic of human passage analysis embedded in this counter is described in detail in the article “Which Images Are Recognized by the Dual-Beam Infrared Counter”
https://habr.com/en/articles/867112/
In the first series of experiments, the counter was installed at a height of 80 cm, which corresponds to the waist level of senior students and teachers. With such an installation, in addition to the main interruption of the infrared beam by the torso, additional interruptions by the arms are possible. Counts were conducted for adults passing by the counter, both in summer clothing with short sleeves or sleeveless and in winter clothing with wide sleeves. The counting results are shown in Table 1.
Table 1. Results of counting adults with the counter installed at waist level
Clothing | Number of People | Counter Readings |
summer | 100 | 163 |
winter | 100 | 118 |
The significant difference in counting results for people with bare arms compared to those in winter clothing is striking. The reason is not hard to understand. When swinging bare arms, a clear opening often forms between the arm and the torso, more frequently than in the case of wide sleeves. Two consecutive separate interruptions of the sensor system beams (first by the arm, then by the torso) are registered by the counter as two people passing. In the case of winter clothing, an opening between the arm in a wide sleeve and the torso also sometimes arises, but much less often, so in this case, the arms generate a smaller counting error.
The relative frequency of single- and double-beam interruptions by the sensor system (when one person passes) is presented in Table 2.
Table 2. Relative frequency of single and double interruptions of sensor system beams when the counter is set at waist level
Clothing | Single, % | Double, % |
summer | 37 | 63 |
winter | 82 | 18 |
Significant differences in frequencies for summer and winter clothing suggest that it is undesirable to install a standard horizontal infrared counter at waist level.
In the second series of experiments, the counter was installed at a height of 30 cm, i.e., at leg level. The count of people with bare legs and people wearing loose trousers was performed. The counting results are shown in Table 3.
Table 3. Results of counting adult people when the counter is set at leg level
Clothing | Number of people | Counter readings |
bare legs | 100 | 166 |
legs in trousers | 100 | 147 |
The results may seem unexpected. It would seem that the presence of two legs in a person should lead to doubled counter readings, as the legs would cause two interruptions of the infrared beam. However, apparently, things are slightly different. When walking, a person first places one leg and only then moves the other. In some cases, the second leg moves through the infrared beam zone when the first leg is already in the beam, and the beam is blocked by it. In these cases, the second leg goes unnoticed by the counter. The relative frequency of single and double interruptions of the sensor system beams by legs (when one person passes) is given in Table 4.
Table 4. Relative frequency of single and double interruptions of sensor system beams when the counter is set at leg level
Clothing | Single-time, % | Double-time, % |
bare legs | 34 | 66 |
legs in pants | 53 | 47 |
As can be seen from the table, there is a difference in frequencies for summer and winter clothing options, but it is not as significant as when the counter is installed at waist level.
It is quite possible that placing a standard counter at leg level solves the problem of counting schoolchildren. At least, with some average statistical error. All that is needed is to introduce "patches." I am not referring to actual patches, but a correction factor for the counter's readings. The value of the correction factor is shown in Table 5.
Table 5. Correction factor for readings of a standard infrared counter installed at leg level
Clothing | Correction Factor |
bare legs | 0.60 |
legs in pants | 0.68 |
It is impossible to say in advance in which season the counter will be used and how the schoolchildren will be dressed, so an average correction factor should be used. The coefficient value for summer and winter clothing options differs by 12%. Apparently, this value will ultimately represent the relative error of counting using a standard infrared horizontal counter installed at leg level.
- Hey, is it possible to program the infrared counter to count via legs directly, without all these correction factors?
- What do you think?
- Bro, no way... Did you actually do it?
- Shh, shh! Patience. Stay tuned.
Write comment