Commit eeb82bd5 authored by Mickaël Desfrênes's avatar Mickaël Desfrênes
Browse files

fix deskew

parent 9c5f1ddd
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -55,9 +55,11 @@ def _deskew(image_path: str, max_skew: int = 10, fast: bool = True) -> float:
    height, width, _ = im.shape
    if fast:
        scale_factor = 1000 / max(height, width)
        height = int(height * scale_factor)
        width = int(width * scale_factor)
        im = cv2.resize(
            im,
            (int(width * scale_factor), int(height * scale_factor)),
            (width, height),
            interpolation=cv2.INTER_LINEAR,
        )
    im_gs = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)