Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to read frame width of video in cv2

import cv2

vcap = cv2.VideoCapture('video.avi') # 0=camera
 
if vcap.isOpened(): 
    # get vcap property 
    width  = vcap.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH)   # float `width`
    height = vcap.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT)  # float `height`
    # or
    width  = vcap.get(3)  # float `width`
    height = vcap.get(4)  # float `height`

    # it gives me 0.0 :/
    fps = vcap.get(cv2.cv.CV_CAP_PROP_FPS)
Comment

PREVIOUS NEXT
Code Example
Python :: sign python 
Python :: phone numbers 
Python :: list inside a list in python 
Python :: df read csv 
Python :: sequence in python 
Python :: DtypeWarning: Columns (7) have mixed types. Specify dtype option on import or set low_memory=False 
Python :: how to inherit a class in python 
Python :: how to duplicate a row in python 
Python :: numpy indexing 
Python :: inheritance in python 
Python :: python list max value 
Python :: how to replace special characters in a string python 
Python :: ceil function in python 
Python :: while loop in python for do you want to continue 
Python :: new line 
Python :: append vector to vector python 
Python :: abstract class in python 
Python :: django reverse lazy 
Python :: python function to do comparison between two numbers 
Python :: how to create an auto clicker in python 
Python :: python __name__ == "__main__" 
Python :: python class declaration 
Python :: python how to get rid of spaces in print 
Python :: pyaudio mic stream 
Python :: sklearn euclidean distance 
Python :: pandas extracting tables from pdf 
Python :: menu extension in mit app inventor 
Python :: how to get path of all the functions in a python module 
Python :: img_sm = pygame.transform.scale(img, (32, 32)) 
Python :: rstudi matplotlib crash qt 
ADD CONTENT
Topic
Content
Source link
Name
8+9 =