Program: 150570
Project: 150570
Buggy source:
private void performBundleAdjustment(CameraView seed,CameraPinholeRadial intrinsic){
  BundleAdjustmentShur_DSCC sba=new BundleAdjustmentShur_DSCC(1e-3);
  sba.configure(1e-4,1e-4,20);
  BundleAdjustmentSceneStructure structure=new BundleAdjustmentSceneStructure();
  BundleAdjustmentObservations observations=new BundleAdjustmentObservations(graphNodes.size());
  structure.initialize(1,graphNodes.size(),featuresPruned.size());
  double scale=Math.max(intrinsic.width,intrinsic.height);
  intrinsic.fx/=scale;
  intrinsic.fy/=scale;
  intrinsic.cx/=scale;
  intrinsic.cy/=scale;
  intrinsic.skew/=scale;
  structure.setCamera(0,true,intrinsic);
  for (int i=0; i < graphNodes.size(); i++) {
    CameraView v=graphNodes.get(i);
    structure.setView(i,v == seed,v.viewToWorld.invert(null));
    structure.connectViewToCamera(i,0);
  }
  for (int indexPoint=0; indexPoint < featuresPruned.size(); indexPoint++) {
    Feature3D f=featuresPruned.get(indexPoint);
    structure.setPoint(indexPoint,f.worldPt.x,f.worldPt.y,f.worldPt.z);
    for (int j=0; j < f.views.size; j++) {
      int indexView=f.views.get(j);
      structure.connectPointToView(indexPoint,indexView);
      Point2D_F64 pixel=graphNodes.get(indexView).featurePixels.get(f.feature.get(j));
      observations.getView(indexView).add(indexPoint,(float)(pixel.x / scale),(float)(pixel.y / scale));
    }
  }
  if (!sba.optimize(structure,observations)) {
    throw new RuntimeException("String_Node_Str");
  }
  System.out.println("String_Node_Str" + sba.getErrorBefore() + "String_Node_Str"+ sba.getErrorAfter());
  for (int i=0; i < graphNodes.size(); i++) {
    structure.views[i].worldToView.invert(graphNodes.get(i).viewToWorld);
  }
  for (int i=0; i < featuresPruned.size(); i++) {
    featuresPruned.get(i).worldPt.set(structure.points[i]);
  }
  intrinsic.fx*=scale;
  intrinsic.fy*=scale;
  intrinsic.cx*=scale;
  intrinsic.cy*=scale;
  intrinsic.skew*=scale;
}

Fixed version (ground truth):
private void performBundleAdjustment(CameraView seed,CameraPinholeRadial intrinsic){
  BundleAdjustmentShur_DSCC sba=new BundleAdjustmentShur_DSCC(1e-3);
  sba.configure(1e-4,1e-4,20);
  BundleAdjustmentSceneStructure structure=new BundleAdjustmentSceneStructure();
  BundleAdjustmentObservations observations=new BundleAdjustmentObservations(graphNodes.size());
  structure.initialize(1,graphNodes.size(),featuresPruned.size());
  double scale=Math.max(intrinsic.width,intrinsic.height);
  intrinsic.fx/=scale;
  intrinsic.fy/=scale;
  intrinsic.cx/=scale;
  intrinsic.cy/=scale;
  intrinsic.skew/=scale;
  structure.setCamera(0,true,intrinsic);
  for (int i=0; i < graphNodes.size(); i++) {
    CameraView v=graphNodes.get(i);
    structure.setView(i,v == seed,v.viewToWorld.invert(null));
    structure.connectViewToCamera(i,0);
  }
  for (int indexPoint=0; indexPoint < featuresPruned.size(); indexPoint++) {
    Feature3D f=featuresPruned.get(indexPoint);
    structure.setPoint(indexPoint,f.worldPt.x,f.worldPt.y,f.worldPt.z);
    for (int j=0; j < f.views.size(); j++) {
      CameraView view=f.views.get(j);
      structure.connectPointToView(indexPoint,view.index);
      Point2D_F64 pixel=graphNodes.get(view.index).featurePixels.get(f.feature.get(j));
      observations.getView(view.index).add(indexPoint,(float)(pixel.x / scale),(float)(pixel.y / scale));
    }
  }
  if (!sba.optimize(structure,observations)) {
    throw new RuntimeException("String_Node_Str");
  }
  System.out.println("String_Node_Str" + sba.getErrorBefore() + "String_Node_Str"+ sba.getErrorAfter());
  for (int i=0; i < graphNodes.size(); i++) {
    structure.views[i].worldToView.invert(graphNodes.get(i).viewToWorld);
  }
  for (int i=0; i < featuresPruned.size(); i++) {
    featuresPruned.get(i).worldPt.set(structure.points[i]);
  }
  intrinsic.fx*=scale;
  intrinsic.fy*=scale;
  intrinsic.cx*=scale;
  intrinsic.cy*=scale;
  intrinsic.skew*=scale;
}