lllllll-llll-llllll / paper-crop-via-hough-lines

quick test for grabbing the content of papers from photos

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

quick solution for extracting paper content in photographs using imagemagick with autoit

median the image
brightness contrast
canny edge detect
make hough lines
sort the lines found by vertical/horizontal orientation
further sort by closeness to the left/right or up/down edges
further sort by how close it is to the edge and how long the line is
those are our 4 lines
to get the intersection of the lines
draw the lines and do a median/blur/brightness/contrast to create distinct blobs
connected-components can tell us the centroid positions for these blobs, which we take as the points of intersection
use those points to do a perspective distort which 'crops' to the paper

for reference later

example pictures

About

quick test for grabbing the content of papers from photos

License:MIT License


Languages

Language:AutoIt 100.0%