From cf2a406a8a2a46b0ea5494959c0e454496c49bc6 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 4 Sep 2021 19:14:02 +0200 Subject: tracker/pt: don't use grayscale with color key selected --- tracker-pt/module/camera.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tracker-pt/module/camera.cpp b/tracker-pt/module/camera.cpp index 5c15dba8..19c0c222 100644 --- a/tracker-pt/module/camera.cpp +++ b/tracker-pt/module/camera.cpp @@ -107,7 +107,14 @@ bool Camera::start(const pt_settings& s) info.width = res_x; info.height = res_y; info.use_mjpeg = use_mjpeg; - info.num_channels = 1; + switch (*s.blob_color) + { + case pt_color_natural: + case pt_color_average: + info.num_channels = 1; break; + default: + info.num_channels = 3; break; + } if (!cap->start(info)) goto fail; -- cgit v1.2.3