【OpenCV】threshold的几种方式

1. THRESH_BINARY

if src(x,y) > thresh
  dst(x,y) = maxValue
else
  dst(x,y) = 0

2. THRESH_BINARY_INV

if src(x,y) > thresh
  dst(x,y) = 0
else
  dst(x,y) = maxValue

3. THRESH_TRUNC

if src(x,y) > thresh
  dst(x,y) = thresh
else
  dst(x,y) = src(x,y)

4. THRESH_TOZERO

if src(x,y) > thresh
  dst(x,y) = src(x,y)
else
  dst(x,y) = 0

5. THRESH_TOZERO_INV

if src(x,y) > thresh
  dst(x,y) = 0
else
  dst(x,y) = src(x,y)
发布了437 篇原创文章 · 获赞 590 · 访问量 61万+

猜你喜欢

转载自blog.csdn.net/heiheiya/article/details/103006465