Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend LineZone to filter out miscounts #1540

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

grzegorz-roboflow
Copy link
Contributor

@grzegorz-roboflow grzegorz-roboflow commented Sep 23, 2024

Description

LineZone is checking if line was crossed by comparing detection position relative to the line across 2 frames. This is resulting in miscounts when bbox flickers.

Below video shows difference in counts between current develop and this PR.

traffic_side_by_side.mp4

In this PR new init param is added called max_linger, which is by default set to 1 to ensure unchanged default behavior. When max_linger is set to a number greater than 1 then detection must cross on all frames in order to be counted. This results in slight delay (i.e. when max_linger is set to 10 on 10fps video then objects will be counted with 1s delay) however more accurate counts.

Type of change

  • New feature (non-breaking change which adds functionality)

How has this change been tested, please provide a testcase or example of how you tested the change?

Added unit tests

Any specific deployment considerations

N/A

Docs

I updated LineZone init docstring.

@LinasKo
Copy link
Collaborator

LinasKo commented Sep 23, 2024

Hi @grzegorz-roboflow,

I'd witnessed this but hadn't verified it. Very nice contribution yet again! I'll take some time to cehck it, especially regarding how the model IDs / edge cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants