当前位置:网站首页>Detailed explanation of the binary processing function threshold() of opencv
Detailed explanation of the binary processing function threshold() of opencv
2022-07-04 19:28:00 【Haohong image algorithm】
The importance of binary processing for image processing is not much to say .
OpenCV Provides functions threshold() Used for binary processing of images .
Its prototype is as follows :
C++ Prototype :
double cv::threshold( InputArray src,
OutputArray dst,
double thresh,
double maxval,
int type
)
Python The prototype is as follows :
retval, dst = cv.threshold(src, thresh, maxval, type[, dst])
The meaning of the parameter is as follows :
src— The input image , It can be multi-channel ,8 Bit or 32 Image of bit dot data type , But when type choice THRESH_OTSU or THRESH_TRIANGLE when , Images can only 8 Bit single channel image .
dst— Output image after binarization .
thresh— Threshold for binarization . When type choice THRESH_OTSU or THRESH_TRIANGLE when , This value is ignored , At this time, the function passes OTSU Law or TRIANGLE Method to calculate the threshold value for binary operation .
maxval— After binarization maxval value , See parameters for details type Enumeration value of and its significance . When type choice THRESH_BINARY or THRESH_BINARY_INV I'll use it when I'm going to .
type— The optional enumeration values and meanings of this parameter are as follows :
Compared with C++ The prototype of the , stay Python In the prototype of , There are two return parameters , The first return parameter retval Representative function threshold() The value of the threshold used in the binarization process , That's good , Especially for type choice THRESH_OTSU or THRESH_TRIANGLE when , We can know what threshold is used . I once wrote a blog about this situation , link :https://blog.csdn.net/wenhao_ir/article/details/125188532
After understanding the meaning and value of each parameter , You should have a basic understanding of the use of this function , Next, just look at a few more examples to master .
Examples please move your blog posts https://blog.csdn.net/wenhao_ir/article/details/125592598 see .
边栏推荐
- Wechat reading notes of "work, consumerism and the new poor"
- Stream流
- Wireshark网络抓包
- 工厂从自动化到数字孪生,图扑能干什么?
- 升级智能开关,“零火版”、“单火”接线方式差异有多大?
- php伪原创api对接方法
- SSL证书续费相关问题详解
- Use canal and rocketmq to listen to MySQL binlog logs
- Unity editor extends C to traverse all pictures in folders and subdirectories
- [mathematical basis of machine learning] (I) linear algebra (Part 1 +)
猜你喜欢
随机推荐
工厂从自动化到数字孪生,图扑能干什么?
神经网络物联网是什么意思通俗的解释
BI技巧丨权限轴
神经网络物联网平台搭建(物联网平台搭建实战教程)
LM10丨余弦波动顺势网格策略
2022CoCa: Contrastive Captioners are Image-Text Fountion Models
《工作、消费主义和新穷人》的微信读书笔记
876. 链表的中间结点
Rookie post station management system based on C language
Leetcode ransom letter C # answer
Shell programming core technology "I"
Technology sharing | interface testing value and system
请教一下 flinksql中 除了数据统计结果是状态被保存 数据本身也是状态吗
Upgrade the smart switch, how much is the difference between the "zero fire version" and "single fire" wiring methods?
自由小兵儿
Shell 编程核心技术《四》
Generate XML elements
Torchdrug tutorial
C#实现定义一套中间SQL可以跨库执行的SQL语句(案例详解)
prometheus安装

![[发布] 一个测试 WebService 和数据库连接的工具 - DBTest v1.0](/img/4e/4154fec22035725d6c7aecd3371b05.jpg)






