当前位置:网站首页>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 .
边栏推荐
- Scala basic tutorial -- 19 -- actor
- 《工作、消费主义和新穷人》的微信读书笔记
- Oracle with as ORA-00903: invalid table name 多表报错
- Build your own website (15)
- sqlserver的CDC第一次查询的能读取到数据,但后面增删改读取不到,是什么原因
- One question per day (2022-07-02) - Minimum refueling times
- Unity编辑器扩展C#遍历文件夹以及子目录下的所有图片
- 长城证券开户安全吗 买股票怎么开户
- Is the securities account opened by qiniu safe?
- Rookie post station management system based on C language
猜你喜欢
Process of manually encrypt the mass-producing firmware and programming ESP devices
Summary and sorting of 8 pits of redis distributed lock
PolyFit软件介绍
Nebula importer data import practice
一文掌握数仓中auto analyze的使用
用实际例子详细探究OpenCV的轮廓绘制函数drawContours()
英特尔集成光电研究最新进展推动共封装光学和光互连技术进步
[uniapp] uniapp development app online Preview PDF file
“只跑一趟”,小区装维任务主动推荐探索
读写关闭的channel是啥后果?
随机推荐
模板_大整数减法_无论大小关系
Scala basic tutorial -- 15 -- recursion
sqlserver的CDC第一次查询的能读取到数据,但后面增删改读取不到,是什么原因
函数式接口
Don't just learn Oracle and MySQL!
Li Chi's work and life summary in June 2022
如何使用Async-Awati异步任务处理代替BackgroundWorker?
Leetcode fizzbuzz C # answer
Hough Transform 霍夫变换原理
[opencv introduction to mastery 9] opencv video capture, image and video conversion
在线文本行固定长度填充工具
Caché JSON 使用JSON适配器
Cache é JSON uses JSON adapters
Shell 编程核心技术《四》
Oracle with as ORA-00903: invalid table name 多表报错
FPGA时序约束分享01_四大步骤简述
How test engineers "attack the city" (Part I)
Shell 編程核心技術《四》
一文掌握数仓中auto analyze的使用
Oracle with as ora-00903: invalid table name multi report error