pageauc / speed-camera

A Unix, Windows, Raspberry Pi Object Speed Camera using python, opencv, video streaming, motion tracking. Includes a Standalone Web Server Interface, Image Search using opencv template match and a whiptail Admin Menu Interface Includes picam and webcam Plugins for motion track security camera configuration including rclone sync script. watch-app allows remotely controller camera configuration from a remote storage service name. Uses sqlite3 and gnuplot for reporting. Recently added openalpr license plate reader support.
Apache License 2.0
987 stars 173 forks source link

Cannot change SPEED_MPH to MPH #43

Closed jeffreypkelly closed 5 years ago

jeffreypkelly commented 5 years ago

Hi, Can you help me? I would like speeds in MPH I have set SPEED_MPH = True, but I still get speeds in kph. Is there something else I have to set?

TY! Jeff

pageauc commented 5 years ago

Did you stop and restart speed camera. This can be done using menubox.sh. When settings are changed you must restart the app. Claude ...

On Fri, Oct 18, 2019 at 8:06 AM jeffreypkelly notifications@github.com wrote:

Hi, Can you help me? I would like speeds in MPH I have set SPEED_MPH = True, but I still get speeds in kph. Is there something else I have to set?

TY! Jeff

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pageauc/speed-camera/issues/43?email_source=notifications&email_token=ABNPKZEYQDWEAZ4OQOHWJW3QPGRF7A5CNFSM4JCGQH3KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HSXKBXQ, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPKZFAWJ7DAPVNSMYEZFTQPGRF7ANCNFSM4JCGQH3A .

-- See my YouTube Channel at http://www.youtube.com/user/pageaucp

jeffreypkelly commented 5 years ago

Thank you - all working now!

jeffreypkelly commented 5 years ago

One more question, please. I cannot find the y_upper, y_lower, x_left, x_right settings in the config.py file. I would like to reduce the height of the box. Are they located in another file?

pageauc commented 5 years ago

Due to some users wanting to use IP camera's and the hassle of putting values in plugins, I now auto detect image resolution (mainly for IP camera streams) and auto calculate the motion tracking cropped image box. This code can be found at approx line 1568 of latest release of speed-cam.py. I can add a feature to override this auto calculation but it would be up to the user to supply the correct values. The current version just takes the stream image width and height and sets a fraction of the w or h to set the motion box borders. Separate values for images GT width 1000 px. Otherwise you could play around with the code x_scale and y_scale values as appropriate or just override values by putting new values below auto calculation. This however would have to be redone after an upgrade (big hassle)

Suggested code is below That would override x or y settings if the variables are found in the config.py file otherwise auto calculation would set the values This would allow setting x or y separately and have the other auto calculate or set both and have no auto calculate

try: x_left x_right except NameError: x_left = int(img_width / x_scale) x_right = int(img_width - x_left)

try: y_upper y_lower except NameError: y_upper = int(img_height / y_scale) y_lower = int(img_height - y_upper)

If you really need this override feature let me know. Claude ...

On Sat, Oct 19, 2019 at 7:52 AM jeffreypkelly notifications@github.com wrote:

One more question, please. I cannot find the y_upper, y_lower, x_left, x_right settings in the config.py file. I would like to reduce the height of the box. Are they located in another file?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pageauc/speed-camera/issues/43?email_source=notifications&email_token=ABNPKZD7E4WY2ETMFLIZAUTQPLYG3A5CNFSM4JCGQH3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBXNTXA#issuecomment-544135644, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPKZG6VUHLDJLILYTMJZ3QPLYG3ANCNFSM4JCGQH3A .

-- See my YouTube Channel at http://www.youtube.com/user/pageaucp

pageauc commented 5 years ago

I have release speed-cam.py ver 10.0 including new config.py with comments for overriding motion tracking crop detection area on images. It will be the users responsibility to make sure custom values are within image size.

You can upgrade using menubox.sh UPGRADE menu option. The updated config.py will be named config.py.new See instructions at end of upgrade regarding backup and copy of new config.py

Please test and let me know if everything is OK

Claude ...

On Sat, Oct 19, 2019 at 9:34 AM Claude Pageau pageauc@gmail.com wrote:

