OskarSonc
Device: OAK-D-Lite-AF
Mounting: top-down above bus door
Camera height: 2.05 m from the floor
Environment: real bus entrance/exit, with poles/door structures near ROI, fast passenger flow, occasional simultaneous crossings
Goal: robust IN/OUT counting for production bus use
What we tested today (based on your advice)
We switched to depth-based counting (line crossing) instead of relying on RGB-only foreground.
We tested multiple depth windows (near/far thresholds), ROI widths/heights, and line-crossing parameters.
We tested:
pure depth mask contouring
depth mask + background subtraction (MOG2 on depth mask) to remove static structures
We tuned debounce/duplicate suppression, track matching distance, and track persistence.
We verified service-side logs and added runtime snapshots to inspect what the camera sees in real operation.
Current main issue
Even when the camera clearly sees the scene, we still get unstable behavior:
missed OUT events
occasional duplicate IN events
unstable blob behavior depending on thresholds/timing
some “OUT ignored floor@0” events
In the latest runs, the system counts some events, but still has significant misses and duplicates (not reliable enough for production).
Problem summary (critical detail):
The repeated false IN/OUT events are occurring even when only ONE person is moving through the door area (me, during testing).
So the issue is not caused by multiple passengers at once in these test runs.
A single-person crossing still produces duplicate/incorrect event sequences.
What we need from you
Could you please help with one of the following:
Recommended official baseline algorithm/config for top-down bus-door counting at ~2.05 m height (with poles/door edges in view), or
Point out likely mistakes in our approach and parameters, with concrete corrections, especially for:
depth range selection
ROI shape/placement
line-crossing strategy
tracker settings for fast bidirectional crossings
static structure suppression (poles/door frames)
If you have an internal/official “ready” template for this use case (bus doorway passenger flow), we would strongly prefer that.
One more critical question: Would changing the camera mounting from horizontal (landscape) to vertical (portrait) be a key move for this setup? The logic is that by aligning the longer axis of the sensor with the passenger’s path, the system would capture the movement over a longer distance, resulting in more frames per passenger for the tracker to analyze. If you think this is a superior approach, could you please provide a recommended configuration or pipeline for a vertical top-down installation so I can compare and implement it?
Please download the files to see how its the setup until now. i use raspberry pi 4 2gb
https://we.tl/t-x4hOc324VdPc4Au3