![]() ![]() ![]() Just use ret = cap.set( cv.CAP_PROP_FRAME_WIDTH,320) and ret = cap.set( cv.CAP_PROP_FRAME_HEIGHT,240). Value is the new value you want.įor example, I can check the frame width and height by cap.get( cv.CAP_PROP_FRAME_WIDTH) and cap.get( cv.CAP_PROP_FRAME_HEIGHT). Some of these values can be modified using cap.set(propId, value). Full details can be seen here: cv::VideoCapture::get(). Each number denotes a property of the video (if it is applicable to that video). You can also access some of the features of this video using cap.get(propId) method where propId is a number from 0 to 18. You can check whether it is initialized or not by the method cap.isOpened(). Sometimes, cap may not have initialized the capture. So you can check for the end of the video by checking this returned value. If the frame is read correctly, it will be True. Cap.read() returns a bool ( True/ False).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |