how to convert to rgb format using cv2 code example Example: bgr to rgb opencv img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)