coda_bar reader passes

This commit is contained in:
Henry Schimke
2022-12-03 11:43:27 -06:00
parent 419f573f5d
commit 34e2473a5d
13 changed files with 1020 additions and 823 deletions

View File

@@ -85,9 +85,9 @@ impl Binarizer for GlobalHistogramBinarizer {
let mut center = localLuminances[1]; // & 0xff;
for x in 1..width - 1 {
// for (int x = 1; x < width - 1; x++) {
let right = localLuminances[x + 1] & 0xff;
let right = localLuminances[x + 1];
// A simple -1 4 -1 box filter with a weight of 2.
if ((center * 4) - left - right) as u32 / 2 < blackPoint {
if ((center as i64 * 4) - left as i64 - right as i64) / 2 < blackPoint as i64 {
row.set(x);
}
left = center;