Fixes issue #60

This commit is contained in:
Sushrut Shringarputale 2019-09-09 23:09:20 -04:00
parent ed833132d5
commit 26d2402655
No known key found for this signature in database
GPG key ID: 0DC253849A771D0C

View file

@ -216,7 +216,7 @@ static uint8_t otsu(const struct quirc *q)
const double m2 = ((double)sum - sumB) / q2; const double m2 = ((double)sum - sumB) / q2;
const double m1m2 = m1 - m2; const double m1m2 = m1 - m2;
const double variance = m1m2 * m1m2 * q1 * q2; const double variance = m1m2 * m1m2 * q1 * q2;
if (variance > max) { if (variance >= max) {
threshold = i; threshold = i;
max = variance; max = variance;
} }