Due to some users wanting to use IP camera's and the hassle of putting values in plugins, I now auto detect image resolution (mainly for IP camera streams) and auto calculate the motion tracking cropped image box. This code can be found at approx line 1568 of latest release of speed-cam.py. I can add a feature to override this auto calculation but it would be up to the user to supply the correct values. The current version just takes the stream image width and height and sets a fraction of the w or h to set the motion box borders. Separate values for images GT width 1000 px. Otherwise you could play around with the code x_scale and y_scale values as appropriate or just override values by putting new values below auto calculation. This however would have to be redone after an upgrade (big hassle)

Suggested code is below That would override x or y settings if the variables are found in the config.py file otherwise auto calculation would set the values This would allow setting x or y separately and have the other auto calculate or set both and have no auto calculate

try: x_left x_right except NameError: x_left = int(img_width / x_scale) x_right = int(img_width - x_left)

try: y_upper y_lower except NameError: y_upper = int(img_height / y_scale) y_lower = int(img_height - y_upper)

If you really need this override feature let me know. Claude ...

On Sat, Oct 19, 2019 at 7:52 AM jeffreypkelly notifications@github.com wrote:

One more question, please. I cannot find the y_upper, y_lower, x_left, x_right settings in the config.py file. I would like to reduce the height of the box. Are they located in another file?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pageauc/speed-camera/issues/43?email_source=notifications&email_token=ABNPKZD7E4WY2ETMFLIZAUTQPLYG3A5CNFSM4JCGQH3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBXNTXA#issuecomment-544135644, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPKZG6VUHLDJLILYTMJZ3QPLYG3ANCNFSM4JCGQH3A .

-- See my YouTube Channel at http://www.youtube.com/user/pageaucp

-- See my YouTube Channel at http://www.youtube.com/user/pageaucp

jeffreypkelly commented 5 years ago

Worked perfect! TY! Jeff

On Oct 19, 2019, at 10:33 AM, Claude Pageau notifications@github.com wrote:

I have release speed-cam.py ver 10.0 including new config.py with comments for overriding motion tracking crop detection area on images. It will be the users responsibility to make sure custom values are within image size.

You can upgrade using menubox.sh UPGRADE menu option. The updated config.py will be named config.py.new See instructions at end of upgrade regarding backup and copy of new config.py

Please test and let me know if everything is OK

Claude ...

On Sat, Oct 19, 2019 at 9:34 AM Claude Pageau pageauc@gmail.com wrote:

Due to some users wanting to use IP camera's and the hassle of putting values in plugins, I now auto detect image resolution (mainly for IP camera streams) and auto calculate the motion tracking cropped image box. This code can be found at approx line 1568 of latest release of speed-cam.py. I can add a feature to override this auto calculation but it would be up to the user to supply the correct values. The current version just takes the stream image width and height and sets a fraction of the w or h to set the motion box borders. Separate values for images GT width 1000 px. Otherwise you could play around with the code x_scale and y_scale values as appropriate or just override values by putting new values below auto calculation. This however would have to be redone after an upgrade (big hassle)

Suggested code is below That would override x or y settings if the variables are found in the config.py file otherwise auto calculation would set the values This would allow setting x or y separately and have the other auto calculate or set both and have no auto calculate

try: x_left x_right except NameError: x_left = int(img_width / x_scale) x_right = int(img_width - x_left)

try: y_upper y_lower except NameError: y_upper = int(img_height / y_scale) y_lower = int(img_height - y_upper)

If you really need this override feature let me know. Claude ...

On Sat, Oct 19, 2019 at 7:52 AM jeffreypkelly notifications@github.com wrote:

One more question, please. I cannot find the y_upper, y_lower, x_left, x_right settings in the config.py file. I would like to reduce the height of the box. Are they located in another file?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/pageauc/speed-camera/issues/43?email_source=notifications&email_token=ABNPKZD7E4WY2ETMFLIZAUTQPLYG3A5CNFSM4JCGQH3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBXNTXA#issuecomment-544135644, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABNPKZG6VUHLDJLILYTMJZ3QPLYG3ANCNFSM4JCGQH3A .

-- See my YouTube Channel at http://www.youtube.com/user/pageaucp

-- See my YouTube Channel at http://www.youtube.com/user/pageaucp — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pageauc/speed-camera/issues/43?email_source=notifications&email_token=AIGIVPZO42MVKWALR4V72UDQPMLDPA5CNFSM4JCGQH3KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBXRWFA#issuecomment-544152340, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIGIVP2P4VZOMAHMNTDMGLTQPMLDPANCNFSM4JCGQH3A.