This commit is contained in:
smiley
2023-03-11 19:15:41 +01:00
parent 63056190f7
commit 2f0b169039
+3 -4
View File
@@ -204,12 +204,11 @@ final class Binarizer{
* @see http://groups.google.com/group/zxing/browse_thread/thread/d06efa2c35a7ddc0
*/
private function calculateBlackPoints(int $subWidth, int $subHeight, int $width, int $height):array{
$blackPoints = [];
$blackPoints = array_fill(0, $subHeight, array_fill(0, $subWidth, 0));
for($y = 0; $y < $subHeight; $y++){
$yoffset = ($y << self::BLOCK_SIZE_POWER);
$maxYOffset = ($height - self::BLOCK_SIZE);
$blackPoints[$y] = [];
$yoffset = ($y << self::BLOCK_SIZE_POWER);
$maxYOffset = ($height - self::BLOCK_SIZE);
if($yoffset > $maxYOffset){
$yoffset = $maxYOffset;