โดย Marek Mauder
https://galfar.vevb.net/deskew
https://github.com/galfar/deskew
v1.30 2019-06-07
Deskew เป็นเครื่องมือบรรทัดคำสั่งสำหรับเอกสารข้อความที่สแกน deskewing มันใช้ Hough Transform เพื่อตรวจจับ "บรรทัดข้อความ" ในภาพ ในฐานะที่เป็นเอาต์พุตคุณจะได้รับภาพหมุนเพื่อให้เส้นเป็นแนวนอน
มีไบนารีที่รวบรวมไว้ล่วงหน้าที่สร้างขึ้นสำหรับแพลตฟอร์มเหล่านี้ (ตั้งอยู่ในโฟลเดอร์ bin): win64 ( deskew.exe ), win32 ( deskew32.exe ), Linux x86_64 ( deskew ), macos x86_64 ( deskew-arm64 deskew-mac deskew-arm )
GUI Frontend สำหรับเครื่องมือ CLI นี้มีให้เช่นกัน (Windows, Linux และ MacOS) ดู ReadMe ของ GUI
ใบอนุญาต: 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สำหรับการสนับสนุน TIFF ใน Linux และ MacOS คุณต้องติดตั้ง Libtiff 4.x (แพ็คเกจมักเรียกว่า libtiff5)
สำหรับ MacOS คุณสามารถดาวน์โหลดไบนารี libtiff prebuilt ได้ที่นี่: https://galfar.github.io/store/tifflibbins-macos.zip เพียงแค่ใส่ไฟล์ไว้ในที่เก็บถาวรไปยังโฟลเดอร์เดียวกันกับ deskew-mac
เป้าหมายแขนที่เชื่อมโยงไปยัง Libtiff ถูกปิดการใช้งานในขณะนี้ (รู้จักกับการชนกับ Deskew) หากคุณต้องการลองใช้ตัวเองใน ImagingTiff.pas unit
คุณสามารถค้นหาภาพทดสอบในโฟลเดอร์ทดสอบและสคริปต์เพื่อเรียกใช้การทดสอบ ( 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 คุณต้องใช้ Pascal หรือ Delphi ฟรีเพื่อคอมไพล์อีกครั้ง
มีไฟล์โครงการสำหรับ IDEs เหล่านี้:
นอกจากนี้ยังมีสคริปต์คอมไพล์เชลล์/แบทช์สำหรับคอมไพเลอร์ FPC แบบสแตนด์อโลนในโฟลเดอร์ Scripts
Deskew สามารถรวบรวมและทดสอบบนแพลตฟอร์มเหล่านี้: Win32, Win64, Linux X86_64, MacOS X86_64, Linux Arm Aarch64 + V7
ซอร์สโค้ดล่าสุดสามารถพบได้ที่นี่:
https://github.com/galfar/deskew
ห้องสมุดการถ่ายภาพ Vampyre เป็นสิ่งจำเป็นสำหรับการรวบรวมและรวมอยู่ในโฟลเดอร์ repo ของ Deskew ในโฟลเดอร์การถ่ายภาพ