Program: 150836
Project: 150836
Buggy source:
/** 
 * Examines the input image to detect fiducials inside of it
 * @param gray Undistorted input image
 */
public void process(T gray){
  binary.reshape(gray.width,gray.height);
  inputToBinary.process(gray,binary);
  squareDetector.process(gray,binary);
  FastQueue<Polygon2D_F64> candidates=squareDetector.getFoundPolygons();
  found.reset();
  if (verbose)   System.out.println("String_Node_Str" + candidates.size);
  Quadrilateral_F64 q=new Quadrilateral_F64();
  for (int i=0; i < candidates.size; i++) {
    Polygon2D_F64 p=candidates.get(i);
    double best=Double.MAX_VALUE;
    for (int j=0; j < 4; j++) {
      double found=p.get(0).normSq();
      if (found < best) {
        best=found;
        interpolationHack.set(p);
      }
      UtilPolygons2D_F64.shiftDown(p);
    }
    UtilPolygons2D_F64.convert(interpolationHack,q);
    pairsRemovePerspective.get(0).set(0,0,q.a.x,q.a.y);
    pairsRemovePerspective.get(1).set(square.width,0,q.b.x,q.b.y);
    pairsRemovePerspective.get(2).set(square.width,square.height,q.c.x,q.c.y);
    pairsRemovePerspective.get(3).set(0,square.height,q.d.x,q.d.y);
    if (!computeHomography.process(pairsRemovePerspective,H)) {
      if (verbose)       System.out.println("String_Node_Str");
      continue;
    }
    if (!refineHomography.fitModel(pairsRemovePerspective,H,H_refined)) {
      if (verbose)       System.out.println("String_Node_Str");
      continue;
    }
    UtilHomography.convert(H_refined,transformHomography.getModel());
    removePerspective.apply(gray,square);
    BinaryPolygonDetector.Info info=squareDetector.getPolygonInfo(i);
    if (minimumBorderBlackFraction > 0) {
      double pixelThreshold=(info.edgeInside + info.edgeOutside) / 2;
      double foundFraction=computeFractionBoundary((float)pixelThreshold);
      if (foundFraction < minimumBorderBlackFraction) {
        if (verbose)         System.out.println("String_Node_Str" + foundFraction);
        continue;
      }
    }
    if (processSquare(square,result,info.edgeInside,info.edgeOutside)) {
      prepareForOutput(q,result);
      if (verbose)       System.out.println("String_Node_Str");
    }
 else {
      if (verbose)       System.out.println("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Examines the input image to detect fiducials inside of it
 * @param gray Undistorted input image
 */
public void process(T gray){
  binary.reshape(gray.width,gray.height);
  inputToBinary.process(gray,binary);
  squareDetector.process(gray,binary);
  FastQueue<Polygon2D_F64> candidates=squareDetector.getFoundPolygons();
  found.reset();
  if (verbose)   System.out.println("String_Node_Str" + candidates.size);
  Quadrilateral_F64 q=new Quadrilateral_F64();
  for (int i=0; i < candidates.size; i++) {
    Polygon2D_F64 p=candidates.get(i);
    double best=Double.MAX_VALUE;
    for (int j=0; j < 4; j++) {
      double found=p.get(0).normSq();
      if (found < best) {
        best=found;
        interpolationHack.set(p);
      }
      UtilPolygons2D_F64.shiftDown(p);
    }
    UtilPolygons2D_F64.convert(interpolationHack,q);
    pairsRemovePerspective.get(0).set(0,0,q.a.x,q.a.y);
    pairsRemovePerspective.get(1).set(square.width,0,q.b.x,q.b.y);
    pairsRemovePerspective.get(2).set(square.width,square.height,q.c.x,q.c.y);
    pairsRemovePerspective.get(3).set(0,square.height,q.d.x,q.d.y);
    if (!computeHomography.process(pairsRemovePerspective,H)) {
      if (verbose)       System.out.println("String_Node_Str");
      continue;
    }
    if (!refineHomography.fitModel(pairsRemovePerspective,H,H_refined)) {
      if (verbose)       System.out.println("String_Node_Str");
      continue;
    }
    UtilHomography.convert(H_refined,transformHomography.getModel());
    removePerspective.apply(gray,square);
    BinaryPolygonDetector.Info info=squareDetector.getPolygonInfo().get(i);
    if (minimumBorderBlackFraction > 0) {
      double pixelThreshold=(info.edgeInside + info.edgeOutside) / 2;
      double foundFraction=computeFractionBoundary((float)pixelThreshold);
      if (foundFraction < minimumBorderBlackFraction) {
        if (verbose)         System.out.println("String_Node_Str" + foundFraction);
        continue;
      }
    }
    if (processSquare(square,result,info.edgeInside,info.edgeOutside)) {
      prepareForOutput(q,result);
      if (verbose)       System.out.println("String_Node_Str");
    }
 else {
      if (verbose)       System.out.println("String_Node_Str");
    }
  }
}