我是靠谱客的博主 可爱电灯胆,最近开发中收集的这篇文章主要介绍opencvsharp阈值分割threshold函数的ThresholdTypes,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

opencv阈值分割threshold函数ThresholdTypes

enum ThresholdTypes {
    THRESH_BINARY     = 0, //!< f[texttt{dst} (x,y) =  fork{texttt{maxval}}{if (texttt{src}(x,y) > texttt{thresh})}{0}{otherwise}f]
    THRESH_BINARY_INV = 1, //!< f[texttt{dst} (x,y) =  fork{0}{if (texttt{src}(x,y) > texttt{thresh})}{texttt{maxval}}{otherwise}f]
    THRESH_TRUNC      = 2, //!< f[texttt{dst} (x,y) =  fork{texttt{threshold}}{if (texttt{src}(x,y) > texttt{thresh})}{texttt{src}(x,y)}{otherwise}f]
    THRESH_TOZERO     = 3, //!< f[texttt{dst} (x,y) =  fork{texttt{src}(x,y)}{if (texttt{src}(x,y) > texttt{thresh})}{0}{otherwise}f]
    THRESH_TOZERO_INV = 4, //!< f[texttt{dst} (x,y) =  fork{0}{if (texttt{src}(x,y) > texttt{thresh})}{texttt{src}(x,y)}{otherwise}f]
    THRESH_MASK       = 7,
    THRESH_OTSU       = 8, //!< flag, use Otsu algorithm to choose the optimal threshold value
    THRESH_TRIANGLE   = 16 //!< flag, use Triangle algorithm to choose the optimal threshold value
};

阈值类型:
THRESH_BINARY:过门限的值设置为maxVal,其它值置零

THRESH_BINARY_INV:过门限的值置零,其它值设置为maxVal

THRESH_TRUNC:过门限的值设置为门限值,其它值置不变

THRESH_TOZERO:过门限的值不变,其它值置零

THRESH_TOZERO_INV:过门限的值置零,其它值不变
阈值类型图示
在这里插入图片描述

最后

以上就是可爱电灯胆为你收集整理的opencvsharp阈值分割threshold函数的ThresholdTypes的全部内容,希望文章能够帮你解决opencvsharp阈值分割threshold函数的ThresholdTypes所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(49)

评论列表共有 0 条评论

立即
投稿
返回
顶部