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

Vehicles at higher speeds being missed. #164

Open
a113speederbot opened this issue Mar 17, 2024 · 4 comments
Open

Vehicles at higher speeds being missed. #164

a113speederbot opened this issue Mar 17, 2024 · 4 comments

Comments

@a113speederbot
Copy link

a113speederbot commented Mar 17, 2024

Hi there,

I'm confident that everything is configured correctly, and largely it appears that speeds are being logged accurately (based on slow moving vehicles and pedestrians). The only problem I have is that it seems to be missing vehicles at higher speeds. My camera is fixed to the window itself, the lens isn't touching the window but is only a couple off mm away. The camera is about 9.5 m (31 ft) away from R2L and 12 m (39 ft)away from L2R. Is there anything glaringly wrong with this as regards physical positioning that you can see?

Thanks again for an awesome project.

EDIT: Adding recent logs in case they help. Also, I have driven my car past at the speed limit many times and it's never been captured.

2024-03-22 22:15:27 INFO     speed_camera  Add - 1/10 xy(107,54) 7.30 mph D=20/20 C=2 48x14=672 sqpx L2R
2024-03-22 22:15:27 INFO     speed_camera  Add - 2/10 xy(127,54) 18.26 mph D=20/20 C=2 46x14=644 sqpx L2R
2024-03-22 22:15:27 INFO     speed_camera  Out - 2/10 xy(70,49) Max D=57>=20px C=2 46x14=644 sqpx L2R
2024-03-22 22:15:27 INFO     speed_camera  Add - 3/10 xy(89,48) 13.93 mph D=19/20 C=2 45x15=675 sqpx L2R
2024-03-22 22:15:28 INFO     speed_camera  Add - 4/10 xy(107,46) 20.13 mph D=18/20 C=2 44x17=748 sqpx L2R
2024-03-22 22:15:28 INFO     speed_camera  Add - 5/10 xy(125,44) 26.33 mph D=18/20 C=1 43x19=817 sqpx L2R
2024-03-22 22:15:43 INFO     speed_camera Reset- event_timer 15.74>0.30 sec Exceeded
----------------------------------------------------------------------
2024-03-22 22:15:43 INFO     speed_camera New  - 0/10 xy(71,56) Start New Track
2024-03-22 22:15:44 INFO     speed_camera  Out - 0/10 xy(45,56) Max D=26>=20px C=1 65x15=975 sqpx R2L
2024-03-22 22:15:44 INFO     speed_camera  Out - 0/10 xy(139,53) Max D=94>=20px C=2 24x9=216 sqpx L2R
2024-03-22 22:15:44 INFO     speed_camera  Out - 0/10 xy(111,53) Max D=28>=20px C=2 49x10=490 sqpx L2R
2024-03-22 22:15:44 INFO     speed_camera  Out - 0/10 xy(86,52) Max D=25>=20px C=2 50x11=550 sqpx L2R
2024-03-22 22:15:44 INFO     speed_camera  Out - 0/10 xy(58,51) Max D=28>=20px C=1 54x12=648 sqpx R2L
2024-03-22 22:15:44 INFO     speed_camera  Out - 0/10 xy(31,50) Max D=27>=20px C=1 56x14=784 sqpx R2L
2024-03-22 22:15:51 INFO     speed_camera Reset- event_timer 7.31>0.30 sec Exceeded
----------------------------------------------------------------------
2024-03-22 22:15:51 INFO     speed_camera New  - 0/10 xy(65,57) Start New Track
2024-03-22 22:15:51 INFO     speed_camera  Out - 0/10 xy(35,57) Max D=30>=20px C=3 68x19=1292 sqpx R2L
2024-03-22 22:15:51 INFO     speed_camera  Out - 0/10 xy(102,54) Max D=67>=20px C=2 49x12=588 sqpx L2R
2024-03-22 22:15:51 INFO     speed_camera  Out - 0/10 xy(72,55) Max D=30>=20px C=2 52x10=520 sqpx L2R
2024-03-22 22:15:52 INFO     speed_camera  Out - 0/10 xy(42,55) Max D=30>=20px C=2 54x10=540 sqpx R2L```
@SamDecrock
Copy link

SamDecrock commented Mar 23, 2024

You can increase MO_MAX_X_DIFF_PX so it's above the numbers you are seeing here

Max D=30>=20px
Max D=67>=20px
Max D=30>=20px
Max D=30>=20px

If cars move really fast, the difference in position between 'frames' is bigger. This variable is about that.

@brewtide
Copy link

Another aspect to this is what camera you are using to feed it the data. My homebrew situation is using RTSP to stream data from firmware modified wyze cams. These have a less than stellar frame rate which shows itself when dealing with higher speeds. The jump between version 1 of the cam and version 2 was large enough to make it effectively work. (I think wyze cam v1 is like 15 or 18FPS) and version 2 is nearing 25 FPS.

If you're running something like a picam, likely the framerate is not the problem.

@a113speederbot
Copy link
Author

You can increase MO_MAX_X_DIFF_PX so it's above the numbers you are seeing here

Max D=30>=20px
Max D=67>=20px
Max D=30>=20px
Max D=30>=20px

If cars move really fast, the difference in position between 'frames' is bigger. This variable is about that.

@SamDecrock, many thanks for your help here. Adjusting that setting certainly improves things, giving me many fewer 'Outs'. I'd be interested in what you'd suggest as setting adjustments; 10 px at a time, a few px at a time? Any ideas? I am also noticing lots of timeouts.

Thanks for explaining this to me.

@a113speederbot
Copy link
Author

a113speederbot commented Mar 25, 2024

Another aspect to this is what camera you are using to feed it the data. My homebrew situation is using RTSP to stream data from firmware modified wyze cams. These have a less than stellar frame rate which shows itself when dealing with higher speeds. The jump between version 1 of the cam and version 2 was large enough to make it effectively work. (I think wyze cam v1 is like 15 or 18FPS) and version 2 is nearing 25 FPS.

If you're running something like a picam, likely the framerate is not the problem.

Thank you, @brewtide for this info. Luckily I am running a RPi module 3 camera at 30 fps, so I shouldn't have to worry about this. Thanks for raising the issue though as its there to help anyone else and handy for me to know.

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

No branches or pull requests

3 participants