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

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

主站蜘蛛池模板: 余姚市| 东阿县| 双流县| 曲水县| 竹山县| 烟台市| 五寨县| 建平县| 交口县| 阿合奇县| 梁河县| 乐安县| 石城县| 扶风县| 绥滨县| 嵩明县| 阿拉善左旗| 东阳市| 西昌市| 延吉市| 澄江县| 商都县| 南郑县| 偏关县| 瑞金市| 博罗县| 高邑县| 丹江口市| 新乐市| 衡水市| 保亭| 大丰市| 建宁县| 海宁市| 宝丰县| 日照市| 章丘市| 娄底市| 孝感市| 萍乡市| 密山市|