cvThreshold()函数理解
對圖像二值化函數cvThreshold的理解
Threshold
對數組元素進行固定閾值操作
void cvThreshold( const CvArr* src, CvArr* dst, double threshold, double max_value, int threshold_type );
src函 數 cvThreshold 對單通道數組應用固定閾值操作。該函數的典型應用是對灰度圖像進行閾值操作得到二值圖像。(cvCmpS 也可以達到此目的) 或者是去掉噪聲,例如過濾很小或很大象素值的圖像點。本函數支持的對圖像取閾值的方法由 threshold_type 確定:
threshold_type=CV_THRESH_BINARY:
dst(x,y) = max_value, if src(x,y)>threshold 0, otherwise.
threshold_type=CV_THRESH_BINARY_INV:
dst(x,y) = 0, if src(x,y)>threshold; dst(x,y) = max_value, otherwise.
threshold_type=CV_THRESH_TRUNC:
dst(x,y) = threshold, if src(x,y)>threshold;???dst(x,y) = src(x,y), otherwise.
threshold_type=CV_THRESH_TOZERO:
dst(x,y) = src(x,y), if (x,y)>threshold ;? dst(x,y) = 0, otherwise.
threshold_type=CV_THRESH_TOZERO_INV:
dst(x,y) = 0, if src(x,y)>threshold ;??dst(x,y) = src(x,y), otherwise.
左面是圖形化的閾值描述:
?
引自:http://blog.163.com/fk1007@126/blog/static/300367392009226407387/
轉載于:https://www.cnblogs.com/wuyuankun/p/4051979.html
總結
以上是生活随笔為你收集整理的cvThreshold()函数理解的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: c++ 静态全局变量 和 全局变量的区别
- 下一篇: 数据结构之外部排序:置换-选择排序