Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
OpenCV4Android-阈值错误_Android_Opencv_Threshold - Fatal编程技术网

OpenCV4Android-阈值错误

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,然后该方法计算出最佳值。详情见此。

我这里有一张转换成CIELAB的图片。它很好用。但是,当我使用大津方法进行阈值化时

//convert to Greyscale
Imgproc.cvtColor(ImageMat, ImageMat, Imgproc.COLOR_RGB2Lab);
//threshold
Imgproc.threshold(ImageMat,ImageMat, 1, 128,Imgproc.THRESH_OTSU);

不确定这是否有帮助,但对于大津的方法,你通过0,255,然后该方法计算出最佳值。详情见此。我有一个例子,但它是用python编写的:我得到了一个对我有用的类似问题的答案。