Credit Cards Counter

Hello, i need assistance for a project. I need make a Credit Cards Counter, i have a heap of Cards, one sides to other, without space between them. The only thing that i can use for do it is counting the lines entre each card. I need help for search the correct sensor. I tried with mouse camera but never could get it work. I thought on a carriage going from left to right counting the spaces, those spaces are gray lines between cards. Can anyone give me some approach to solve it?

Thanks

xchelox:
i have a heap of Cards, one sides to other, without space between them

Did you acquire them legally ?

Most people only have two or three - or at least only a number that is easily counted.

...R