对图像二值化函数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.

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

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

cvThreshold()函数理解的更多相关文章

  1. MySQL的COUNT()函数理解

    MySQL的COUNT()函数理解 标签(空格分隔): MySQL5.7 COUNT()函数 探讨 写在前面的话 细心的朋友会在平时工作和学习中,可以看到MySQL的COUNT()函数有多种不同的参数 ...

  2. JavaScript-闭包函数(理解)

    JavaScript-闭包函数(理解) var foo = function (a) { return function inner () { console.log(a) } } var faa = ...

  3. [转帖]C语言计算时间函数 & 理解linux time命令的输出中“real”“user”“sys”的真正含义

    C语言计算时间函数 & 理解linux time命令的输出中“real”“user”“sys”的真正含义 https://blog.csdn.net/willyang519/article/d ...

  4. 图片放大功能插件及jquery.extend函数理解

    前端时间,产品提出社区评论中的图片需要有放大功能.感觉可以共用,所以就想整合一个插件,过程中也借鉴了一些例子. 分析下自己的代码思路: var scaleImg = function(opts) { ...

  5. jquery函数理解与运用

    javascript中有多种不用的方式去理解函数,函数类似于我们以前学过的数学函数,但是在程序设计中,我是按照下面的方式进行理解: 函数的理解: 函数是一个代码块,内容被包含在函数内,通常我们是把一些 ...

  6. public static void main(String[] args){}函数理解

    主函数的一般写法如下: public static void main(String[] args){…} 下面分别解释这些关键字的作用: (1)public关键字,这个好理解,声明主函数为publi ...

  7. 结合php ob函数理解缓冲机制

    对于一个刚刚入门的php程序员来说,php缓冲区是几乎透明的.在他们心目中,一个echo print_r 函数,数据便会‘嗖’的一声飞到浏览器上,显示出来.我也一直如此单纯地认为. 其实,在技术的世界 ...

  8. 数组中的reduce 函数理解

    第一次见到reduce 是在js 的高级程序设计中,它的意思是把一个数组减少为一个数,举的例子是数组中元素的求和.它接受一个函数作为参数,函数又有两个参数,一个是prev, 前一个值,一个是next, ...

  9. js 回调函数理解与应用

    定义:在JavaScript中,回调函数具体的定义为:函数A作为参数(函数引用)传递到另一个函数B中,并且这个函数B执行函数A.我们就说函数A叫做回调函数.如果没有名称(函数表达式),就叫做匿名回调函 ...

随机推荐

  1. bash shell——与if条件相关的参数意义

    最近编写脚本,常看到有 if [ -x $variable ] 类的条件语句,不知道相应参数的意义到底是什么, 特摘录如下:from   http://blog.csdn.net/aaaaatiger ...

  2. fatal error LINK1123:failure during conversion to COFF:file invalid or corrupt

    Visual Studio 2010编译时出现:fatal error LINK1123:failure during conversion to COFF:file invalid or corru ...

  3. Codeforces 114A-Cifera(暴力)

    A. Cifera time limit per test 2 seconds memory limit per test 256 megabytes input standard input out ...

  4. 06 MDB将数据和dataGridView1绑定

    附件:http://files.cnblogs.com/xe2011/dataGridView1_bindingNavigator1_bindingSource1.rar 实现功能 对.MDB文件进行 ...

  5. activity中实现Spinner绑定

    (1)须要一个基本的布局文件activity_main <RelativeLayout xmlns:android="http://schemas.android.com/apk/re ...

  6. nginx lua 开发笔记

    获取 在lua代码中获取 location 正则的参数对应的变量 // location location ~/lua_http_2/(\w*.+) { } // lua local vars=ngx ...

  7. mysql的优化措施,从sql优化做起

    http://geeksblog.cc/2016/06/11/mysql-optimize/ 优化sql的一般步骤 通过show status了解各种sql的执行频率 定位执行效率低的sql语句 通过 ...

  8. AOP 的利器:ASM 3.0 介绍

    引言 什么是 ASM ? ASM 是一个 Java 字节码操控框架.它能被用来动态生成类或者增强既有类的功能.ASM 可以直接产生二进制 class 文件,也可以在类被加载入 Java 虚拟机之前动态 ...

  9. centos emacs安装

    wget http://mirrors.ustc.edu.cn/gnu/emacs/emacs-24.5.tar.gz tar zxvf emacs-24.5.tar.gz cd emacs-24.5 ...

  10. LINQ数据库连接对象制造工厂

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.D ...