当前位置:网站首页>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)
我们图片结果为:
边栏推荐
猜你喜欢

SaaS安全认证综合指南

net stop/start mysql80 拒绝访问

最新的Cesium和Three的整合方法(附完整代码)

Leicester Weekly 304 6135. The longest ring in the picture Inward base ring tree

HoloView--Customization

走进音视频的世界——mp3封装格式

如何保证数据库与缓存数据一致性?

巧妙利用unbuffer实时写入

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

The soul asks: How does MySQL solve phantom reads?
随机推荐
zip打包目录所有文件(含隐藏文件/夹)
Manual upgrade and optimization tutorial of Lsky Pro Enterprise Edition
Intensive reading of ACmix papers, and analysis of its model structure
2022杭电中超杯(1)个人题解
正则表达式符号
Holoview--Introduction
Gethostbyname \ getaddrinfo DNS domain name IP address is not safe
pytest interface automation testing framework | pass in parameter values in the form of function return values
HoloView--Customization
SkiaSharp 之 WPF 自绘 五环弹动球(案例版)
codeforces每日5题(均1600)-第二十七天
最新的Cesium和Three的整合方法(附完整代码)
如何保证数据库与缓存数据一致性?
STM32个人笔记-看门狗
C语言中编译时出现警告C4013(C语言不加函数原型产生的潜在错误)
leetcode-6132:使数组中所有元素都等于零
JVM内存模型之深究模型特征
various network protocols
Shell executes SQL to send emails
GO error handling