diff --git a/photon-targeting/src/main/java/org/photonvision/estimation/OpenCVHelp.java b/photon-targeting/src/main/java/org/photonvision/estimation/OpenCVHelp.java index 6dce4624f9..7f72a5d744 100644 --- a/photon-targeting/src/main/java/org/photonvision/estimation/OpenCVHelp.java +++ b/photon-targeting/src/main/java/org/photonvision/estimation/OpenCVHelp.java @@ -572,25 +572,4 @@ public static PNPResult solvePNP_SQPNP( return new PNPResult(); } } - - /** - * Convert a image to a BufferedImage - * - * @param input input Mat as bgr/8uc3 - * @return The same data but as a BufferedImage - */ - public static Optional matToImage(Mat bgr) { - MatOfByte outputBuffer = new MatOfByte(); - Imgcodecs.imencode(".jpg", bgr, outputBuffer); - byte ba[] = outputBuffer.toArray(); - - BufferedImage bi; - try { - bi = ImageIO.read(new ByteArrayInputStream(ba)); - return Optional.of(bi); - } catch (IOException e) { - e.printStackTrace(); - return Optional.empty(); - } - } }