HybridBinarizer.java (zxing-zxing-3.4.0) | : | HybridBinarizer.java (zxing-zxing-3.4.1) | ||
---|---|---|---|---|
skipping to change at line 134 | skipping to change at line 134 | |||
int[] blackRow = blackPoints[top + z]; | int[] blackRow = blackPoints[top + z]; | |||
sum += blackRow[left - 2] + blackRow[left - 1] + blackRow[left] + blac kRow[left + 1] + blackRow[left + 2]; | sum += blackRow[left - 2] + blackRow[left - 1] + blackRow[left] + blac kRow[left + 1] + blackRow[left + 2]; | |||
} | } | |||
int average = sum / 25; | int average = sum / 25; | |||
thresholdBlock(luminances, xoffset, yoffset, average, width, matrix); | thresholdBlock(luminances, xoffset, yoffset, average, width, matrix); | |||
} | } | |||
} | } | |||
} | } | |||
private static int cap(int value, int max) { | private static int cap(int value, int max) { | |||
return value < 2 ? 2 : value > max ? max : value; | return value < 2 ? 2 : Math.min(value, max); | |||
} | } | |||
/** | /** | |||
* Applies a single threshold to a block of pixels. | * Applies a single threshold to a block of pixels. | |||
*/ | */ | |||
private static void thresholdBlock(byte[] luminances, | private static void thresholdBlock(byte[] luminances, | |||
int xoffset, | int xoffset, | |||
int yoffset, | int yoffset, | |||
int threshold, | int threshold, | |||
int stride, | int stride, | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added |