From 5974ad0996c5d966758110f08b5486e34904acf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Wed, 8 Mar 2023 10:33:36 +0100 Subject: [PATCH] Fix for already gray image --- deskew/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deskew/cli.py b/deskew/cli.py index d408af0..d358f04 100644 --- a/deskew/cli.py +++ b/deskew/cli.py @@ -24,7 +24,7 @@ def main() -> None: options = parser.parse_args() image = io.imread(options.input) - grayscale = image if len(image) == 2 else rgb2gray(image) + grayscale = image if len(image.shape) == 2 else rgb2gray(image) angle = determine_skew(grayscale, sigma=options.sigma, num_peaks=options.num_peaks) if options.output is None: print(f"Estimated angle: {angle}")