protected final boolean handlePossibleCenter(int[] stateCount, int i, int j) {
    int stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] +
        stateCount[4];
    float centerJ = centerFromEnd(stateCount, j);
    float centerI = crossCheckVertical(i, (int) centerJ, stateCount[2], stateCountTotal);
    if (!Float.isNaN(centerI)) {
      // Re-cross check
      centerJ = crossCheckHorizontal((int) centerJ, (int) centerI, stateCount[2], stateCountTotal);
      if (!Float.isNaN(centerJ) && crossCheckDiagonal((int) centerI, (int) centerJ)) {
        float estimatedModuleSize = stateCountTotal / 7.0f;
        boolean found = false;
        for (int index = 0; index < possibleCenters.size(); index++) {
          FinderPattern center = possibleCenters.get(index);
          // Look for about the same center and module size:
          if (center.aboutEquals(estimatedModuleSize, centerI, centerJ)) {
            possibleCenters.set(index, center.combineEstimate(centerI, centerJ, estimatedModuleSize));
            found = true;
            break;
          }
        }
        if (!found) {
          FinderPattern point = new FinderPattern(centerJ, centerI, estimatedModuleSize);
          possibleCenters.add(point);
          if (resultPointCallback != null) {
            resultPointCallback.foundPossibleResultPoint(point);
          }
        }
        return true;
      }
    }
    return false;
  }
protected final boolean handlePossibleCenter ( int [ ] stateCount , int i , int j ) { int stateCountTotal = stateCount [ 0 ] + stateCount [ 1 ] + stateCount [ 2 ] + stateCount [ 3 ] + stateCount [ 4 ] ; float centerJ = centerFromEnd ( stateCount , j ) ; float centerI = crossCheckVertical ( i , ( int ) centerJ , stateCount [ 2 ] , stateCountTotal ) ; if ( ! Float . isNaN ( centerI ) ) { centerJ = crossCheckHorizontal ( ( int ) centerJ , ( int ) centerI , stateCount [ 2 ] , stateCountTotal ) ; if ( ! Float . isNaN ( centerJ ) && crossCheckDiagonal ( ( int ) centerI , ( int ) centerJ ) ) { float estimatedModuleSize = stateCountTotal / 7.0f ; boolean found = false ; for ( int index = 0 ; index < possibleCenters . size ( ) ; index ++ ) { FinderPattern center = possibleCenters . get ( index ) ; if ( center . aboutEquals ( estimatedModuleSize , centerI , centerJ ) ) { possibleCenters . set ( index , center . combineEstimate ( centerI , centerJ , estimatedModuleSize ) ) ; found = true ; break ; } } if ( ! found ) { FinderPattern point = new FinderPattern ( centerJ , centerI , estimatedModuleSize ) ; possibleCenters . add ( point ) ; if ( resultPointCallback != null ) { resultPointCallback . foundPossibleResultPoint ( point ) ; } } return true ; } } return false ; }
<p>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.</p>

<p>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

@param stateCount reading state module counts from horizontal scan
@param i row where finder pattern may be found
@param j end of possible finder pattern in row
@return true if a finder pattern candidate was found this time