$MIN_SKIP
$MIN_SKIP
<p>This class attempts to find finder patterns in a QR Code. Finder patterns are the square markers at three corners of a QR Code.</p>
This class is thread-safe but not reentrant. Each thread must allocate its own object.
Summary
find()
FurthestFromAverageComparator()
CenterComparator()
handlePossibleCenter()
getImage()
getPossibleCenters()
$MAX_MODULES
crossCheckVertical()
getCrossCheckStateCount()
crossCheckHorizontal()
crossCheckDiagonal()
haveMultiplyConfirmedCenters()
findRowSkip()
selectBestPatterns()
$image
$average
$possibleCenters
$hasSkipped
$crossCheckStateCount
$resultPointCallback
handlePossibleCenter( $stateCount, mixed $i, mixed $j, mixed $pureBarcode) : true
<p>This is called when a horizontal scan finds a possible alignment pattern. It will cross check with a vertical scan, and if successful, will, ah, cross-cross-check with another horizontal scan. This is needed primarily to locate the real horizontal center of the pattern in cases of extreme skew.
And then we cross-cross-cross check with another diagonal scan.
If that succeeds the finder pattern location is added to a list that tracks the number of times each location has been nearly-matched as a finder pattern. Each additional find is more evidence that the location is in fact a finder pattern center
$stateCount | reading state module counts from horizontal scan |
|
mixed | $i | |
mixed | $j | |
mixed | $pureBarcode |
if a finder pattern candidate was found this time
crossCheckVertical( $startI, mixed $centerJ, $maxCount, mixed $originalStateCountTotal) : \Zxing\Qrcode\Detector\vertical
<p>After a horizontal scan finds a potential finder pattern, this method "cross-checks" by scanning down vertically through the center of the possible finder pattern to see if the same proportion is detected.</p>
$startI | ; row where a finder pattern was detected |
|
mixed | $centerJ | |
$maxCount | ; maximum reasonable number of modules that should be observed in any reading state, based on the results of the horizontal scan |
|
mixed | $originalStateCountTotal |
center of finder pattern, or {@link Float#NaN} if not found
crossCheckHorizontal(mixed $startJ, mixed $centerI, mixed $maxCount, mixed $originalStateCountTotal) : mixed
<p>Like {@link #crossCheckVertical(int, int, int, int)}, and in fact is basically identical, except it reads horizontally instead of vertically. This is used to cross-cross check a vertical cross check and locate the real center of the alignment pattern.</p>
mixed | $startJ | |
mixed | $centerI | |
mixed | $maxCount | |
mixed | $originalStateCountTotal |
crossCheckDiagonal( $startI, mixed $centerJ, $maxCount, mixed $originalStateCountTotal) : true
After a vertical and horizontal scan finds a potential finder pattern, this method "cross-cross-cross-checks" by scanning down diagonally through the center of the possible finder pattern to see if the same proportion is detected.
$startI | ; row where a finder pattern was detected |
|
mixed | $centerJ | |
$maxCount | ; maximum reasonable number of modules that should be observed in any reading state, based on the results of the horizontal scan |
|
mixed | $originalStateCountTotal |
if proportions are withing expected limits
findRowSkip() : \Zxing\Qrcode\Detector\number
of rows we could safely skip during scanning, based on the first two finder patterns that have been located. In some cases their position will allow us to infer that the third pattern must lie below a certain point farther down in the image.
selectBestPatterns() : array
if 3 such finder patterns do not exist
the 3 best {@link FinderPattern}s from our list of candidates. The "best" are those that have been detected at least {@link #CENTER_QUORUM} times, and whose module size differs from the average among those patterns the least