Artificial Intelligence 6 min read

Bank Card Scanning and Recognition: Extending Support for Chinese Debit Cards

This article describes a project that enhances an open‑source card‑number scanning solution to recognize 19‑digit Chinese debit cards, addressing challenges such as black‑printed fonts, light‑colored embossed fonts, background filtering, single‑character OCR, and Luhn‑based checksum verification.

Ctrip Technology
Ctrip Technology
Ctrip Technology
Bank Card Scanning and Recognition: Extending Support for Chinese Debit Cards

Background: Image recognition is a key AI field, evolving from character recognition to object detection. With the rise of mobile payments, manually entering card numbers is slow and error‑prone, prompting companies like PayPal, Apple, Alibaba, and Tencent to develop card‑number recognition.

General Credit Card Recognition Process:

Project Introduction: The project builds on an open‑source solution that supports 15‑ and 16‑digit credit cards, adding support for Chinese 19‑digit debit cards (both embossed and flat cards) to achieve recognition rates comparable to Alipay.

Project Outcomes: The enhanced system now handles 19‑digit cards and resolves previous failures on certain 15‑ and 16‑digit cards.

Main Problems Solved:

1. Vertical coordinate detection for black‑printed cards: Existing methods could not locate the card number rows on black‑printed fonts. By applying the Kitty algorithm for adaptive thresholding and scoring each image row, high‑score continuous rows are identified as the number region.

2. Vertical coordinate detection for light‑colored embossed fonts: Light fonts also defeat the original approach. Using the Prewitt operator with custom constraints improves foreground detection for these cards.

3. Background filtering for black‑printed fonts: Traditional binarization fails on complex backgrounds. A hybrid method combining Laplace operators with adaptive thresholding better separates foreground text from background.

4. Single‑character recognition for printed fonts: Card.IO lacks printed‑font character recognition, so a lightweight OCR combining horizontal/vertical projection features with template matching is employed.

5. Card number verification: Because 18‑digit numbers do not meet Chinese standards, the system validates 19‑digit numbers using a Luhn‑like algorithm (double even positions, sum digits >9, total sum ×9, take unit digit as check digit).

The project demonstrates how combining classic image‑processing operators with tailored algorithms can extend existing OCR solutions to handle the specific challenges of Chinese bank cards.

algorithmcomputer visionimage processingOCRBank Card Recognitionmobile payment
Ctrip Technology
Written by

Ctrip Technology

Official Ctrip Technology account, sharing and discussing growth.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.