使用 imagemagick 检测倾斜图像

发布于 2025-01-12 20:37:31 字数 242 浏览 2 评论 0原文

我之前发布了如何自动修复倾斜的图像,有没有办法简单地用 image magick 检测它是否倾斜?即,是否有一个命令可以在两个图像上运行,一个倾斜,一个不倾斜,并使用该输出作为其是否倾斜的决定因素?

感谢您的帮助, 凯文

I previously posted how to auto fix a skewed image, is there a way to simply detect that it is skewed with image magick? I.e. is there a command that I could run on two images, one skewed and one not, and use that output as the determinant of whether it's skewed?

Thanks for any help,
Kevin

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

海拔太高太耀眼 2025-01-19 20:37:31

更正我上面的评论。如果您有规则的文本行,有一种方法可以确定 Imagemagick 中的倾斜角度。

输入:

在此处输入图像描述

convert img.jpg -deskew 60% -format "%[deskew:angle]" info:

2.18111

请参阅https://imagemagick.org/script/escape.php

Correction to my comment above. There is a way to determine the skew angle in Imagemagick if you have regular lines of text.

Input:

enter image description here

convert img.jpg -deskew 60% -format "%[deskew:angle]" info:

2.18111

See https://imagemagick.org/script/escape.php

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文