当前位置:网站首页>opencv创建窗口—cv.namedWindow()
opencv创建窗口—cv.namedWindow()
2022-08-01 09:14:00 【旅途中的宽~】
1、格式:
cv.namedWindow(winname[, flags])
2、功能:
创建一个窗口
3、输入:
winname:窗口名
flags:窗口创建模式,包括:
(1)WINDOW_NORMAL 或 WINDOW_AUTOSIZE
WINDOW_NORMAL:窗口尺寸可变
WINDOW_AUTOSIZE:窗口尺寸为图像尺寸,不可变
(2)WINDOW_KEEPRATIO 或 WINDOW_FREERATIO
WINDOW_KEEPRATIO:保持图像宽高比
WINDOW_FREERATIO:图像宽高比可变
(3)WINDOW_GUI_EXPANDED 或 WINDOW_GUI_NORMAL
WINDOW_GUI_EXPANDED:窗口带有工具栏和状态栏
WINDOW_GUI_NORMAL:窗口不带工具栏和状态栏
默认的 flags 为:
WINDOW_AUTOSIZE | WINDOW_KEEPRATIO | WINDOW_GUI_EXPANDED
3、输出:
None
4、示例:
# 导入 OpenCV
import cv2 as cv
# 读取图像
image = cv.imread(r'fire.jpeg')
# 创建窗口
cv.namedWindow('image', cv.WINDOW_NORMAL)
# 显示图像
cv.imshow('image', image)
cv.waitKey(0)
我们图片结果为:
边栏推荐
- XX市消防救援指挥中心实战指挥平台多链路聚合解决方案实例
- pytest接口自动化测试框架 | 单个/多个参数
- Manual upgrade and optimization tutorial of Lsky Pro Enterprise Edition
- 22牛客多校1 J.Serval and Essay (启发式合并)
- HoloView 在 jyputer lab/notebook 不显示总结
- leetcode 42. 接雨水
- 微服务:事务管理
- [Beyond programming] When the fig leaf is lifted, when people begin to accept everything
- HoloView--Customization
- 扁平数组转树结构实现方式
猜你喜欢

ACmix 论文精读,并解析其模型结构

net stop/start mysql80 access denied

leetcode-6132:使数组中所有元素都等于零

What do the values 1, 2, and 3 in nodetype mean?

基于MySql,Redis,Mq,ES的高可用方案解析

SAP ABAP ALV+SMARTFORS 表分页 报表打印程序

Analysis of High Availability Solution Based on MySql, Redis, Mq, ES

HoloView--Customization

SaaS安全认证综合指南

Redis learning
随机推荐
Flink SQL - client, how to deal with the source side and to increase the target, the SQL - client including mapping table and the JOB such as
Idea common plugins
22 Niu Ke Duo School 1 I. Chiitoitsu (Probability dp)
Go supports OOP: use struct instead of class
[Dataset] Dataset summary of various insulators, bird's nests and anti-vibration hammers
GBase 8s 锁分类
gethostbyname \ getaddrinfo 解析域名IP地址不安全的原因
[Interview: Concurrency 39: Multithreading: Thread Pool] ThreadPoolExecutor Class - Submit, Stop
How to query database configuration parameters in GBase 8c, such as datestyle
Manual upgrade and optimization tutorial of Lsky Pro Enterprise Edition
最新的Cesium和Three的整合方法(附完整代码)
Get the Token from the revised version of Qubutu Bed
获取页面数据的方法
Classify GBase 8 s lock
解析MySQL数据库:“SQL优化”与“索引优化”
A problem with writing to the database after PHP gets the timestamp
leetcode-6132: Make all elements in array equal to zero
量化日常工作指标
Pod环境变量和initContainer
VoLTE基础学习系列 | 企业语音网简述