Skip to main content

Document Image Skew Estimation using Adaptive Radial Projection

Project description

Document Image Skew Estimation

pypi package CircleCI Codacy Badge Codacy Badge Downloads example workflow example workflow example workflow example workflow PWC

Cover Image

Table of Contents

Table of contents generated with markdown-toc

Installation

pip

pip install 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

Link2: https://www.researchgate.net/publication/364320913_ADAPTIVE_RADIAL_PROJECTION_ON_FOURIER_MAGNITUDE_SPECTRUM_FOR_DOCUMENT_IMAGE_SKEW_ESTIMATION

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 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}
}

Star History

Star History Chart

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jdeskew-0.3.0.tar.gz (844.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jdeskew-0.3.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file jdeskew-0.3.0.tar.gz.

File metadata

  • Download URL: jdeskew-0.3.0.tar.gz
  • Upload date:
  • Size: 844.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for jdeskew-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3e190675faeb9241692122a7e7c78abd86d8a58428211f0016644773e971bd95
MD5 3a126d42961091ccd4e1f618499cd2cb
BLAKE2b-256 e4837670866ddc95b6b4e7f9891a88deb9aabc82336b51bb09f2aba09a1c314b

See more details on using hashes here.

File details

Details for the file jdeskew-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: jdeskew-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for jdeskew-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 724e85b76703488c1e9e2d6d9c2912a821b13b51c500ec9f7f0c5f2080479094
MD5 a43401e0c74038280f26ee79e7dd4467
BLAKE2b-256 49cc46b193a16d3e5ee9829e4abfb18221cba68bcf1fd189f83c619ebf06b7cc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page