diff --git a/klausur-service/backend/cv_preprocessing.py b/klausur-service/backend/cv_preprocessing.py index 133d47f..71c4f50 100644 --- a/klausur-service/backend/cv_preprocessing.py +++ b/klausur-service/backend/cv_preprocessing.py @@ -113,13 +113,13 @@ def detect_and_fix_orientation(img_bgr: np.ndarray) -> Tuple[np.ndarray, int]: if rotate == 0 or confidence < 1.0: return img_bgr, 0 - # Apply rotation + # Apply rotation — OSD rotate is the clockwise correction needed if rotate == 180: corrected = cv2.rotate(img_bgr, cv2.ROTATE_180) elif rotate == 90: - corrected = cv2.rotate(img_bgr, cv2.ROTATE_90_COUNTERCLOCKWISE) - elif rotate == 270: corrected = cv2.rotate(img_bgr, cv2.ROTATE_90_CLOCKWISE) + elif rotate == 270: + corrected = cv2.rotate(img_bgr, cv2.ROTATE_90_COUNTERCLOCKWISE) else: return img_bgr, 0