com.google.zxing.qrcode.detector
Class FinderPatternFinder

java.lang.Object
  extended by com.google.zxing.qrcode.detector.FinderPatternFinder

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.

Since:
BlackBerry API 6.0.0

Field Summary
protected static int MAX_MODULES
           
protected static int MIN_SKIP
           
 
Constructor Summary
FinderPatternFinder(BitMatrix image)
          Creates a finder that will search the image for three finder patterns.
 
Method Summary
protected static boolean foundPatternCross(int[] stateCount)
           
protected  BitMatrix getImage()
           
protected  Vector getPossibleCenters()
           
protected  boolean handlePossibleCenter(int[] stateCount, int i, int j)
          This is called when a horizontal scan finds a possible alignment pattern.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

MIN_SKIP

protected static final int MIN_SKIP
See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0

MAX_MODULES

protected static final int MAX_MODULES
See Also:
Constant Field Values
Since:
BlackBerry API 6.0.0


Constructor Detail

FinderPatternFinder

public FinderPatternFinder(BitMatrix image)

Creates a finder that will search the image for three finder patterns.

Parameters:
image - image to search
Since:
BlackBerry API 6.0.0


Method Detail

getImage

protected BitMatrix getImage()
Since:
BlackBerry API 6.0.0

getPossibleCenters

protected Vector getPossibleCenters()
Since:
BlackBerry API 6.0.0

foundPatternCross

protected 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
Since:
BlackBerry API 6.0.0

handlePossibleCenter

protected boolean handlePossibleCenter(int[] stateCount,
                                       int i,
                                       int j)
                                throws ReaderException

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.

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
Throws:
ReaderException
Since:
BlackBerry API 6.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.