当前位置:网站首页>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 .
边栏推荐
- Shell programming core technology "three"
- 关于判断点是否位于轮廓内的一点思考
- 2022养生展,健康展,北京大健康展,健康产业展11月举办
- Wechat reading notes of "work, consumerism and the new poor"
- 2022CoCa: Contrastive Captioners are Image-Text Fountion Models
- From automation to digital twins, what can Tupo do?
- Leetcode fizzbuzz C # answer
- 问下各位大佬有用过cdc直接mysql to clickhouse的么
- [release] a tool for testing WebService and database connection - dbtest v1.0
- Learning path PHP -- phpstudy "hosts file does not exist or is blocked from opening" when creating the project
猜你喜欢
Process of manually encrypt the mass-producing firmware and programming ESP devices
2022CoCa: Contrastive Captioners are Image-Text Fountion Models
[release] a tool for testing WebService and database connection - dbtest v1.0
Lex and yacc based lexical analyzer + parser
正则替换【JS,正则表达式】
建立自己的网站(15)
Hough Transform 霍夫变换原理
Nebula importer data import practice
Stream流
There are multiple divs in the large div, which are displayed on the same line. After overflow, scroll bars are generated without line breaks
随机推荐
Scala basic tutorial -- 20 -- akka
BI技巧丨权限轴
FPGA时序约束分享01_四大步骤简述
The CDC of sqlserver can read the data for the first time, but it can't read the data after adding, deleting and modifying. What's the reason
Scala basic tutorial -- 19 -- actor
A method of using tree LSTM reinforcement learning for connection sequence selection
问下各位大佬有用过cdc直接mysql to clickhouse的么
The kth largest element in the array
876. 链表的中间结点
From automation to digital twins, what can Tupo do?
千万不要只学 Oracle、MySQL!
Build your own website (15)
从实时应用角度谈通信总线仲裁机制和网络流控
Shell programming core technology "I"
使用FTP
C # implementation defines a set of SQL statements that can be executed across databases in the middle of SQL (detailed explanation of the case)
数组中的第K个最大元素
Scala basic tutorial -- 17 -- Collection
Download the first Tencent technology open day course essence!
IBM WebSphere MQ retrieving messages