\Zxing\Qrcode\DetectorDetector

<p>Encapsulates logic that can detect a QR Code in an image, even if the QR Code is rotated or skewed, or partially obscured.</p>

Summary

Methods
Properties
Constants
__construct()
detect()
No public properties found
No constants found
processFinderPatternInfo()
calculateModuleSize()
findAlignmentInRegion()
getImage()
getResultPointCallback()
No protected properties found
N/A
calculateModuleSizeOneWay()
sizeOfBlackWhiteBlackRunBothWays()
sizeOfBlackWhiteBlackRun()
computeDimension()
createTransform()
sampleGrid()
$resultPointCallback
$image
N/A

Properties

$resultPointCallback

$resultPointCallback

$image

$image

Methods

__construct()

__construct(mixed  $image) : mixed

Parameters

mixed $image

Returns

mixed —

detect()

detect(mixed  $hints = null) : mixed

<p>Detects a QR Code in an image.</p>

Parameters

mixed $hints

Throws

\Zxing\NotFoundException

if QR Code cannot be found

\Zxing\FormatException

if a QR Code cannot be decoded

Returns

mixed —

processFinderPatternInfo()

processFinderPatternInfo(mixed  $info) : \Zxing\Common\DetectorResult

Parameters

mixed $info

Returns

\Zxing\Common\DetectorResult —

calculateModuleSize()

calculateModuleSize(\Zxing\Qrcode\Detector\detected  $topLeft, \Zxing\Qrcode\Detector\detected  $topRight, \Zxing\Qrcode\Detector\detected  $bottomLeft) : \Zxing\Qrcode\Detector\estimated

<p>Computes an average estimated module size based on estimated derived from the positions of the three finder patterns.</p>

Parameters

\Zxing\Qrcode\Detector\detected $topLeft

top-left finder pattern center

\Zxing\Qrcode\Detector\detected $topRight

top-right finder pattern center

\Zxing\Qrcode\Detector\detected $bottomLeft

bottom-left finder pattern center

Returns

\Zxing\Qrcode\Detector\estimated —

module size

findAlignmentInRegion()

findAlignmentInRegion(\Zxing\Qrcode\Detector\estimated  $overallEstModuleSize, \Zxing\Qrcode\Detector\x  $estAlignmentX, \Zxing\Qrcode\Detector\y  $estAlignmentY, \Zxing\Qrcode\Detector\number  $allowanceFactor) : mixed

<p>Attempts to locate an alignment pattern in a limited region of the image, which is guessed to contain it. This method uses {@link AlignmentPattern}.</p>

Parameters

\Zxing\Qrcode\Detector\estimated $overallEstModuleSize

module size so far

\Zxing\Qrcode\Detector\x $estAlignmentX

coordinate of center of area probably containing alignment pattern

\Zxing\Qrcode\Detector\y $estAlignmentY

coordinate of above

\Zxing\Qrcode\Detector\number $allowanceFactor

of pixels in all directions to search from the center

Throws

\Zxing\NotFoundException

if an unexpected error occurs during detection

Returns

mixed —

getImage()

getImage() : mixed

Returns

mixed —

getResultPointCallback()

getResultPointCallback() : mixed

Returns

mixed —

calculateModuleSizeOneWay()

calculateModuleSizeOneWay(mixed  $pattern, mixed  $otherPattern) : mixed

<p>Estimates module size based on two finder patterns -- it uses {@link #sizeOfBlackWhiteBlackRunBothWays(int, int, int, int)} to figure the width of each, measuring along the axis between their centers.</p>

Parameters

mixed $pattern
mixed $otherPattern

Returns

mixed —

sizeOfBlackWhiteBlackRunBothWays()

sizeOfBlackWhiteBlackRunBothWays(mixed  $fromX, mixed  $fromY, mixed  $toX, mixed  $toY) : mixed

See {@link #sizeOfBlackWhiteBlackRun(int, int, int, int)}; computes the total width of a finder pattern by looking for a black-white-black run from the center in the direction of another po$(another finder pattern center), and in the opposite direction too.</p>

Parameters

mixed $fromX
mixed $fromY
mixed $toX
mixed $toY

Returns

mixed —

sizeOfBlackWhiteBlackRun()

sizeOfBlackWhiteBlackRun(mixed  $fromX, mixed  $fromY, mixed  $toX, mixed  $toY) : mixed

<p>This method traces a line from a po$in the image, in the direction towards another point.

It begins in a black region, and keeps going until it finds white, then black, then white again. It reports the distance from the start to this point.

This is used when figuring out how wide a finder pattern is, when the finder pattern may be skewed or rotated.

Parameters

mixed $fromX
mixed $fromY
mixed $toX
mixed $toY

Returns

mixed —

computeDimension()

computeDimension(mixed  $topLeft, mixed  $topRight, mixed  $bottomLeft, mixed  $moduleSize) : mixed

<p>Computes the dimension (number of modules on a size) of the QR Code based on the position of the finder patterns and estimated module size.</p>

Parameters

mixed $topLeft
mixed $topRight
mixed $bottomLeft
mixed $moduleSize

Returns

mixed —

createTransform()

createTransform(mixed  $topLeft, mixed  $topRight, mixed  $bottomLeft, mixed  $alignmentPattern, mixed  $dimension) : mixed

Parameters

mixed $topLeft
mixed $topRight
mixed $bottomLeft
mixed $alignmentPattern
mixed $dimension

Returns

mixed —

sampleGrid()

sampleGrid(mixed  $image, mixed  $transform, mixed  $dimension) : mixed

Parameters

mixed $image
mixed $transform
mixed $dimension

Returns

mixed —