Def. We call that the OB1 problem (off-by-one). If either event detection (did something happen) or event classification (entry or entrance) is wrong, you can be off the whole day. To solve that, we have a different approach / non-threshold approach for boolean occupancy. Not implemented here.
It's a custom sensor in the lidar family. Uses infrared lasers as illumination and generates depth data. Essentially millions of height values. When depth is rendered to be human legible it look looks like greyscale silhouettes (dark grey is far away, lighter gray is nearer). Sensor processes those values on the edge and published +1/-1 and telemetry data (system health).