private synchronized void renderOutput() { switch (calibGUI.getSelectedView()) { case 0: workImage.createGraphics().drawImage(input, null, null); break; case 1: VisualizeBinaryData.renderBinary(alg.getBinary(), false, workImage); break; case 2: renderClusters(); break; default: throw new RuntimeException("Unknown mode"); } Graphics2D g2 = workImage.createGraphics(); if (foundTarget) { if (calibGUI.isShowBound()) { // Polygon2D_I32 bounds = alg.getFindBound().getBoundPolygon(); // drawBounds(g2, bounds); } if (calibGUI.isShowNumbers()) { drawNumbers(g2, alg.getCalibrationPoints(), null, 1); } calibGUI.setSuccessMessage("FOUND", true); } else { if (calibGUI.isShowBound()) { // Polygon2D_I32 bounds = alg.getFindBound().getBoundPolygon(); // drawBounds(g2, bounds); } calibGUI.setSuccessMessage("FAILED", false); } if (calibGUI.isShowPoints()) { List<Point2D_F64> candidates = alg.getCalibrationPoints(); for (Point2D_F64 c : candidates) { VisualizeFeatures.drawPoint(g2, (int) (c.x + 0.5), (int) (c.y + 0.5), 1, Color.RED); } } if (calibGUI.doShowGraph) { System.out.println("Maybe I should add this back in with the new detector some how"); } gui.setBufferedImage(workImage); gui.setScale(calibGUI.getScale()); gui.repaint(); processed = true; }