当前位置:网站首页>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 .
边栏推荐
- 2022CoCa: Contrastive Captioners are Image-Text Fountion Models
- Oracle with as ORA-00903: invalid table name 多表报错
- 联想首次详解绿色智城数字孪生平台 破解城市双碳升级难点
- There are multiple divs in the large div, which are displayed on the same line. After overflow, scroll bars are generated without line breaks
- Learning path PHP -- phpstudy "hosts file does not exist or is blocked from opening" when creating the project
- 测试工程师如何“攻城”(上)
- Shell 编程核心技术《一》
- Shell programming core technology "I"
- Unity给自己的脚本添加类似编辑器扩展的功能案例ContextMenu的使用
- 其他InterSystems %Net工具
猜你喜欢
Oracle with as ora-00903: invalid table name multi report error
从实时应用角度谈通信总线仲裁机制和网络流控
Process of manually encrypt the mass-producing firmware and programming ESP devices
Use canal and rocketmq to listen to MySQL binlog logs
Oracle with as ORA-00903: invalid table name 多表报错
Hough Transform 霍夫变换原理
Wireshark网络抓包
Bi skills - permission axis
Lex and yacc based lexical analyzer + parser
物联网应用技术的就业前景和现状
随机推荐
Other InterSystems%net tools
876. Intermediate node of linked list
Shell 编程核心技术《一》
C # implementation defines a set of SQL statements that can be executed across databases in the middle of SQL (detailed explanation of the case)
The latest progress of Intel Integrated Optoelectronics Research promotes the progress of CO packaging optics and optical interconnection technology
添加命名空间声明
How test engineers "attack the city" (Part I)
函数式接口
一文掌握数仓中auto analyze的使用
长城证券开户安全吗 买股票怎么开户
Have you guys ever used CDC direct Mysql to Clickhouse
Nebula Importer 数据导入实践
FPGA时序约束分享01_四大步骤简述
Caché WebSocket
Technologie de base de la programmation Shell IV
The 15th youth informatics competition in Shushan District in 2019
神经网络物联网是什么意思通俗的解释
使用canal配合rocketmq监听mysql的binlog日志
Use canal and rocketmq to listen to MySQL binlog logs
2014 Hefei 31st youth informatics Olympic Games (primary school group) test questions