Skip to content

Commit

Permalink
Updated user_motion_code.py to add more parameters
Browse files Browse the repository at this point in the history
To update to latest user_motion_code move existing user_motion_code.py to another file name eg

    mv user_motion_code.py user_motion_code_bak.py

Then do a menubox.sh UPGRADE and transfer any customization from bak file
  • Loading branch information
pageauc committed Oct 13, 2021
1 parent 2901b93 commit 70478a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions speed-cam.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"""
from __future__ import print_function

progVer = "11.10" # current version of this python script
progVer = "11.20" # current version of this python script

import os
# Get information about this script including name, launch path, etc.
Expand Down Expand Up @@ -1128,8 +1128,8 @@ def speed_notify():
logging.warning("IMPORTANT: Camera is in Alignment Mode ....")
else:
if os.path.isfile(align_filename):
os.remove(align_filename)
logging.info("Removed camera alignment image at %s", align_filename)
os.remove(align_filename)
logging.info("Removed camera alignment image at %s", align_filename)

logging.info("Begin Motion Tracking .....")

Expand Down Expand Up @@ -1396,14 +1396,14 @@ def speed_camera():
int(cv2.IMWRITE_JPEG_OPTIMIZE), image_jpeg_optimize])
else:
cv2.imwrite(filename, big_image)

if motionCode:
# ===========================================
# Put your user code in userMotionCode() function
# In the File user_motion_code.py
# ===========================================
try:
user_motion_code.userMotionCode(filename)
user_motion_code.userMotionCode(vs, image_width, image_height, filename)
except ValueError:
logging.error("Problem running userMotionCode function from File %s",
userMotionFilePath)
Expand Down Expand Up @@ -1611,7 +1611,7 @@ def speed_camera():
cv2.imwrite(align_filename, image_view)
logging.info("align_cam_on=%s align_delay_sec=%i - Browser View Cam Align Image at %s", align_cam_on, align_delay_sec, align_filename)
time.sleep(align_delay_sec)


if gui_window_on:
# cv2.imshow('Difference Image',difference image)
Expand Down
2 changes: 1 addition & 1 deletion user_motion_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"""

#------------------------------------------------------------------------------
def userMotionCode(filenamePath):
def userMotionCode(vs, image_width, image_height, filenamePath):
"""
Users can put code here that needs to be run
after speed camera motion tracking and image taken
Expand Down

0 comments on commit 70478a3

Please sign in to comment.