Awesome
awesome-text-deskew
A curated list of awesome projects for image text skew detection/correction.
Let’s categorize according to solutions:
OpenCV rectangle
Get angle from minimum bounding rectangle of text contours.
- Detect the contours in the image, which includes text
- Obtain the minimum bounding rectangle based on the contours
- Retrieve the angle of the bounding rectangle
- Skew Correction for Text Python - code @github
- Text skew correction with OpenCV and Python - article @pyimagesearch
- Text Documents Skewness Correction using OpenCV article @medium
Hough Transform
Get angle from line by the hough transform.
- Calculate Hough lines in the image
- Find the angle of the majority of lines
- How-to deskew an nimage - article @codeproject
- Text Document Alignment using Probabilistic Houghline Transform - article @medium
- Skew Detection and Correction of Document images using Hough Transform - article @muthu
- also jupyer notebook on github
- Correcting Image Rotation with Hough Transform - article @medium
- also jupyer notebook on github
- deskew with Hough Transform - gist @github
- Alyn - code @github
- deskew - code @github
EAST model
Get angle from text regions detected by the EAST model.
- Detect the position of text regions,
- Retrieve the angle of the region bounding box,
- Calculate the average tilt angle.
- Building a Scalable Image Orientation Correction System article @medium
- also in project Anuvaad
Pixel projection
Get angle with the minimum pixel density projection
same like Radon transform
- Rotate the image at multiple angles
- Calculate the cumulative sum of pixel values along each row
- Find the angle with the highest cumulative sum
- Detect text orientation - question @stackoverflow
- Deskew document images - code @github
- Python OpenCV skew correction for OCR - question @stackoverflow
- Projection to correct image skew and identify text lines - code @github
Radon transform
Get angle with alternating pixel density projection
- Rotate the image at multiple angles
- Calculate the cumulative sum of pixel values along each row
- Find the angle with the highest cumulative sum or alternating cumulative sums
Detecting rotation and line spacing of image of page of text using Radon transform - gist @github
"River" detection in text - question @stackoverflow
Fourier projection
just like Pixel projection but use DFT not image
- DFT magnitude of image
- Collect the pixels that the center point to the edge point at each angle from magnitude
- Calculate the cumulative sum of pixel values along each angle
- Find the angle with the highest cumulative sum
- Document Skewness Detection and Correction - article @medium
- also python code on github
- Document Image Skew Estimation - paper @github