def toggle_debug_mode(self): self.debug_mode = not self.debug_mode if not self.debug_mode: cv2.destroyWindow(DEBUG_WINDOW)