diff --git a/CHANGELOG.md b/CHANGELOG.md index c8fc1a6..f72c2be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ Changelog ========= +v0.3.6 (2023-12-26) +------------------- +* Fix image orientation correction in `SkewCorrector` + v0.3.5 (2023-10-02) ------------------- * Delete `Serializable` class diff --git a/VERSION b/VERSION index 09e9157..53b61ec 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.5 \ No newline at end of file +0.3.6 \ No newline at end of file diff --git a/dedocutils/preprocessing/skew_corrector.py b/dedocutils/preprocessing/skew_corrector.py index 69d4ffb..ddd7dbd 100644 --- a/dedocutils/preprocessing/skew_corrector.py +++ b/dedocutils/preprocessing/skew_corrector.py @@ -22,7 +22,8 @@ def preprocess(self, image: np.ndarray, parameters: Optional[dict] = None) -> Tu orientation_angle = parameters.get("orientation_angle", 0) if orientation_angle: - image = rotate_image(image, orientation_angle) + rotation_nums = orientation_angle // 90 + image = np.rot90(image, rotation_nums) gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) thresh = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1]