I will start by explaining the problem in a real world application; I have a camera that is pointed at a dark surface. A paper feeder (just simple machine that spits out pages when it's told to by the controlling computer) feeds paper into the area the camera is looking.
Using openCV I am to process the image, and determine if the feeder fed correctly.
This means that I have to be able to determine not just if a page is present, but if multiple pages are present. Sometimes multiple pages are fed because they stuck together, in which case the pages are so close to perfectly aligned with eachother they visually appear to be one page unless you look very closely.
The problem I am having is that Canny Edge Detection, combined with the Hough Transform, does not give me the accuracy I need. Typical examples of using Canny to find a paper in an image return results where each page edge is many lines (5-15). Using find contours determines this is a rectangle.
These typical examples do not help as I need to be able to detect that there is another line very close to the edge of the page.
I've been playing with the threshold values of the hough transform as well as how much blur I apply before Canny and have gotten it fairly reliable, but the problem is I believe the sensitivity is now too low and any pages that feed in the above example (on top of eachother) will not be detected by this system.
The above image has two visible pages, one that has just come out of the feeder. There is text on the page. I need to be able to identify the page's angle, and that there is in fact only one page.
The problem I'm having is that I need the line detection sensitive enough to be able to tell if there is two pages stuck together, but I also need to not have the lines from the text on the page detected.