2019-08-15-matlab graythresh level具体含义

https://stackoverflow.com/questions/31129994/otsu-method-graythresh-function-in-matlab-produces-a-scaled-result-on-which-sc

这里面有详细讨论,结论是

转换为灰度值阈值 threshold_gray = level * 255;

实际上, 该函数内部对图像进行uint8转换。

If you look at the source code for graythresh, it first converts the image to uint8 and uses imhist to compute a 256 bin image histogram before computing the actual otsu threshold. The normalization later happens using the following code : level = (idx-1) / (num_bins-1);. Working backward from this helps drive my point. When level is 0, the first bin of the histogram is where the threshold lies. For a 256 bin uint8 histogram, that means 0. When the level is 1, this corresponds to 255. 

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容