how to detect the outer frame of an object

asked 2016-10-12 02:14:36 -0500

AMEMB gravatar image

I am using OpenCV4Android version 3.1.0 and I want the Android camera to be able to detect a card e.g: credit-card, customer's card or etc. To implement such functionalitey using OpenCV i tried to do it using Edge-Detection function, but as you see in the picture below, Edge-Detection detects all the edges in the frame, while what I am looking for is to detect the only the outer frame of the card.

I tried also Object-Detection "contour-detection" function, and as you see in the picture below, it did not detect the outer frame of the card.

please let me know what is the optimal solution or function i should use to be able to detect only the outer frame of any given card

Edge-Detection: enter image description here

Shape"contour" Detection: enter image description here

edit retag flag offensive close merge delete