Program: 150640
Project: 150640
Buggy source:
@Override protected void paintInPanel(AffineTransform tran,Graphics2D g2){
  g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,RenderingHints.VALUE_STROKE_PURE);
  g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
synchronized (DetectFiducialSquareBinaryApp.this) {
    if (controls.bShowContour) {
      LinearContourLabelChang2004 contour=detector.getSquareDetector().getDetector().getContourFinder();
      List<Contour> contours=BinaryImageOps.convertContours(contour.getPackedPoints(),contour.getContours());
      g2.setStroke(new BasicStroke(1));
      VisualizeBinaryData.render(contours,null,Color.CYAN,scale,g2);
    }
    FastQueue<FoundFiducial> detected=detector.getFound();
    if (controls.bShowSquares) {
      List<Polygon2D_F64> polygons=detector.getSquareDetector().getPolygons(null);
      g2.setColor(Color.GREEN);
      g2.setStroke(new BasicStroke(3));
      for (      Polygon2D_F64 p : polygons) {
        VisualizeShapes.drawPolygon(p,true,scale,g2);
      }
    }
    if (controls.bShowOrienation) {
      g2.setStroke(new BasicStroke(2));
      for (int i=0; i < detected.size; i++) {
        VisualizeShapes.drawArrowSubPixel(detected.get(i).distortedPixels,3,scale,g2);
      }
    }
    if (controls.bShowlabels) {
      Point2D_F64 center=new Point2D_F64();
      g2.setStroke(new BasicStroke(2));
      for (int i=0; i < detected.size; i++) {
        FoundFiducial f=detected.get(i);
        UtilPolygons2D_F64.center(f.distortedPixels,center);
        center.x*=scale;
        center.y*=scale;
        VisualizeFiducial.drawLabel(center,"String_Node_Str" + f.id,g2);
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void paintInPanel(AffineTransform tran,Graphics2D g2){
  g2.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL,RenderingHints.VALUE_STROKE_PURE);
  g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
synchronized (lockProcessing) {
    if (controls.bShowContour) {
      LinearContourLabelChang2004 contour=detector.getSquareDetector().getDetector().getContourFinder();
      List<Contour> contours=BinaryImageOps.convertContours(contour.getPackedPoints(),contour.getContours());
      g2.setStroke(new BasicStroke(1));
      VisualizeBinaryData.render(contours,null,Color.CYAN,scale,g2);
    }
    FastQueue<FoundFiducial> detected=detector.getFound();
    if (controls.bShowSquares) {
      List<Polygon2D_F64> polygons=detector.getSquareDetector().getPolygons(null,null);
      g2.setColor(Color.GREEN);
      g2.setStroke(new BasicStroke(3));
      for (      Polygon2D_F64 p : polygons) {
        VisualizeShapes.drawPolygon(p,true,scale,g2);
      }
    }
    if (controls.bShowOrienation) {
      g2.setStroke(new BasicStroke(2));
      for (int i=0; i < detected.size; i++) {
        VisualizeShapes.drawArrowSubPixel(detected.get(i).distortedPixels,3,scale,g2);
      }
    }
    if (controls.bShowlabels) {
      Point2D_F64 center=new Point2D_F64();
      g2.setStroke(new BasicStroke(2));
      for (int i=0; i < detected.size; i++) {
        FoundFiducial f=detected.get(i);
        UtilPolygons2D_F64.center(f.distortedPixels,center);
        center.x*=scale;
        center.y*=scale;
        VisualizeFiducial.drawLabel(center,"String_Node_Str" + f.id,g2);
      }
    }
  }
}