code: private float sizeOfBlackWhiteBlackRunBothWays(int fromX, int fromY, int toX, int toY) {
  
      float result = sizeOfBlackWhiteBlackRun(fromX, fromY, toX, toY);
  
      // Now count other way -- don't run off image though of course
      float scale = 1.0f;
      int otherToX = fromX - (toX - fromX);
      if (otherToX < 0) {
        scale = fromX / (float) (fromX - otherToX);
        otherToX = 0;
      } else if (otherToX >= image.getWidth()) {
        scale = (image.getWidth() - 1 - fromX) / (float) (otherToX - fromX);
        otherToX = image.getWidth() - 1;
      }
      int otherToY = (int) (fromY - (toY - fromY) * scale);
  
      scale = 1.0f;
      if (otherToY < 0) {
        scale = fromY / (float) (fromY - otherToY);
        otherToY = 0;
      } else if (otherToY >= image.getHeight()) {
        scale = (image.getHeight() - 1 - fromY) / (float) (otherToY - fromY);
        otherToY = image.getHeight() - 1;
      }
      otherToX = (int) (fromX + (otherToX - fromX) * scale);
  
      result += sizeOfBlackWhiteBlackRun(fromX, fromY, otherToX, otherToY);
  
      // Middle pixel is double-counted this way; subtract 1
      return result - 1.0f;
    }
docs: See {@link #sizeOfBlackWhiteBlackRun(int, int, int, int)}; computes the total width of
  a finder pattern by looking for a black-white-black run from the center in the direction
  of another point (another finder pattern center), and in the opposite direction too.