1 | initial version |
I would suggest you follow this tutorial to make a scanner in Python with ease
http://www.pyimagesearch.com/2014/09/01/build-kick-ass-mobile-document-scanner-just-5-minutes/
As for the background problem, I too am stuck in the same problem. But I would suggest you to perform median blur followed by adaptive threshold as preprocessing before using canny on the image. It isolates the page from background quite effectively. Just play around with the threshold values. I used 21 for median blur and 41,7 with adaptive threshold
PS If you do get results, please upload your pre-canny resultant image and post-canny image so that I can debug my problem too ;)