def METHOD_NAME(args):
    try:
        device_no = int(os.path.realpath(args.device)[-1])
    except ValueError:
        raise SystemExit(
            "ERROR: video source not found: {}".format(args.device))
    cap = cv2.VideoCapture(device_no)
    # The camera driver will adjust the capture size
    cap.set(cv2.cv.CV_CAP_PROP_FRAME_WIDTH, args.width)
    cap.set(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT, args.height)
    if cap is None or not cap.isOpened():
        raise SystemExit(
            "ERROR: unable to open video source: {}".format(args.device))
    return cap