自适应阈值Matlab-Opencv

时间:2016-08-05 07:19:41

标签: matlab opencv adaptive-threshold

我想通过matlab在8位单通道uint8图像上应用cv.adaptiveThreshold(opencv),但我总是收到错误。我尝试过以下网站代码:https://kyamagu.github.io/mexopencv/matlab/adaptiveThreshold.html

th = cv.adaptiveThreshold(img,255,'Method',mean,'Type',binary,3,2);

它给了我没有足够的输入参数的错误。 当我像这样跑:

th = cv.adaptiveThreshold(img);

它工作正常,但这不是我想要的。我不想应用默认方法和标准。

感谢您的帮助。

1 个答案:

答案 0 :(得分:1)

阅读文档。您没有关注函数参数列表

cv.adaptiveThreshold(img,'MaxValue',255,'Method','Mean','Type','Binary','BlockSize',3,'C',2);

应该有效