Edge detection in a card