diff --git a/onboard/python/implementation/drones/ModalAISeekerDrone.py b/onboard/python/implementation/drones/ModalAISeekerDrone.py index 91a4d3be..4867a1cf 100644 --- a/onboard/python/implementation/drones/ModalAISeekerDrone.py +++ b/onboard/python/implementation/drones/ModalAISeekerDrone.py @@ -242,7 +242,11 @@ def __init__(self, drone, ip): def run(self): try: while(self.isRunning): - ret, self.currentFrame = self.cap.read() + ret, frame = self.cap.read() + if len(frame.shape) < 3: # Grayscale + self.currentFrame = cv2.cvtColor(frame, cv2.COLOR_GRAY2BGR) + else: + self.currentFrame = frame except Exception as e: print(e)