Apparently it was possible in OpenCV 2.4 with Java bindings to convert a Mat
into a BufferedImage
:
val greyMat = new Mat()
opencv_imgproc.cvtColor(mat, greyMat, opencv_imgproc.CV_BGR2GRAY, 1)
ImageIO.write(greyMat.getBufferedImage, "jpg", new File("output_grey.jpg"))
I tried updating a project that used this code (and it worked, I checked) to use OpenCV 3.1, and it seems this method has gone.
Why is this method getBufferedImage
removed from API, and how do I get back to it?