OpenCV的AdaptiveThreshold函数
2015-10-20 10:29
148 查看
摘自于OpenCV Doc2.410,opencv2refman文档.
1.函数原型
2.图片处理效果
原始图片:
处理效果:
对比Canny的处理效果:
结果就差一个反色处理?
Canny+反色
3.方法分析
参考链接:http://blog.chinaunix.net/uid-20805029-id-1704893.html
函数 cvAdaptiveThreshold 将灰度图像变换到二值图像;
对方法 CV_ADAPTIVE_THRESH_MEAN_C,先求出块中的均值,再减掉param1。
对方法 CV_ADAPTIVE_THRESH_GAUSSIAN_C ,先求出块中的加权和(gaussian), 再减掉param1。
参数不同会产生不同的转换效果.
1.函数原型
adaptiveThreshold //Applies an adaptive threshold to an array. C++: void adaptiveThreshold(InputArray src, OutputArray dst, double maxValue, int adaptiveMethod,int thresholdType, int blockSize, double C) Python: cv2.adaptiveThreshold(src, maxValue, adaptiveMethod, thresholdType, blockSize, C[, dst ]) !dst C: void cvAdaptiveThreshold( const CvArr* src, CvArr* dst, double max_value, int adaptive_method=CV_ADAPTIVE_THRESH_MEAN_C, int threshold_type=CV_THRESH_BINARY, int block_size=3, double param1=5) Python: cv.AdaptiveThreshold(src, dst, maxValue, adaptive_method=CV_ADAPTIVE_THRESH_MEAN_C,thresholdType=CV_THRESH_BINARY, blockSize=3, param1=5) ! None Parameters src – Source 8-bit single-channel image. dst – Destination image of the same size and the same type as src . maxValue – Non-zero value assigned to the pixels for which the condition is satisfied. See the details below. adaptiveMethod – Adaptive thresholding algorithm to use, ADAPTIVE_THRESH_MEAN_C or ADAPTIVE_THRESH_GAUSSIAN_C . See the details below. thresholdType – Thresholding type that must be either THRESH_BINARY or THRESH_BINARY_INV .
2.图片处理效果
原始图片:
处理效果:
对比Canny的处理效果:
结果就差一个反色处理?
Canny+反色
3.方法分析
参考链接:http://blog.chinaunix.net/uid-20805029-id-1704893.html
函数 cvAdaptiveThreshold 将灰度图像变换到二值图像;
对方法 CV_ADAPTIVE_THRESH_MEAN_C,先求出块中的均值,再减掉param1。
对方法 CV_ADAPTIVE_THRESH_GAUSSIAN_C ,先求出块中的加权和(gaussian), 再减掉param1。
参数不同会产生不同的转换效果.
相关文章推荐
- linux服务器被挂马,ps命令netstat命令被挟持替换成其他程序
- Linux 通用中断子系统
- Zabbix监控之系统及应用日志监控报警
- 10月第2周全球域名商新增注册量TOP15:西部数码夺冠
- HDFS的架构及原理
- Linux IPC实践(3) --具名FIFO
- OpenCV之处理视频帧
- Linux下ls命令实现
- 一台机器开多个tomcat
- Linux IPC实践(1) --匿名PIPE
- 64位arm_Linux操作系统驱动兼容性问题
- 阿里云 Ubuntu操作系统 配置虚拟主机
- linux下core文件设置, Core Dump
- Hadoop之RPC简单实现
- Linux 反向删除文件(排除特定文件)
- Linux内核编译和安装
- linux远程传输文件scp命令
- Ubuntu14.04+Python3.4+apache2.4+Django1.7站点发布笔记
- Tomcat部署web应用的方式
- HelloworldJsp中引入tomcat-juli处理