Set mask = None when mask file was not loaded properly

This commit is contained in:
Christopher Svensson 2020-07-29 18:37:13 +02:00 committed by GitHub
parent 440feac26e
commit 12214d11b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -192,6 +192,7 @@ def track_camera(name, config, global_objects_config, frame_queue, frame_shape,
mask = cv2.imread("/config/{}".format(config['mask']), cv2.IMREAD_GRAYSCALE)
if mask.size == 0:
print("Failed to read mask file")
mask = None
else:
mask = None