Class FinderPatternFinder
- Direct Known Subclasses:
- MultiFinderPatternFinder
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.
- Author:
- Sean Owen
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final intprotected static final int
- 
Constructor SummaryConstructorsConstructorDescriptionFinderPatternFinder(BitMatrix image) Creates a finder that will search the image for three finder patterns.FinderPatternFinder(BitMatrix image, ResultPointCallback resultPointCallback) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected final voidclearCounts(int[] counts) Deprecated.protected static voiddoClearCounts(int[] counts) protected static voiddoShiftCounts2(int[] stateCount) protected static booleanfoundPatternCross(int[] stateCount) protected static booleanfoundPatternDiagonal(int[] stateCount) protected final BitMatrixgetImage()protected final List<FinderPattern>protected final booleanhandlePossibleCenter(int[] stateCount, int i, int j) This is called when a horizontal scan finds a possible alignment pattern.protected final booleanhandlePossibleCenter(int[] stateCount, int i, int j, boolean pureBarcode) Deprecated.only exists for backwards compatibilityprotected final voidshiftCounts2(int[] stateCount) Deprecated.
- 
Field Details- 
MIN_SKIPprotected static final int MIN_SKIP- See Also:
 
- 
MAX_MODULESprotected static final int MAX_MODULES- See Also:
 
 
- 
- 
Constructor Details- 
FinderPatternFinderCreates a finder that will search the image for three finder patterns. - Parameters:
- image- image to search
 
- 
FinderPatternFinder
 
- 
- 
Method Details- 
getImage
- 
getPossibleCenters
- 
foundPatternCrossprotected static boolean foundPatternCross(int[] stateCount) - Parameters:
- stateCount- count of black/white/black/white/black pixels just read
- Returns:
- true iff the proportions of the counts is close enough to the 1/1/3/1/1 ratios used by finder patterns to be considered a match
 
- 
foundPatternDiagonalprotected static boolean foundPatternDiagonal(int[] stateCount) - Parameters:
- stateCount- count of black/white/black/white/black pixels just read
- Returns:
- true iff the proportions of the counts is close enough to the 1/1/3/1/1 ratios used by finder patterns to be considered a match
 
- 
clearCountsDeprecated.
- 
shiftCounts2Deprecated.
- 
doClearCountsprotected static void doClearCounts(int[] counts) 
- 
doShiftCounts2protected static void doShiftCounts2(int[] stateCount) 
- 
handlePossibleCenter@Deprecated protected final boolean handlePossibleCenter(int[] stateCount, int i, int j, boolean pureBarcode) Deprecated.only exists for backwards compatibility- Parameters:
- stateCount- reading state module counts from horizontal scan
- i- row where finder pattern may be found
- j- end of possible finder pattern in row
- pureBarcode- ignored
- Returns:
- true if a finder pattern candidate was found this time
- See Also:
 
- 
handlePossibleCenterprotected final boolean handlePossibleCenter(int[] stateCount, int i, int j) This is called when a horizontal scan finds a possible alignment pattern. It will cross check with a vertical scan, and if successful, will, ah, cross-cross-check with another horizontal scan. This is needed primarily to locate the real horizontal center of the pattern in cases of extreme skew. And then we cross-cross-cross check with another diagonal scan. If that succeeds the finder pattern location is added to a list that tracks the number of times each location has been nearly-matched as a finder pattern. Each additional find is more evidence that the location is in fact a finder pattern center - Parameters:
- stateCount- reading state module counts from horizontal scan
- i- row where finder pattern may be found
- j- end of possible finder pattern in row
- Returns:
- true if a finder pattern candidate was found this time
 
 
-