Class MultiFinderPatternFinder
- java.lang.Object
-
- com.google.zxing.qrcode.detector.FinderPatternFinder
-
- com.google.zxing.multi.qrcode.detector.MultiFinderPatternFinder
-
public final class MultiFinderPatternFinder extends FinderPatternFinder
This class attempts to find finder patterns in a QR Code. Finder patterns are the square markers at three corners of a QR Code.
This class is thread-safe but not reentrant. Each thread must allocate its own object.
In contrast to
FinderPatternFinder
, this class will return an array of all possible QR code locations in the image.Use the TRY_HARDER hint to ask for a more thorough detection.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
MultiFinderPatternFinder.ModuleSizeComparator
A comparator that orders FinderPatterns by their estimated module size.
-
Field Summary
Fields Modifier and Type Field Description private static float
DIFF_MODSIZE_CUTOFF
More or less arbitrary cutoff point for determining if two finder patterns might belong to the same code if they differ less than DIFF_MODSIZE_CUTOFF pixels/module in their estimated modules sizes.private static float
DIFF_MODSIZE_CUTOFF_PERCENT
More or less arbitrary cutoff point for determining if two finder patterns might belong to the same code if they differ less than DIFF_MODSIZE_CUTOFF_PERCENT percent in their estimated modules sizes.private static FinderPattern[][]
EMPTY_FP_2D_ARRAY
private static FinderPattern[]
EMPTY_FP_ARRAY
private static FinderPatternInfo[]
EMPTY_RESULT_ARRAY
private static float
MAX_MODULE_COUNT_PER_EDGE
private static float
MIN_MODULE_COUNT_PER_EDGE
-
Fields inherited from class com.google.zxing.qrcode.detector.FinderPatternFinder
MAX_MODULES, MIN_SKIP
-
-
Constructor Summary
Constructors Constructor Description MultiFinderPatternFinder(BitMatrix image, ResultPointCallback resultPointCallback)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FinderPatternInfo[]
findMulti(java.util.Map<DecodeHintType,?> hints)
private FinderPattern[][]
selectMultipleBestPatterns()
-
Methods inherited from class com.google.zxing.qrcode.detector.FinderPatternFinder
clearCounts, doClearCounts, doShiftCounts2, foundPatternCross, foundPatternDiagonal, getImage, getPossibleCenters, handlePossibleCenter, handlePossibleCenter, shiftCounts2
-
-
-
-
Field Detail
-
EMPTY_RESULT_ARRAY
private static final FinderPatternInfo[] EMPTY_RESULT_ARRAY
-
EMPTY_FP_ARRAY
private static final FinderPattern[] EMPTY_FP_ARRAY
-
EMPTY_FP_2D_ARRAY
private static final FinderPattern[][] EMPTY_FP_2D_ARRAY
-
MAX_MODULE_COUNT_PER_EDGE
private static final float MAX_MODULE_COUNT_PER_EDGE
- See Also:
- Constant Field Values
-
MIN_MODULE_COUNT_PER_EDGE
private static final float MIN_MODULE_COUNT_PER_EDGE
- See Also:
- Constant Field Values
-
DIFF_MODSIZE_CUTOFF_PERCENT
private static final float DIFF_MODSIZE_CUTOFF_PERCENT
More or less arbitrary cutoff point for determining if two finder patterns might belong to the same code if they differ less than DIFF_MODSIZE_CUTOFF_PERCENT percent in their estimated modules sizes.- See Also:
- Constant Field Values
-
DIFF_MODSIZE_CUTOFF
private static final float DIFF_MODSIZE_CUTOFF
More or less arbitrary cutoff point for determining if two finder patterns might belong to the same code if they differ less than DIFF_MODSIZE_CUTOFF pixels/module in their estimated modules sizes.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MultiFinderPatternFinder
public MultiFinderPatternFinder(BitMatrix image, ResultPointCallback resultPointCallback)
-
-
Method Detail
-
selectMultipleBestPatterns
private FinderPattern[][] selectMultipleBestPatterns() throws NotFoundException
- Returns:
- the 3 best
FinderPattern
s from our list of candidates. The "best" are those that have been detected at least 2 times, and whose module size differs from the average among those patterns the least - Throws:
NotFoundException
- if 3 such finder patterns do not exist
-
findMulti
public FinderPatternInfo[] findMulti(java.util.Map<DecodeHintType,?> hints) throws NotFoundException
- Throws:
NotFoundException
-
-