java.awt.image.DataBufferInt cannot be cast to java.awt.image.DataBufferByte
项目实操中,有一处的需求是将BufferedImage转换至Mat,然后调用OpenCV方法进行处理,然后报此错,如下图所示。解决方案(实测有效)更改BufferedImage类型BufferedImagebi1=openSlide.createThumbnailImage(700);BufferedImagebi2=newBufferedImage(bi1.getWidth(),bi1.getH