Perspective Transformation using Line Detector and Optimization
Overview
This is the Python implementation of paper
An, J., Koo, H.I. & Cho, N.I.
Rectification of planar targets using line segments
Machine Vision and Applications 28, 91–100 (2017).
https://doi.org/10.1007/s00138-016-0807-1
for perspective transformation. By using line detector, this approach creates a loss function which contains information of tilt angle of vertical and horizontal lines, and an optimization algorithm tries to minimize loss value, simultaneously update rotate angles in perspective matrix. In this implementation, I used Gradient Descent instead of Levenberg–Marquardt algorithm
Installation
Install line detector package for python 3
pip install pylsd
pip install ocrd-fork-pylsd