public void configure(int numCols, int numRows) {
    ConfigChessboard config = new ConfigChessboard(numCols, numRows, 30);

    alg = FactoryPlanarCalibrationTarget.detectorChessboard(config).getAlg();

    alg.setUserBinaryThreshold(config.binaryGlobalThreshold);
    alg.setUserAdaptiveBias(config.binaryAdaptiveBias);
    alg.setUserAdaptiveRadius(config.binaryAdaptiveRadius);
  }
  private synchronized void detectTarget() {
    if (calibGUI.isManual()) alg.setUserBinaryThreshold(calibGUI.getThresholdLevel());
    else alg.setUserBinaryThreshold(-1);

    foundTarget = alg.process(gray);
  }