由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文件夾中。