How I get only the 'external' lines using HoughLinesP? [closed]

asked 2015-02-10 11:16:27 -0600

I am trying to scan some bank checks.

I used this tutorial: http://opencv-code.com/tutorials/auto...

Bank checks despite being quadrilateral, also have lots of lines inside (for example the guide lines of where you need to write).

The current end result after I stop in the HoughLinesP step is some broken-ish lines around the checks (I think they are broken because the check is not entirely flat, after some abuse inside wallets, hands, storage, etc...) and LOTS of lines following guide lines, dense areas of text (those become just a big block), and so on.

So, how I detect only the lines around the check, so I can apply perspective correction to it?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-10-15 13:13:01.832299

Comments

Please provide some image results of where it goes wrong, but how about following this approach:

  • Calculating your edges
  • Grouping them together by putting all lines into a single pixel array
  • Then applying a findContours operation on top of that binary image
  • Only retrieve the outer contour
StevenPuttemans gravatar imageStevenPuttemans ( 2015-02-11 04:22:04 -0600 )edit