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

CNT Background Subtractor False Positives and Threshold Problems #75

Open
stevegilbert23 opened this issue Feb 10, 2022 · 2 comments
Open

Comments

@stevegilbert23
Copy link

Using 1.4 on Ubuntu running under WSL2 with packaged CV lib provided by apt-get, getting unexpected behavior with -b CNT.

When processing this file:
https://www.dropbox.com/s/zjd3fwrstyon7oq/2022-01-07-14.00.19-14.03.02%5BR%5D%5B0%400%5D%5B0%5D-001.m4v?dl=0
(50 mb; too big to attach here)

using -b CNT, I am not able to find a threshold that will find only the two largest motion events, which are at 0:19 and 2:41. Above a threshold of 1.0, 5 or more events are detected but the largest motion (at 0:19) is not detected.

Using a threshold of 1.0 with the standard background subtractor, it detects only the two expected events.

When not using CNT, the detection behaves as expected: with increasing threshold values, fewer motion events are detected. Specifically with the following threshold values, the number of events detected were:
0.3 3
0.4 3
0.5 3
1.0 2
2.0 1
3.0 1

With CNT using the following threshold values, the number of events detected were:
0.3 9
0.4 8
0.5 8
1.0 7
2.0 5
3.0 7
4.0 6
5.0 5

It seems to be bouncing around but also not detecting significant motion while indicating there is motion at other places that I cannot visually detect.

I looked at other issues and did not see anything similar to this, although possibly related to default kernel size #71

@Breakthrough
Copy link
Owner

Thank you for the sample, that will be very useful for improving the CNT algorithm parameters. There's a few other options that might be able to be tweaked for the CNT method, so I'll have to look into this when I get some time. I didn't yet spend too much time looking at the subtraction result, so there might be some differences there that might warrant something other than a morphological filter for noise reduction (as is currently done for the MOG).

It's also strange as you point out that the # of events wouldn't decrease as threshold is increasing, so I'll try to generate a video of the subtracted result for those values to visually compare and will upload here when I get some time to look into this.

@Breakthrough
Copy link
Owner

Were you able to find any kernel values that provided acceptable results by the way? Could you also provide the full set of command line arguments you were using (e.g. were you using frame skip or downscale factor)?

Thanks!

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

No branches or pull requests

2 participants