OpenCV4Android-阈值错误
我这里有一张转换成CIELAB的图片。它很好用。但是,当我使用大津方法进行阈值化时OpenCV4Android-阈值错误,android,opencv,threshold,Android,Opencv,Threshold,我这里有一张转换成CIELAB的图片。它很好用。但是,当我使用大津方法进行阈值化时 //convert to Greyscale Imgproc.cvtColor(ImageMat, ImageMat, Imgproc.COLOR_RGB2Lab); //threshold Imgproc.threshold(ImageMat,ImageMat, 1, 128,Imgproc.THRESH_OTSU); 不确定这是否有帮助,但对于大津的方法,你通过0,255,然后该方法计算出最佳值。详情见此。
//convert to Greyscale
Imgproc.cvtColor(ImageMat, ImageMat, Imgproc.COLOR_RGB2Lab);
//threshold
Imgproc.threshold(ImageMat,ImageMat, 1, 128,Imgproc.THRESH_OTSU);
不确定这是否有帮助,但对于大津的方法,你通过0,255,然后该方法计算出最佳值。详情见此。我有一个例子,但它是用python编写的:我得到了一个对我有用的类似问题的答案。