opencv中阈值函数处理
2014-04-19 18:37
459 查看
opencv2.46
函数:threshold
函数的原型如下:
//! applies fixed threshold to the image
double threshold( InputArray src, OutputArray dst, double thresh, double maxval, int type );
src – input array (single-channel, 8-bit or 32-bit floating point):输入元素必须是单通道,8位的数或32位的浮点数
dst – output array of the same size and type as src.:输出和输入应该有相同的大小和类型
type的类型有如下:
例:threshold(ROI_image, binary_img, thres, MAX_VALUE,CV_THRESH_BINARY);
当ROI_image中的value > thres的时候,value设置为MAX_VALUE,否则设置为 0 。
参考:
1.opencv官方文档 opencv官方文档 opencv官方文档 opencv官方文档 opencv官方文档 opencv官方文档 opencv官方文档 opencv官方文档 opencv官方文档 opencv官方文档 opencv官方文档 :threshold
函数:threshold
函数的原型如下:
//! applies fixed threshold to the image
double threshold( InputArray src, OutputArray dst, double thresh, double maxval, int type );
src – input array (single-channel, 8-bit or 32-bit floating point):输入元素必须是单通道,8位的数或32位的浮点数
dst – output array of the same size and type as src.:输出和输入应该有相同的大小和类型
type的类型有如下:
/* Threshold types */ enum { CV_THRESH_BINARY =0, /* value = value > threshold ? max_value : 0 */ CV_THRESH_BINARY_INV =1, /* value = value > threshold ? 0 : max_value */ CV_THRESH_TRUNC =2, /* value = value > threshold ? threshold : value */ CV_THRESH_TOZERO =3, /* value = value > threshold ? value : 0 */ CV_THRESH_TOZERO_INV =4, /* value = value > threshold ? 0 : value */ CV_THRESH_MASK =7, CV_THRESH_OTSU =8 /* use Otsu algorithm to choose the optimal threshold value; combine the flag with one of the above CV_THRESH_* values */ };
例:threshold(ROI_image, binary_img, thres, MAX_VALUE,CV_THRESH_BINARY);
当ROI_image中的value > thres的时候,value设置为MAX_VALUE,否则设置为 0 。
参考:
1.opencv官方文档 opencv官方文档 opencv官方文档 opencv官方文档 opencv官方文档 opencv官方文档 opencv官方文档 opencv官方文档 opencv官方文档 opencv官方文档 opencv官方文档 :threshold
相关文章推荐
- Linux——进程
- 如何运用色彩心理学来提高网站转化率
- Linux入门 Part2: 目录操作(2) - pwd&which 我...我在哪?
- 第五章703N 刷openwrt 挂载u盘
- Apache Shiro 使用手册(一)Shiro架构介绍
- Linux/UNIX之文件和目录(2)
- 请说明new operator和operator new之间的差异
- 在阿里云 centos 6.3上面安装php5.2
- Linux/UNIX之文件和目录(1)
- hadoop学习笔记(一)
- OpenStack Grizzly中的nova-conductor
- CentOS 6.3下搭建Web服务器
- windows和Linux启动过程对比
- OpenSymphony
- Linux——从命令界面管理网页
- Apache Prefork、Worker和Event三种MPM分析
- linux : Invalid or corrupt jarfile
- Apache配置虚拟主机
- linux shell时间戳转日期字符串
- TOMCAT服务器不写端口号、不写项目名访问项目、虚拟目录配置