マレク・モーダーによって
https://galfar.vevb.net/deskew
https://github.com/galfar/deskew
v1.30 2019-06-07
Deskewは、スキャンされたテキストドキュメントをデッキーするためのコマンドラインツールです。 Hough Transformを使用して、画像の「テキストライン」を検出します。出力として、線が水平になるように画像が回転します。
これらのプラットフォーム用に構築された事前にコンパイルされたバイナリ(ビンフォルダーにあります)があります。Win64( deskew.exe )、win32( deskew32.exe )、linux x86_64( deskew )、macos x86_64(deskew- deskew-mac )、linux arm aarch64( deskew-arm64 )and 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, PSDLinuxおよびMacOSでのTIFFサポートの場合、Libtiff 4.xをインストールする必要があります(通常、パッケージはLibtiff5と呼ばれます)。
macOSの場合、事前に作成されたLibtiffバイナリをダウンロードしてください:https://galfar.github.io/store/tifflibbins-macos.zip。アーカイブ内のファイルをdeskew-mac実行可能ファイルと同じフォルダーに配置するだけです。
libtiffにリンクする腕のターゲットは、現時点では無効になっています(Deskewでクラッシュすることが知られています)。自分で試してみたい場合は、 ImagingTiff.pasユニットで有効にします。
Testimagesフォルダーとスクリプトでいくつかのテスト画像を見つけることができます。テスト( RunTests.batおよびruntests.sh )をBinで実行できます。デフォルトでは、スクリプトは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:
Deskewはオブジェクトパスカルで書かれています。それを再コンパイルするには、無料のPascalまたはDelphiが必要です。
これらのIDEのプロジェクトファイルがあります:
さらに、 ScriptsフォルダーにスタンドアロンFPCコンパイラ用のコンパイルシェル/バッチスクリプトがあります。
Deskewはコンパイルでき、これらのプラットフォームでテストされました:Win32、Win64、Linux X86_64、MacOS X86_64、Linux ARM AARCH64 + V7。
最新のソースコードはこちらにあります:
https://github.com/galfar/deskew
コンピレーションにはvampyreイメージングライブラリが必要であり、イメージングフォルダーのDeskewのリポジトリに含まれています。