From 0a80f95dd1d4367a2e529df31b81571a625770bf Mon Sep 17 00:00:00 2001 From: bruno-f-cruz Date: Fri, 2 Jun 2023 08:42:49 +0100 Subject: [PATCH] Scale shift value to ensure normalized output --- Bonsai.Vision/Normalize.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bonsai.Vision/Normalize.cs b/Bonsai.Vision/Normalize.cs index 111da4d20..b8184a062 100644 --- a/Bonsai.Vision/Normalize.cs +++ b/Bonsai.Vision/Normalize.cs @@ -30,7 +30,7 @@ public override IObservable Process(IObservable source) var range = max - min; var scale = range > 0 ? 1.0 / range : 0; - var shift = range > 0 ? -min : 0; + var shift = range > 0 ? -min * scale : 0; CV.ConvertScale(input, output, scale, shift); return output; });