当前位置:网站首页>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)
我们图片结果为:
边栏推荐
猜你喜欢
HoloView 在 jyputer lab/notebook 不显示总结
Microsoft Azure & NVIDIA IoT developers season I | Azure IoT & NVIDIA Jetson development foundation
【Untitled】
YOLOv7-Pose尝鲜,基于YOLOv7的关键点模型测评
《时代》杂志:元宇宙时代将改变世界
leetcode-6134:找到离给定两个节点最近的节点
C语言中编译时出现警告C4013(C语言不加函数原型产生的潜在错误)
[Beyond programming] When the fig leaf is lifted, when people begin to accept everything
Idea common plugins
Custom IP used in PCIE
随机推荐
MySQL查询进阶——从函数到表连接的使用你还记得吗
sqlserver 对比两张表的差异
HoloView -- Tabular Datasets
用OpenCV的边缘检测
How does UXDB return the number of records for all tables in the current database?
量化日常工作指标
【数据集】各类绝缘子、鸟巢及防震锤数据集汇总
zip package all files in the directory (including hidden files/folders)
The socket option
MySQL query advanced - from the use of functions to table joins, do you remember?
pytest接口自动化测试框架 | 单个/多个参数
zip打包目录所有文件(含隐藏文件/夹)
Leetcode - 6135: the longest part of the figure
Intensive reading of ACmix papers, and analysis of its model structure
灵魂发问:MySQL是如何解决幻读的?
网络基础学习
Custom IP used in PCIE
毕业论文写作技巧
2022杭电中超杯(1)个人题解
leetcode 42. Catch the rain