def _new_capture_device(cls, device_index):
        capture = cv2.VideoCapture(device_index)

        if not capture.isOpened():
            capture.release()

            raise IOError(cls.S_CAPTURE_OPEN_ERROR % device_index)

        return capture