Program: 150915
Project: 150915
Buggy source:
/** 
 * Renders and displays the stitched together images
 */
public static void renderStitching(BufferedImage imageA,BufferedImage imageB,Homography2D_F64 fromAtoB){
  double scale=0.5;
  MultiSpectral<ImageFloat32> colorA=ConvertBufferedImage.convertFromMulti(imageA,null,true,ImageFloat32.class);
  MultiSpectral<ImageFloat32> colorB=ConvertBufferedImage.convertFromMulti(imageB,null,true,ImageFloat32.class);
  MultiSpectral<ImageFloat32> work=colorA.createSameShape();
  Homography2D_F64 fromAToWork=new Homography2D_F64(scale,0,colorA.width / 4,0,scale,colorA.height / 4,0,0,1);
  Homography2D_F64 fromWorkToA=fromAToWork.invert(null);
  PixelTransformHomography_F32 model=new PixelTransformHomography_F32();
  ImageDistort<MultiSpectral<ImageFloat32>,MultiSpectral<ImageFloat32>> distort=DistortSupport.createDistortMS(ImageFloat32.class,model,new ImplBilinearPixel_F32(),false);
  model.set(fromWorkToA);
  distort.apply(colorA,work);
  Homography2D_F64 fromWorkToB=fromWorkToA.concat(fromAtoB,null);
  model.set(fromWorkToB);
  distort.apply(colorB,work);
  BufferedImage output=new BufferedImage(work.width,work.height,imageA.getType());
  ConvertBufferedImage.convertTo(work,output,true);
  Graphics2D g2=output.createGraphics();
  Homography2D_F64 fromBtoWork=fromWorkToB.invert(null);
  Point2D_I32 corners[]=new Point2D_I32[4];
  corners[0]=renderPoint(0,0,fromBtoWork);
  corners[1]=renderPoint(colorB.width,0,fromBtoWork);
  corners[2]=renderPoint(colorB.width,colorB.height,fromBtoWork);
  corners[3]=renderPoint(0,colorB.height,fromBtoWork);
  g2.setColor(Color.ORANGE);
  g2.setStroke(new BasicStroke(4));
  g2.drawLine(corners[0].x,corners[0].y,corners[1].x,corners[1].y);
  g2.drawLine(corners[1].x,corners[1].y,corners[2].x,corners[2].y);
  g2.drawLine(corners[2].x,corners[2].y,corners[3].x,corners[3].y);
  g2.drawLine(corners[3].x,corners[3].y,corners[0].x,corners[0].y);
  ShowImages.showWindow(output,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Renders and displays the stitched together images
 */
public static void renderStitching(BufferedImage imageA,BufferedImage imageB,Homography2D_F64 fromAtoB){
  double scale=0.5;
  MultiSpectral<ImageFloat32> colorA=ConvertBufferedImage.convertFromMulti(imageA,null,true,ImageFloat32.class);
  MultiSpectral<ImageFloat32> colorB=ConvertBufferedImage.convertFromMulti(imageB,null,true,ImageFloat32.class);
  MultiSpectral<ImageFloat32> work=colorA.createSameShape();
  Homography2D_F64 fromAToWork=new Homography2D_F64(scale,0,colorA.width / 4,0,scale,colorA.height / 4,0,0,1);
  Homography2D_F64 fromWorkToA=fromAToWork.invert(null);
  PixelTransformHomography_F32 model=new PixelTransformHomography_F32();
  InterpolatePixelS<ImageFloat32> interp=FactoryInterpolation.bilinearPixelS(ImageFloat32.class,BorderType.VALUE);
  ImageDistort<MultiSpectral<ImageFloat32>,MultiSpectral<ImageFloat32>> distort=DistortSupport.createDistortMS(ImageFloat32.class,model,interp,false);
  distort.setRenderAll(false);
  model.set(fromWorkToA);
  distort.apply(colorA,work);
  Homography2D_F64 fromWorkToB=fromWorkToA.concat(fromAtoB,null);
  model.set(fromWorkToB);
  distort.apply(colorB,work);
  BufferedImage output=new BufferedImage(work.width,work.height,imageA.getType());
  ConvertBufferedImage.convertTo(work,output,true);
  Graphics2D g2=output.createGraphics();
  Homography2D_F64 fromBtoWork=fromWorkToB.invert(null);
  Point2D_I32 corners[]=new Point2D_I32[4];
  corners[0]=renderPoint(0,0,fromBtoWork);
  corners[1]=renderPoint(colorB.width,0,fromBtoWork);
  corners[2]=renderPoint(colorB.width,colorB.height,fromBtoWork);
  corners[3]=renderPoint(0,colorB.height,fromBtoWork);
  g2.setColor(Color.ORANGE);
  g2.setStroke(new BasicStroke(4));
  g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
  g2.drawLine(corners[0].x,corners[0].y,corners[1].x,corners[1].y);
  g2.drawLine(corners[1].x,corners[1].y,corners[2].x,corners[2].y);
  g2.drawLine(corners[2].x,corners[2].y,corners[3].x,corners[3].y);
  g2.drawLine(corners[3].x,corners[3].y,corners[0].x,corners[0].y);
  ShowImages.showWindow(output,"String_Node_Str",true);
}