NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
fix: handle custom logo images without alpha channel (#22468)
ryzendigo49ffd0b01a2f
diff --git a/frigate/output/birdseye.py b/frigate/output/birdseye.pyindex 05d72be6a0..5d80de33cf 100644--- a/frigate/output/birdseye.py+++ b/frigate/output/birdseye.py@@ -303,12 +303,20 @@ class BirdsEyeFrameManager:birdseye_logo = cv2.imread(logo_files[0], cv2.IMREAD_UNCHANGED)if birdseye_logo is not None:- transparent_layer = birdseye_logo[:, :, 3]+ if birdseye_logo.ndim == 2:+ # Grayscale image (no channels) — use directly as luminance+ transparent_layer = birdseye_logo+ elif birdseye_logo.shape[2] >= 4:+ # RGBA — use alpha channel as luminance+ transparent_layer = birdseye_logo[:, :, 3]+ else:+ # RGB or other format without alpha — convert to grayscale+ transparent_layer = cv2.cvtColor(birdseye_logo, cv2.COLOR_BGR2GRAY)y_offset = height // 2 - transparent_layer.shape[0] // 2x_offset = width // 2 - transparent_layer.shape[1] // 2self.blank_frame[- y_offset : y_offset + transparent_layer.shape[1],- x_offset : x_offset + transparent_layer.shape[0],+ y_offset : y_offset + transparent_layer.shape[0],+ x_offset : x_offset + transparent_layer.shape[1],] = transparent_layerelse:logger.warning("Unable to read Frigate logo")