mirror of
https://github.com/zxing/zxing.git
synced 2024-11-10 04:54:04 -08:00
Made a small performance tweak (about 1% faster).
git-svn-id: https://zxing.googlecode.com/svn/trunk@1158 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
5cc1df3c92
commit
e779586745
|
@ -95,11 +95,12 @@ public final class HybridBinarizer extends GlobalHistogramBinarizer {
|
|||
top = (top < subHeight - 2) ? top : subHeight - 3;
|
||||
int sum = 0;
|
||||
for (int z = -2; z <= 2; z++) {
|
||||
sum += blackPoints[top + z][left - 2];
|
||||
sum += blackPoints[top + z][left - 1];
|
||||
sum += blackPoints[top + z][left];
|
||||
sum += blackPoints[top + z][left + 1];
|
||||
sum += blackPoints[top + z][left + 2];
|
||||
int[] blackRow = blackPoints[top + z];
|
||||
sum += blackRow[left - 2];
|
||||
sum += blackRow[left - 1];
|
||||
sum += blackRow[left];
|
||||
sum += blackRow[left + 1];
|
||||
sum += blackRow[left + 2];
|
||||
}
|
||||
int average = sum / 25;
|
||||
threshold8x8Block(luminances, x << 3, y << 3, average, stride, matrix);
|
||||
|
|
Loading…
Reference in a new issue