From 053a99104cde1d397beb8c3bfc40409765563bff Mon Sep 17 00:00:00 2001 From: Sleevezipper Date: Sun, 3 Jan 2021 23:14:14 +0100 Subject: [PATCH] reverse webcam values --- .../Domain/Sensors/WebcamActiveSensor.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hass-workstation-service/Domain/Sensors/WebcamActiveSensor.cs b/hass-workstation-service/Domain/Sensors/WebcamActiveSensor.cs index aa86cf9..a595508 100644 --- a/hass-workstation-service/Domain/Sensors/WebcamActiveSensor.cs +++ b/hass-workstation-service/Domain/Sensors/WebcamActiveSensor.cs @@ -31,17 +31,19 @@ namespace hass_workstation_service.Domain.Sensors { VideoCapture capture = new VideoCapture(0); OutputArray image = OutputArray.Create(new Mat()); + + // capture.Read() return false if it doesn't succeed in capturing if (capture.Read(image)) { capture.Release(); capture.Dispose(); - return true; + return false; } else { capture.Release(); capture.Dispose(); - return false; + return true; } }