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

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

主站蜘蛛池模板: 保定市| 松潘县| 德格县| 于都县| 股票| 无锡市| 分宜县| 松潘县| 富宁县| 来凤县| 城口县| 昭通市| 神木县| 日喀则市| 明星| 蒙阴县| 柳江县| 广南县| 金川县| 红安县| 湘乡市| 九江县| 安远县| 晋城| 垦利县| 海林市| 固阳县| 泾川县| 镇安县| 林州市| 秦皇岛市| 西吉县| 安龙县| 三亚市| 宣城市| 耿马| 宝兴县| 浦东新区| 建始县| 铜鼓县| 同仁县|