zoukankan      html  css  js  c++  java
  • cvThreshold()函数理解

    对图像二值化函数cvThreshold的理解

    Threshold

    对数组元素进行固定阈值操作

    void cvThreshold( const CvArr* src, CvArr* dst, double threshold, double max_value, int threshold_type );

    src
    原始数组 (单通道 , 8-bit of 32-bit 浮点数).
    dst
    输出数组,必须与 src 的类型一致,或者为 8-bit.
    threshold
    阈值
    max_value
    使用 CV_THRESH_BINARY 和 CV_THRESH_BINARY_INV 的最大值.
    threshold_type
    阈值类型 (见讨论)

    函 数 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.

    左面是图形化的阈值描述:

    2009年3月26日 - 老柯 - 菜鸟的朝圣之路

     

    引自:http://blog.163.com/fk1007@126/blog/static/300367392009226407387/

  • 相关阅读:
    ERP渠道管理添加验证和查询(二十二)
    SqlServer导入Excel数据
    WebApi帮助类
    SqlServer 递归查询树
    SqlServer查看表、存储过程、耗时查询、当前进程、开销较大的语句
    Excel上传找到错误数据类型
    索引Hint提示(INDEX Hint)
    SqlServer批量Sql一个表的数据导入到另一个数据
    SqlServer 游标
    JAVA运算符
  • 原文地址:https://www.cnblogs.com/wuyuankun/p/4051979.html
Copyright © 2011-2022 走看看