public class FinderPatternFinder extends Object
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.
Modifier and Type | Field and Description |
---|---|
protected static int |
MAX_MODULES |
protected static int |
MIN_SKIP |
Constructor and Description |
---|
FinderPatternFinder(BitMatrix image)
Creates a finder that will search the image for three finder patterns.
|
FinderPatternFinder(BitMatrix image,
ResultPointCallback resultPointCallback) |
Modifier and Type | Method and Description |
---|---|
protected void |
clearCounts(int[] counts)
Deprecated.
|
protected static void |
doClearCounts(int[] counts) |
protected static void |
doShiftCounts2(int[] stateCount) |
protected static boolean |
foundPatternCross(int[] stateCount) |
protected static boolean |
foundPatternDiagonal(int[] stateCount) |
protected BitMatrix |
getImage() |
protected List<FinderPattern> |
getPossibleCenters() |
protected boolean |
handlePossibleCenter(int[] stateCount,
int i,
int j)
This is called when a horizontal scan finds a possible alignment pattern.
|
protected boolean |
handlePossibleCenter(int[] stateCount,
int i,
int j,
boolean pureBarcode)
Deprecated.
only exists for backwards compatibility
|
protected void |
shiftCounts2(int[] stateCount)
Deprecated.
|
protected static final int MIN_SKIP
protected static final int MAX_MODULES
public FinderPatternFinder(BitMatrix image)
Creates a finder that will search the image for three finder patterns.
image
- image to searchpublic FinderPatternFinder(BitMatrix image, ResultPointCallback resultPointCallback)
protected final BitMatrix getImage()
protected final List<FinderPattern> getPossibleCenters()
protected static boolean foundPatternCross(int[] stateCount)
stateCount
- count of black/white/black/white/black pixels just readprotected static boolean foundPatternDiagonal(int[] stateCount)
stateCount
- count of black/white/black/white/black pixels just read@Deprecated protected final void clearCounts(int[] counts)
@Deprecated protected final void shiftCounts2(int[] stateCount)
protected static void doClearCounts(int[] counts)
protected static void doShiftCounts2(int[] stateCount)
@Deprecated protected final boolean handlePossibleCenter(int[] stateCount, int i, int j, boolean pureBarcode)
stateCount
- reading state module counts from horizontal scani
- row where finder pattern may be foundj
- end of possible finder pattern in rowpureBarcode
- ignoredhandlePossibleCenter(int[], int, int)
protected 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
stateCount
- reading state module counts from horizontal scani
- row where finder pattern may be foundj
- end of possible finder pattern in rowCopyright © 2007–2024. All rights reserved.