0
我想将自适应阈值应用到我的位图图像,但是一旦我使用下面的代码,它会显示空白(全白)图像,请帮我解决它。自适应阈值变为空白(全白)图像
下面的代码:初始化后,
Mat grayMat = imread(getImageUri(this, photo).getPath(), IMREAD_GRAYSCALE);
Mat resultMat = new Mat();
Imgproc.adaptiveThreshold(grayMat, resultMat, 255, Imgproc.ADAPTIVE_THRESH_MEAN_C, Imgproc.THRESH_BINARY, 3, 40);
Bitmap imgBitmap = Bitmap.createBitmap(resultMat.cols(), resultMat.rows(), Bitmap.Config.ARGB_8888);
你是如何将'resultMat'赋给'imgBitmap'的?对我来说,它看起来就像实例化了位图的大小和类型。 –
谢谢Rick M,我只是这样创建了imgBitmap,我怎么能通过上面的位图ImageView,请帮助 – Appstute
@RickM Utils.matToBitmap(resultMat,imgBitmap);我用这个,但结果相同。 – Appstute