当前位置:网站首页>Thresholdtypes of opencvsharp threshold segmentation threshold function

Thresholdtypes of opencvsharp threshold segmentation threshold function

2022-06-21 22:09:00 Jin Zenghui

opencv Threshold segmentation threshold function 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
};

Threshold type :
THRESH_BINARY: The threshold value is set to maxVal, Set other values to zero

THRESH_BINARY_INV: Set the threshold value to zero , Other values are set to maxVal

THRESH_TRUNC: The threshold value is set as the threshold value , Other values remain unchanged

THRESH_TOZERO: The value of crossing the threshold remains unchanged , Set other values to zero

THRESH_TOZERO_INV: Set the threshold value to zero , Other values remain unchanged
Diagram of threshold type
 Insert picture description here

原网站

版权声明
本文为[Jin Zenghui]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/172/202206212013034861.html