Skip to content

Commit

Permalink
changed rotation function
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Golodkov committed Dec 26, 2023
1 parent 9ae8512 commit 9337554
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dedocutils/preprocessing/skew_corrector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 9337554

Please sign in to comment.