Document Image Skew Estimation
Table of Contents
Table of contents generated with markdown-toc
Installation
pip
pip install jdeskew
conda
conda create --name jdeskew -c conda-forge jdeskew
How-to-use
using python
from jdeskew.estimator import get_angle
angle = get_angle(image)
from jdeskew.utility import rotate
output_image = rotate(image, angle)
Docker
https://hub.docker.com/r/phamquiluan/jdeskew/tags
# build
DOCKER_BUILDKIT=1 docker build -t jdeskew .
# run
docker run -p 8000:80 jdeskew
# test
curl -v -F file=@sample.png localhost:8000/predict
using cog
https://github.com/replicate/cog
cog build --debug
cog predict -i input=@skew.png
# Output:
# Running prediction...
# {
# "angle": -0.12520868113522532
# }
Download Paper
Link1: https://ieeexplore.ieee.org/document/9897910
Link3: https://huggingface.co/papers/2603.05942
Performance Comparison on DISE 2021
CE: Correct Estimation rate
WE: Worst Error
| AED | TOP80 | CE | WE | |
|---|---|---|---|---|
| FredsDeskew | 10.82 | 0.09 | 0.54 | 109 |
| PypiDeskew | 16.59 | 0.24 | 0.2 | 141 |
| Koo, Hyung Il et al. | 0.22 | 0.09 | 0.48 | 9.43 |
| CMC-MSU | 0.27 | 0.11 | 0.43 | 23.2 |
| LRDE-EPITA-a | 0.14 | 0.06 | 0.66 | 10.61 |
| Our (1024) | 0.11 | 0.07 | 0.67 | 1.13 |
| Our (1500) | 0.09 | 0.05 | 0.78 | 1.13 |
| Our (2048) | 0.08 | 0.04 | 0.84 | 1.13 |
| Our (3072) | 0.07 | 0.04 | 0.86 | 1.13 |
| Our (4096) | 0.08 | 0.04 | 0.83 | 1.18 |
DISE 2021 Dataset
This datasets are built upon three other datasets: DISEC 2013, RVL-CDIP, RDCL 2017. So I urge you to respect their LICENSE.
| Dataset Name | URL |
|---|---|
| DISE 2021 (45 degree) | https://drive.google.com/file/d/1a-a6aOqdsghjeHGLnCLsDs7NoJIus-Pw/view?usp=sharing |
| DISE 2021 (15 degree) | https://drive.google.com/file/d/1BLiuu-j28dbuPFi4n3C0KuV6vXGmB0qS/view?usp=sharing |
Can also download from Hugging Face: https://huggingface.co/datasets/phamquiluan/DISE-2021
Or from Zenodo: https://zenodo.org/records/12570649
Reproducibility and Evaluation Code
Check the reproduce.ipynb file
Citation
L. Pham, H. Hoang, X.T. Mai, T. A. Tran, "Adaptive Radial Projection on Fourier Magnitude Spectrum for Document Image Skew Estimation", ICIP, 2022.
@inproceedings{pham2021dise,
title={Adaptive Radial Projection on Fourier Magnitude Spectrum for Document Image Skew Estimation},
author={Luan Pham, Hao Hoang, Toan Mai, and Tuan Anh Tran},
booktitle={2022 29th International Conference on Image Processing (ICIP)},
year={2022},
organization={IEEE}
}
Metadata
Release files for jdeskew 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jdeskew-0.4.2.tar.gz | 845.7 kB | Without provenance | Details for jdeskew-0.4.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jdeskew-0.4.2-py3-none-any.whl | Python 3 | none | any | Details for jdeskew-0.4.2-py3-none-any.whl |
Total release size: 853.3 kB
Release files / jdeskew-0.4.2.tar.gz
| Download URL | jdeskew-0.4.2.tar.gz |
|---|---|
| Size | 845.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27b18400172b6b81d700304aa67b67256f2433b7714dd0d48173ed39d9a585cd
|
|
BLAKE2b-256 checksum How to use checksums |
0363f8048f65d813eb3775543d88af37ce4fa861b2cda14febac5abfa49726cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Release files / jdeskew-0.4.2-py3-none-any.whl
| Download URL | jdeskew-0.4.2-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6d6edf574084ae00244b1fd0d3026124d73a65307300b8e3f2333e677a8b4843
|
|
BLAKE2b-256 checksum How to use checksums |
bbd40b01d016605e484f394140a84b888c5dec2528d32312b11b1dbb136dcb5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.25
|
Security for jdeskew 0.4.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.