Get video dimension in python-opencv

后端 未结 5 1063
有刺的猬
有刺的猬 2021-01-07 16:35

I can get size of image, like this:

import cv2

img = cv2.imread(\'my_image.jpg\',0)
height, width = img.shape[:2]

How about video?

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-07 16:47

    You can use the vcap.get(i) method, where i can be between 0 and 21, according to the OpenCV docs.

提交回复
热议问题