diff --git a/TODO.md b/TODO.md index fa178c7..a12deb1 100644 --- a/TODO.md +++ b/TODO.md @@ -69,6 +69,6 @@ These are the features actively planned for Predator and are likely to be added - [ ] Complete OpenCV dashcam recording. - [X] Improve the efficiency of GPS location requests when many requests are made in quick succession. - [ ] Test that improved GPS location querying behaves as expected. -- [ ] Kill the ALPR process every time Predator starts to ensure there are no unexpected background threads. +- [X] Kill the ALPR process every time Predator starts to ensure there are no unexpected background threads. - [ ] Re-implement object recogntion to real-time mode using the new back-end. - [ ] Re-implement image saving in real-time mode using the new-backend. diff --git a/alprstream.py b/alprstream.py index 189b3f2..fdd1801 100644 --- a/alprstream.py +++ b/alprstream.py @@ -64,14 +64,15 @@ def alpr_stream_maintainer(): # This function runs an endless loop that maintain for plate in message["results"]: # Iterate through each license plate in this line. queued_plate_reads.append(plate) # Add each license plate to the license plate queue. else: - display_message("The information returned by the ALPR engine is not valid JSON. Maybe you've specified the wrong ALPR engine in the configuration?", level=3) + display_message("The information returned by the ALPR engine is not valid JSON. Maybe you've specified the wrong ALPR engine in the configuration?", 3) def start_alpr_stream(): # This function starts the ALPR stream threads. debug_message("Starting ALPR stream ", thread="ALPRStream") save_to_file(alpr_stream_file_location, "", True) # Erase the contents of the ALPR stream file. - alpr_stream_count = 0 + alpr_stream_count = 0 # This will keep track of the number of ALPR streams running. alpr_stream_threads = {} # This is a dictionary that will hold the ALPR sub-threads. + os.popen("killall alpr") # Kill any ALPR processes that are running in the background in case they weren't terminated properly the last time Predator was run. for device in config["realtime"]["image"]["camera"]["devices"]: # Iterate through each device in the configuration. debug_message("Starting ALPR stream " + str(alpr_stream_count), thread="ALPRStreamMaintainer") print (device) diff --git a/config.json b/config.json old mode 100644 new mode 100755 index 423c004..7683b81 --- a/config.json +++ b/config.json @@ -82,8 +82,7 @@ "image": { "camera": { "devices": { - "main": "/dev/video0", - "secondary": "/dev/video2" + "primary": "/dev/video2" } } },