only convert pix_fmt when necessary

This commit is contained in:
Blake Blackshear
2020-10-10 21:28:12 -05:00
parent 2a84d0afb9
commit 61081b91a3
4 changed files with 42 additions and 12 deletions

View File

@@ -260,7 +260,7 @@ class TrackedObjectProcessor(threading.Thread):
def snapshot(camera, obj):
if not 'frame' in obj:
return
best_frame = cv2.cvtColor(obj['frame'], cv2.COLOR_RGB2BGR)
best_frame = cv2.cvtColor(obj['frame'], cv2.COLOR_YUV2BGR_I420)
mqtt_config = self.camera_config[camera].get('mqtt', {'crop_to_region': False})
if mqtt_config.get('crop_to_region'):
region = obj['region']