Merge pull request #62 from sushshring/master

Fixes issue #60
This commit is contained in:
Daniel Beer 2019-09-10 15:33:52 +12:00 committed by GitHub
commit f27a7c2c75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}