yuta1984 / CannyJS

A client-side JavaScript implementation of Canny Edge Detection
MIT License
83 stars 16 forks source link

best fit rectangle #1

Open mvayngrib opened 8 years ago

mvayngrib commented 8 years ago

would be cool to use this for detecting a document scan in an image, and guess-placing a rectangle over the document

yuta1984 commented 8 years ago

Interesting. Such feature may be possible if you combine Canny edge detection with Hough transform. I'll give it a try when I have time.

mvayngrib commented 8 years ago

yea, i see many people suggesting Hough lines for this. OpenCV's findContours seems to use a different "border following" algorithm:

https://github.com/Itseez/opencv/blob/master/modules/imgproc/src/contours.cpp http://docs.opencv.org/2.4/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html#suzuki85