图像大小(Python,OpenCV) [英] Image size (Python, OpenCV)
本文介绍了图像大小(Python,OpenCV)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想用python来获取图像大小,就像我用c ++一样.
I would like to get the Image size in python,as I do it with c++.
int w = src->width;
printf("%d", 'w');
推荐答案
使用函数cv的="noreferrer"> GetSize
,其中您的图片作为参数.它以包含两个元素的元组的形式返回宽度,高度:
Use the function GetSize
from the module cv
with your image as parameter. It returns width, height as a tuple with 2 elements:
width, height = cv.GetSize(src)
这篇关于图像大小(Python,OpenCV)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文