private AlignmentPattern handlePossibleCenter(int[] stateCount, int i, int j) {
    int stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2];
    float centerJ = centerFromEnd(stateCount, j);
    float centerI = crossCheckVertical(i, (int) centerJ, 2 * stateCount[1], stateCountTotal);
    if (!Float.isNaN(centerI)) {
      float estimatedModuleSize = (stateCount[0] + stateCount[1] + stateCount[2]) / 3.0f;
      for (AlignmentPattern center : possibleCenters) {
        // Look for about the same center and module size:
        if (center.aboutEquals(estimatedModuleSize, centerI, centerJ)) {
          return center.combineEstimate(centerI, centerJ, estimatedModuleSize);
        }
      }
      // Hadn't found this before; save it
      AlignmentPattern point = new AlignmentPattern(centerJ, centerI, estimatedModuleSize);
      possibleCenters.add(point);
      if (resultPointCallback != null) {
        resultPointCallback.foundPossibleResultPoint(point);
      }
    }
    return null;
  }
private AlignmentPattern handlePossibleCenter ( int [ ] stateCount , int i , int j ) { int stateCountTotal = stateCount [ 0 ] + stateCount [ 1 ] + stateCount [ 2 ] ; float centerJ = centerFromEnd ( stateCount , j ) ; float centerI = crossCheckVertical ( i , ( int ) centerJ , 2 * stateCount [ 1 ] , stateCountTotal ) ; if ( ! Float . isNaN ( centerI ) ) { float estimatedModuleSize = ( stateCount [ 0 ] + stateCount [ 1 ] + stateCount [ 2 ] ) / 3.0f ; for ( AlignmentPattern center : possibleCenters ) { if ( center . aboutEquals ( estimatedModuleSize , centerI , centerJ ) ) { return center . combineEstimate ( centerI , centerJ , estimatedModuleSize ) ; } } AlignmentPattern point = new AlignmentPattern ( centerJ , centerI , estimatedModuleSize ) ; possibleCenters . add ( point ) ; if ( resultPointCallback != null ) { resultPointCallback . foundPossibleResultPoint ( point ) ; } } return null ; }
<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 see if this pattern had been
found on a previous horizontal scan. If so, we consider it confirmed and conclude we have
found the alignment pattern.</p>

@param stateCount reading state module counts from horizontal scan
@param i row where alignment pattern may be found
@param j end of possible alignment pattern in row
@return {@link AlignmentPattern} if we have found the same pattern twice, or null if not