|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.zxing.qrcode.detector.Detector
public class Detector
Encapsulates logic that can detect a QR Code in an image, even if the QR Code is rotated or skewed, or partially obscured.
Constructor Summary | |
---|---|
Detector(BitMatrix image)
|
Method Summary | |
---|---|
protected float |
calculateModuleSize(ResultPoint topLeft,
ResultPoint topRight,
ResultPoint bottomLeft)
Computes an average estimated module size based on estimated derived from the positions of the three finder patterns. |
protected static int |
computeDimension(ResultPoint topLeft,
ResultPoint topRight,
ResultPoint bottomLeft,
float moduleSize)
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. |
static PerspectiveTransform |
createTransform(ResultPoint topLeft,
ResultPoint topRight,
ResultPoint bottomLeft,
ResultPoint alignmentPattern,
int dimension)
|
DetectorResult |
detect()
Detects a QR Code in an image, simply. |
DetectorResult |
detect(java.util.Map<DecodeHintType,?> hints)
Detects a QR Code in an image, simply. |
protected AlignmentPattern |
findAlignmentInRegion(float overallEstModuleSize,
int estAlignmentX,
int estAlignmentY,
float allowanceFactor)
Attempts to locate an alignment pattern in a limited region of the image, which is guessed to contain it. |
protected BitMatrix |
getImage()
|
protected ResultPointCallback |
getResultPointCallback()
|
protected DetectorResult |
processFinderPatternInfo(FinderPatternInfo info)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Detector(BitMatrix image)
Method Detail |
---|
protected BitMatrix getImage()
protected ResultPointCallback getResultPointCallback()
public DetectorResult detect() throws NotFoundException, FormatException
Detects a QR Code in an image, simply.
DetectorResult
encapsulating results of detecting a QR Code
NotFoundException
- if no QR Code can be found
FormatException
public DetectorResult detect(java.util.Map<DecodeHintType,?> hints) throws NotFoundException, FormatException
Detects a QR Code in an image, simply.
hints
- optional hints to detector
NotFoundException
encapsulating results of detecting a QR Code
NotFoundException
- if QR Code cannot be found
FormatException
- if a QR Code cannot be decodedprotected DetectorResult processFinderPatternInfo(FinderPatternInfo info) throws NotFoundException, FormatException
NotFoundException
FormatException
public static PerspectiveTransform createTransform(ResultPoint topLeft, ResultPoint topRight, ResultPoint bottomLeft, ResultPoint alignmentPattern, int dimension)
protected static int computeDimension(ResultPoint topLeft, ResultPoint topRight, ResultPoint bottomLeft, float moduleSize) throws NotFoundException
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.
NotFoundException
protected float calculateModuleSize(ResultPoint topLeft, ResultPoint topRight, ResultPoint bottomLeft)
Computes an average estimated module size based on estimated derived from the positions of the three finder patterns.
protected AlignmentPattern findAlignmentInRegion(float overallEstModuleSize, int estAlignmentX, int estAlignmentY, float allowanceFactor) throws NotFoundException
Attempts to locate an alignment pattern in a limited region of the image, which is
guessed to contain it. This method uses AlignmentPattern
.
overallEstModuleSize
- estimated module size so farestAlignmentX
- x coordinate of center of area probably containing alignment patternestAlignmentY
- y coordinate of aboveallowanceFactor
- number of pixels in all directions to search from the center
AlignmentPattern
if found, or null otherwise
NotFoundException
- if an unexpected error occurs during detection
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |