Program: 150954
Project: 150954
Buggy source:
public static void main(String[] args){
  String nameIntrinsic=null;
  int cameraId=0;
  if (args.length >= 1) {
    cameraId=Integer.parseInt(args[0]);
  }
  if (args.length >= 2) {
    nameIntrinsic=args[1];
  }
 else {
    System.out.println();
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println();
  }
  System.out.println();
  System.out.println("String_Node_Str" + cameraId);
  System.out.println("String_Node_Str" + nameIntrinsic);
  System.out.println();
  Webcam webcam=Webcam.getWebcams().get(cameraId);
  UtilWebcamCapture.adjustResolution(webcam,640,480);
  webcam.open();
  IntrinsicParameters param;
  if (nameIntrinsic == null) {
    param=new IntrinsicParameters();
    Dimension d=webcam.getDevice().getResolution();
    param.width=d.width;
    param.height=d.height;
    param.cx=d.width / 2;
    param.cy=d.height / 2;
    param.fx=param.cx / Math.tan(UtilAngle.degreeToRadian(35));
    param.fy=param.cx / Math.tan(UtilAngle.degreeToRadian(35));
  }
 else {
    param=UtilIO.loadXML(nameIntrinsic);
  }
  String patternPath=UtilIO.getPathToBase() + "String_Node_Str";
  SquareImage_to_FiducialDetector<ImageFloat32> detector=FactoryFiducial.squareImageRobust(new ConfigFiducialImage(),6,ImageFloat32.class);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.setIntrinsic(param);
  ImageFloat32 gray=new ImageFloat32(param.width,param.height);
  ImagePanel gui=new ImagePanel(param.width,param.height);
  ShowImages.showWindow(gui,"String_Node_Str").setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  Font font=new Font("String_Node_Str",Font.BOLD,24);
  while (true) {
    BufferedImage frame=webcam.getImage();
    ConvertBufferedImage.convertFrom(frame,gray);
    detector.detect(gray);
    Graphics2D g2=frame.createGraphics();
    Se3_F64 targetToSensor=new Se3_F64();
    for (int i=0; i < detector.totalFound(); i++) {
      detector.getFiducialToCamera(i,targetToSensor);
      double width=detector.getWidth(i);
      int id=detector.getId(i);
      Point2D_F64 p=new Point2D_F64();
      Point3D_F64 c=new Point3D_F64();
      SePointOps_F64.transform(targetToSensor,c,c);
      PerspectiveOps.convertNormToPixel(param,c.x / c.z,c.y / c.z,p);
      FontMetrics metrics=g2.getFontMetrics(font);
      String text=Integer.toString(id);
      Rectangle2D r=metrics.getStringBounds(text,null);
      g2.setColor(Color.ORANGE);
      g2.setFont(font);
      g2.drawString(text,(float)(p.x - r.getWidth() / 2),(float)(p.y + r.getHeight() / 2));
      VisualizeFiducial.drawCube(targetToSensor,param,width,g2);
    }
    if (nameIntrinsic == null) {
      g2.setColor(Color.RED);
      g2.setFont(font);
      g2.drawString("String_Node_Str",10,20);
    }
    gui.setBufferedImageSafe(frame);
    gui.repaint();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  String nameIntrinsic=null;
  int cameraId=0;
  if (args.length >= 1) {
    cameraId=Integer.parseInt(args[0]);
  }
  if (args.length >= 2) {
    nameIntrinsic=args[1];
  }
 else {
    System.out.println();
    System.out.println("String_Node_Str");
    System.out.println("String_Node_Str");
    System.out.println();
  }
  System.out.println();
  System.out.println("String_Node_Str" + cameraId);
  System.out.println("String_Node_Str" + nameIntrinsic);
  System.out.println();
  Webcam webcam=Webcam.getWebcams().get(cameraId);
  UtilWebcamCapture.adjustResolution(webcam,640,480);
  webcam.open();
  IntrinsicParameters param;
  if (nameIntrinsic == null) {
    param=new IntrinsicParameters();
    Dimension d=webcam.getDevice().getResolution();
    param.width=d.width;
    param.height=d.height;
    param.cx=d.width / 2;
    param.cy=d.height / 2;
    param.fx=param.cx / Math.tan(UtilAngle.degreeToRadian(35));
    param.fy=param.cx / Math.tan(UtilAngle.degreeToRadian(35));
  }
 else {
    param=UtilIO.loadXML(nameIntrinsic);
  }
  String patternPath=UtilIO.getPathToBase() + "String_Node_Str";
  SquareImage_to_FiducialDetector<ImageFloat32> detector=FactoryFiducial.squareImageFast(new ConfigFiducialImage(),100,ImageFloat32.class);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.addTarget(loadImage(patternPath + "String_Node_Str",ImageFloat32.class),100,2.5);
  detector.setIntrinsic(param);
  ImageFloat32 gray=new ImageFloat32(param.width,param.height);
  ImagePanel gui=new ImagePanel(param.width,param.height);
  ShowImages.showWindow(gui,"String_Node_Str").setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  Font font=new Font("String_Node_Str",Font.BOLD,24);
  while (true) {
    BufferedImage frame=webcam.getImage();
    ConvertBufferedImage.convertFrom(frame,gray);
    detector.detect(gray);
    Graphics2D g2=frame.createGraphics();
    Se3_F64 targetToSensor=new Se3_F64();
    for (int i=0; i < detector.totalFound(); i++) {
      detector.getFiducialToCamera(i,targetToSensor);
      double width=detector.getWidth(i);
      int id=detector.getId(i);
      Point2D_F64 p=new Point2D_F64();
      Point3D_F64 c=new Point3D_F64();
      SePointOps_F64.transform(targetToSensor,c,c);
      PerspectiveOps.convertNormToPixel(param,c.x / c.z,c.y / c.z,p);
      FontMetrics metrics=g2.getFontMetrics(font);
      String text=Integer.toString(id);
      Rectangle2D r=metrics.getStringBounds(text,null);
      g2.setColor(Color.ORANGE);
      g2.setFont(font);
      g2.drawString(text,(float)(p.x - r.getWidth() / 2),(float)(p.y + r.getHeight() / 2));
      VisualizeFiducial.drawCube(targetToSensor,param,width,g2);
    }
    if (nameIntrinsic == null) {
      g2.setColor(Color.RED);
      g2.setFont(font);
      g2.drawString("String_Node_Str",10,20);
    }
    gui.setBufferedImageSafe(frame);
    gui.repaint();
  }
}