Class 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.
public class FinderPatternFinder
- Inheritance
-
FinderPatternFinder
- Derived
- Inherited Members
Constructors
FinderPatternFinder(BitMatrix)
Creates a finder that will search the image for three finder patterns.
public FinderPatternFinder(BitMatrix image)
Parameters
image
BitMatriximage to search
FinderPatternFinder(BitMatrix, ResultPointCallback)
Initializes a new instance of the FinderPatternFinder class.
public FinderPatternFinder(BitMatrix image, ResultPointCallback resultPointCallback)
Parameters
image
BitMatrixThe image.
resultPointCallback
ResultPointCallbackThe result point callback.
Fields
MAX_MODULES
support up to version 20 for mobile clients
protected const int MAX_MODULES = 97
Field Value
MIN_SKIP
1 pixel/module times 3 modules/center
protected const int MIN_SKIP = 3
Field Value
Properties
Image
Gets the image.
protected virtual BitMatrix Image { get; }
Property Value
PossibleCenters
Gets the possible centers.
protected virtual List<FinderPattern> PossibleCenters { get; }
Property Value
Methods
clearCounts(int[])
sets everything to 0
[Obsolete]
protected void clearCounts(int[] counts)
Parameters
counts
int[]
doClearCounts(int[])
sets everything to 0
protected static void doClearCounts(int[] counts)
Parameters
counts
int[]
doShiftCounts2(int[])
shifts left by 2 index
protected static void doShiftCounts2(int[] stateCount)
Parameters
stateCount
int[]
foundPatternCross(int[])
protected static bool foundPatternCross(int[] stateCount)
Parameters
stateCount
int[]count of black/white/black/white/black pixels just read
Returns
- bool
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
foundPatternDiagonal(int[])
protected static bool foundPatternDiagonal(int[] stateCount)
Parameters
stateCount
int[]count of black/white/black/white/black pixels just read
Returns
- bool
true if the proportions of the counts is close enough to the 1/1/3/1/1 ratios by finder patterns to be considered a match
handlePossibleCenter(int[], int, int)
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 centerprotected bool handlePossibleCenter(int[] stateCount, int i, int j)
Parameters
stateCount
int[]reading state module counts from horizontal scan
i
introw where finder pattern may be found
j
intend of possible finder pattern in row
Returns
- bool
true if a finder pattern candidate was found this time
handlePossibleCenter(int[], int, int, bool)
@see #handlePossibleCenter(int[], int, int)
[Obsolete("only exists for backwards compatibility")]
protected bool handlePossibleCenter(int[] stateCount, int i, int j, bool pureBarcode)
Parameters
stateCount
int[]reading state module counts from horizontal scan
i
introw where finder pattern may be found
j
intend of possible finder pattern in row
pureBarcode
boolignored
Returns
- bool
true if a finder pattern candidate was found this time
shiftCounts2(int[])
shifts left by 2 index
[Obsolete]
protected void shiftCounts2(int[] stateCount)
Parameters
stateCount
int[]