当前位置:网站首页>cv2.resize的坑
cv2.resize的坑
2022-07-16 10:23:00 【AI浩】
记录一下使用resize遇到的坑。
一般情况下,我们使用resize的时候,总是把图片resize成正方形,所以不用关心dsize的设置,但是,如果resize成长方形就要考虑。
读取一张图片,代码如下:
import cv2
img=cv2.imread('aa.jpg')
print(img.shape)
打印出来的结果:
(1857, 1045, 3)
查看属性得知:(h,w,c)的顺序。
下面我们进行Resize操作。
比如我们要Resize成高度是500,宽度是300的图像。
img_resize=cv2.resize(img,dsize=(300,500))
print(img_resize.shape)
运行结果:
(500, 300, 3)
注意:dsize的参数,是(宽,高)
边栏推荐
- Want to communicate? Talk about money, talk about protobuf
- [QNX Hypervisor 2.2用户手册]8.2 Guest退出
- 新职业“数据库运行管理员”职业标准启动开发
- UWA report uses tips. Did you get it? (the fifth bullet)
- list map基础笔记记录
- English语法_定冠词the_小细节
- Block的底层实现
- [recursion] square filling (backtracking method)
- Debugging of diagnostic function of analog power amplifier 75610
- Use flutter to make a beating heart
猜你喜欢

Self-Signed SSL证书创建和使用

@Conditional的简单使用

Use flutter to make a beating heart

模拟功放75610诊断功能的调试

8图教你如何配置 SNMP

To achieve win-win results in team work efficiency and quality, this office collaboration tool is really enough!

Summary: Prometheus matching pattern

【TensorFlow2.9】泰坦尼克号生存预测—结构化数据建模流程

Several calling methods of Oracle stored procedure

Search - binary sort tree (2)
随机推荐
[QNX hypervisor 2.2 user manual]8.1 overhead in virtual environment
The second week of summer vacation
现代化个人博客系统 ModStartBlog v5.3.0 留言接口新增,富文本升级
字符串和内存函数
@ConditionalOnProperty的简单理解与使用
Economic Daily praised Hongji, a leading RPA enterprise, for helping financial institutions with their digital transformation
The principle and design principle of index
思科CCNP认证介绍
【node+ts】搭建node+typescript项目
数据库每日一题---第24天:格式化部门表
Best practice path for problem solving
Hcip - ppp/hdlc and gre/mgre experiments
MATLAB数字图像处理 实验二:单像素空域图像增强
Redis基础课程讲义
Unity 基础 之 Camera摄像机属性介绍
【今天的小go同学要去丢垃圾(3)】
Elk service of elk cluster deployment (10)
Upgrade mysql5.5.27 to 5.7.35 under Windows Environment
查找——二叉排序树(二)
Several calling methods of Oracle stored procedure