官术网_书友最值得收藏!

Reading a video file

cv2.VideoCapture also allows us to read a video file. Therefore, to read a video file, the path to the video file should be provided when creating the cv2.VideoCapture object:

# We first create the ArgumentParser object 
# The created object 'parser' will have the necessary information
# to parse the command-line arguments into data types.
parser = argparse.ArgumentParser()

# We add 'video_path' argument using add_argument() including a help.
parser.add_argument("video_path", help="path to the video file")
args = parser.parse_args()

# Create a VideoCapture object. In this case, the argument is the video file name:
capture = cv2.VideoCapture(args.video_path)

Check out read_video_file.py to see the full example of how to read and display a video file using cv2.VideoCapture

主站蜘蛛池模板: 龙州县| 洞头县| 双流县| 富川| 吐鲁番市| 英超| 奉节县| 深圳市| 焦作市| 克什克腾旗| 栾川县| 如东县| 怀柔区| 浪卡子县| 衢州市| 香港 | 曲阳县| 介休市| 财经| 惠来县| 太原市| 靖安县| 阳高县| 汉阴县| 广东省| 武乡县| 仪征市| 鹤峰县| 德惠市| 东兰县| 安新县| 朔州市| 东平县| 增城市| 肥城市| 晋江市| 长兴县| 东台市| 醴陵市| 长乐市| 元氏县|