diff --git a/ar_tag_pose/detector_board_main.py b/ar_tag_pose/detector_board_main.py index 8dce1b4..ba185f5 100644 --- a/ar_tag_pose/detector_board_main.py +++ b/ar_tag_pose/detector_board_main.py @@ -166,7 +166,7 @@ class Detector(abc.ABC): cv.destroyAllWindows() def out_writer(writer: cv.VideoWriter|None, frame: np.ndarray|None, filename: str = None) -> cv.VideoWriter: - if writer is None: + if writer is None and filename is not None: fourcc = cv.VideoWriter.fourcc(*"mp4v") frame_size = (frame.shape[1], frame.shape[0]) writer = cv.VideoWriter(filename=f"{RESULTS_FOLDER}/{filename}", fourcc=fourcc, fps=30.0, frameSize=frame_size)