Recognizing playing cards

I’ve encountered a hopefully resolvable problem related to recognizing playing cards recently. The approach which I’m taking is as follows:

  1. Find all the interesting contours.
  2. Find a vector which will be represented as two points (where it begins and where it ends) like so:
    find two points at the bottom and at the top of the symbol creating a vector of some kind. The difficulty occurs when a card is rotated as the programme also have to be able to deal which such situations.

I’d appreciate any idea as I’ve been trying to solve this issue for the last couple of days.
Tank you