I am working on an application where I need a function, for example Cam Scanner, where a document should be detected in the image. For this, I use the Canny Edge definition, followed by the Hough Transform.
The results look promising, but the text in the document creates problems, as explained using the images below:
Original image 
After detecting canny edge 
After conversion hough 
My problem is the third image, the text in the original magician at the base made the hough transform detect a horizontal line (second cluster from the bottom).
I know that I can take the largest quadrangle, and in most cases this will work fine, but still I want to know any other ways in which in this processing I can ignore the effect of the text around the edges.
Any help would be appreciated.
source share