\Zxing\Common\DetectorMonochromeRectangleDetector

<p>A somewhat generic detector that looks for a barcode-like rectangular region within an image.

It looks within a mostly white region of an image for a region of black and white, but mostly black. It returns the four corners of the region, as best it can determine.

Summary

Methods
Properties
Constants
__construct()
detect()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
findCornerFromCenter()
blackWhiteRange()
$MAX_MODULES
$image
N/A

Properties

$MAX_MODULES

$MAX_MODULES : 

Type

$image

$image : 

Type

Methods

detect()

detect() : \Zxing\Common\Detector\{@link

<p>Detects a rectangular region of black and white -- mostly black -- with a region of mostly white, in an image.</p>

Throws

\Zxing\NotFoundException

if no Data Matrix Code can be found

Returns

\Zxing\Common\Detector\{@link —

ResultPoint}[] describing the corners of the rectangular region. The first and last points are opposed on the diagonal, as are the second and third. The first point will be the topmost point and the last, the bottommost. The second point will be leftmost and the third, the rightmost

findCornerFromCenter()

findCornerFromCenter(float  $centerX, float  $deltaX, float  $left, float  $right, float  $centerY, float  $deltaY, float  $top, float  $bottom, float  $maxWhiteRun) : \Zxing\ResultPoint

Attempts to locate a corner of the barcode by scanning up, down, left or right from a center point which should be within the barcode.

Parameters

float $centerX

center's x component (horizontal)

float $deltaX

same as deltaY but change in x per step instead

float $left

minimum value of x

float $right

maximum value of x

float $centerY

center's y component (vertical)

float $deltaY

change in y per step. If scanning up this is negative; down, positive; left or right, 0

float $top

minimum value of y to search through (meaningless when di == 0)

float $bottom

maximum value of y

float $maxWhiteRun

maximum run of white pixels that can still be considered to be within the barcode

Throws

\Zxing\NotFoundException

if such a point cannot be found

Returns

\Zxing\ResultPoint

$a {@link com.google.zxing.ResultPoint} encapsulating the corner that was found

blackWhiteRange()

blackWhiteRange(  $fixedDimension,   $maxWhiteRun,   $minDim,   $maxDim,   $horizontal) : array<mixed,integer>

Computes the start and end of a region of pixels, either horizontally or vertically, that could be part of a Data Matrix barcode.

Parameters

$fixedDimension
$maxWhiteRun
$minDim
$maxDim
$horizontal

Returns

array<mixed,integer> —

with start and end of found range, or null if no such range is found (e.g. only white was found)