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.
public class Detector
- Inheritance
-
Detector
- Derived
- Inherited Members
Constructors
Detector(BitMatrix)
Initializes a new instance of the Detector class.
public Detector(BitMatrix image)
Parameters
image
BitMatrixThe image.
Properties
Image
Gets the image.
protected virtual BitMatrix Image { get; }
Property Value
ResultPointCallback
Gets the result point callback.
protected virtual ResultPointCallback ResultPointCallback { get; }
Property Value
Methods
calculateModuleSize(ResultPoint, ResultPoint, ResultPoint)
Computes an average estimated module size based on estimated derived from the positions of the three finder patterns.
protected virtual float calculateModuleSize(ResultPoint topLeft, ResultPoint topRight, ResultPoint bottomLeft)
Parameters
topLeft
ResultPointdetected top-left finder pattern center
topRight
ResultPointdetected top-right finder pattern center
bottomLeft
ResultPointdetected bottom-left finder pattern center
Returns
- float
estimated module size
detect()
Detects a QR Code in an image.
public virtual DetectorResult detect()
Returns
- DetectorResult
DetectorResult encapsulating results of detecting a QR Code
detect(IDictionary<DecodeHintType, object>)
Detects a QR Code in an image.
public virtual DetectorResult detect(IDictionary<DecodeHintType, object> hints)
Parameters
hints
IDictionary<DecodeHintType, object>optional hints to detector
Returns
- DetectorResult
DetectorResult encapsulating results of detecting a QR Code
findAlignmentInRegion(float, int, int, float)
Attempts to locate an alignment pattern in a limited region of the image, which is guessed to contain it. This method uses {@link AlignmentPattern}.
protected AlignmentPattern findAlignmentInRegion(float overallEstModuleSize, int estAlignmentX, int estAlignmentY, float allowanceFactor)
Parameters
overallEstModuleSize
floatestimated module size so far
estAlignmentX
intx coordinate of center of area probably containing alignment pattern
estAlignmentY
inty coordinate of above
allowanceFactor
floatnumber of pixels in all directions to search from the center
Returns
- AlignmentPattern
AlignmentPattern if found, or null otherwise
processFinderPatternInfo(FinderPatternInfo)
Processes the finder pattern info.
protected virtual DetectorResult processFinderPatternInfo(FinderPatternInfo info)
Parameters
info
FinderPatternInfoThe info.