4
$\begingroup$

I have to approach this task: identify credit card from an image. I am attaching example image below:

enter image description here

I have to identify and localize the credit card from this image. The real challenge is that the card can be placed on any background and the color of the card can change based on the company it belongs to.

In order to solve this task I tried using the tensor flow object detection api. The downside of this api is that it fails to recognize cards which are not in its training data set.

My problem here is I am not concerned with the color of card or what information the card has. I am only concerned about finding the outline of card in an image and isolating the outline of card from rest of the image.

Is there a way using ML/CNN to do this. I tried OpenCV approaches to detect contours but even this approach fails when there is lot of text or other noise in the cards background.

$\endgroup$

1 Answer 1

5
$\begingroup$

I am only concerned about finding the outline of card in an image and isolating the outline of card from rest of the image.

This can be efficiently solved by semantic segmentation (aka dense prediction) - problem in which every pixel must be labeled with class.

In your case, you will have 2 classes: credit card and background. And you will need to have annotated dataset in such way: for every image, every pixel should have a class label. If you will be annotating it manually, I guess that credit cards (because of their simple shape) can be annotated easily.

Here is a good solution in Keras for semantic segmentation models. It offers a lot of different architectures and backbones and it will be straightforward to apply it to your problem.

There are also implementations in other frameworks on the web.

$\endgroup$
2
  • $\begingroup$ Thank you I tried semantic segmentation and it worked $\endgroup$
    – Ajinkya
    Commented Mar 13, 2019 at 9:25
  • $\begingroup$ Your answer saved my day! $\endgroup$ Commented Jan 16, 2020 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.