card.io-dmz icon indicating copy to clipboard operation
card.io-dmz copied to clipboard

How to understand the number_grad_sum_pattern in scan/n_hseg.cpp?

Open draculaw opened this issue 7 years ago • 2 comments

I am reading the code. I found some magic number in number_grad_sum_pattern. I am wondering how to set this number. Is there any reference or tips for tuning this data?

draculaw avatar Dec 21 '17 01:12 draculaw

Sadly, most of the magic numbers are generated from large numbers of credit card photos, which have not been made public (for obvious reasons). The scripts could probably have been made public, but were not. If I recall correctly--and I might not, it has been a very long time now, number_grad_sum_pattern was generated by just averaging the observed values for correctly aligned digits across many, many, many digits. It was also, IIRC, very stable; I doubt that there's much value in tweaking these numbers. Hope that helps.

josharian avatar Dec 22 '17 00:12 josharian

Thanks a lot for your reply.

Actually, I am from China. Some of UP China's cards are 18 digits or 19 digits. Even more, some debit cards' digits are flat print instead of bulged. In that case, those numbers are not worked.

draculaw avatar Dec 22 '17 02:12 draculaw