由Marek Mauder
https://galfar.vevb.net/deskew
https://github.com/galfar/deskew
V1.30 2019-06-07
Diskew是用于Diskewing扫描文本文档的命令行工具。它使用霍夫变换来检测图像中的“文本线”。作为输出,您将旋转图像,以使线路是水平的。
这些平台(位于bin文件夹中)构建了预编译的二进制文件:win64( deskew.exe ),win32( deskew32.exe ),linux x86_64(deskew)( deskew ),macOS x86_64( deskew-mac (deskew-mac),linux臂aarch aarch aarch64(deskew-arch664( deskew-arm64 )和v7( deskew-arm )。
此CLI工具的GUI前端也可用(Windows,Linux和MacOS),请参阅GUI的Readme。
许可证:MPL 2.0
https://github.com/galfar/deskew/releases
https://galfar.vevb.net/deskew#downloads
Usage:
deskew [-o output] [-a angle] [-b color] [..] input
input: Input image file
Options:
-o output: Output image file (default: out.png)
-a angle: Maximal expected skew angle (both directions) in degrees (default: 10)
-b color: Background color in hex format RRGGBB|LL|AARRGGBB (default: black)
Ext. options:
-q filter: Resampling filter used for rotations (default: linear,
values: nearest|linear|cubic|lanczos)
-t a|treshold: Auto threshold or value in 0..255 (default: a)
-r rect: Skew detection only in content rectangle (pixels):
left,top,right,bottom (default: whole page)
-f format: Force output pixel format (values: b1|g8|rgb24|rgba32)
-l angle: Skip deskewing step if skew angle is smaller (default: 0.01)
-g flags: Operational flags (any combination of):
c - auto crop, d - detect only (no output to file)
-s info: Info dump (any combination of):
s - skew detection stats, p - program parameters, t - timings
-c specs: Output compression specs for some file formats. Several specs
can be defined - delimited by commas. Supported specs:
jXX - JPEG compression quality, XX is in range [1,100(best)]
tSCHEME - TIFF compression scheme: none|lzw|rle|deflate|jpeg|g4
Supported file formats
Input: BMP, JPG, PNG, JNG, GIF, DDS, TGA, PBM, PGM, PPM, PAM, PFM, TIF, PSD
Output: BMP, JPG, PNG, JNG, GIF, DDS, TGA, PGM, PPM, PAM, PFM, TIF, PSD要在Linux和MacOS中的TIFF支持,您需要安装LIBTIFF 4.X(通常称为Libtiff5)。
对于MacOS,您可以在此处下载预先构建的libtiff二进制文件:https://galfar.github.io/store/tifflibbins-macos.zip。只需将文件输入与deskew-mac可执行文件中的同一文件夹中。
目前禁用了链接到LIBTIFF的ARM目标(已知会坠毁)。如果您想尝试自己,请在ImagingTiff.pas单元中启用它。
您可以在bin中运行测试( RunTests.bat and runtests.sh )中的sistimages文件夹和脚本中找到一些测试图像。默认情况下,只需调用deskew命令,但是您可以将另一个作为参数(例如runtests.sh deskew-arm )传递。
在这里提交它们:
https://github.com/galfar/deskew/issues
V1.30 2019-06-07:
V1.25 2018-05-19:
V1.21 2017-11-01:
V1.20 2016-09-01:
V1.10 2014-03-04:
V1.00 2012-06-04:
V0.95 2010-12-28:
V0.90 2010-02-12:
Diskew用对象帕斯卡(Pascal)写成。您需要免费的Pascal或Delphi来重新编译。
这些IDE有项目文件:
此外, Scripts夹中的独立FPC编译器还有编译外壳/批处理脚本。
可以在这些平台上进行编译并进行测试:Win32,Win64,Linux X86_64,MacOS X86_64,Linux Arm Aarch64 + V7。
最新的源代码可以在此处找到:
https://github.com/galfar/deskew
汇编需要吸血成像库,并且它包含在Deskew's Imaging文件夹中。