From 26d24026559cb9b4ad719d7c47f691a6dd2e6dc8 Mon Sep 17 00:00:00 2001 From: Sushrut Shringarputale Date: Mon, 9 Sep 2019 23:09:20 -0400 Subject: [PATCH] Fixes issue #60 --- lib/identify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/identify.c b/lib/identify.c index 2259614..8b28856 100644 --- a/lib/identify.c +++ b/lib/identify.c @@ -216,7 +216,7 @@ static uint8_t otsu(const struct quirc *q) const double m2 = ((double)sum - sumB) / q2; const double m1m2 = m1 - m2; const double variance = m1m2 * m1m2 * q1 * q2; - if (variance > max) { + if (variance >= max) { threshold = i; max = variance; }