Skip to content

philippe-heitzmann/CreditCard_Optical_Character_Recognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Credit Card Optical Character Recognition

A Python-based OCR system that uses OpenCV and Pytesseract to detect and extract credit card numbers and cardholder information from credit card images.

Overview

This repository contains a complete implementation of an optical character recognition (OCR) pipeline specifically designed for credit card text extraction. The system processes credit card images to identify and extract:

  • Credit card numbers
  • Cardholder names
  • Other relevant text information

Features

  • OpenCV-based image preprocessing
  • Pytesseract OCR integration
  • Jupyter notebook with step-by-step implementation
  • Comprehensive image dataset for testing
  • Custom utility functions for image processing

Sample Output

feature_image1 cccorrect2 cccorrect3

Getting Started

Prerequisites

  • Python 3.6+
  • OpenCV
  • Pytesseract
  • Jupyter Notebook
  • Required Python packages (see notebook for full list)

Installation

  1. Clone the repository:
git clone <repository-url>
cd CreditCard_Optical_Character_Recognition
  1. Install required dependencies:
pip install opencv-python pytesseract jupyter numpy pandas matplotlib seaborn scikit-learn torch torchvision

Usage

  1. Jupyter Notebook: Open notebooks/Credit_Card_Reader_Implementation.ipynb and follow the step-by-step instructions
  2. Image Dataset: Explore the sample images in the /images folder
  3. Custom Implementation: Use the utility functions in scripts/utils2.py for your own implementations

Docker Usage

To run this project using Docker:

  1. Build the Docker image:
docker build -t credit-card-ocr .
  1. Run the container:
docker run -it --rm -p 8888:8888 -v $(pwd):/workspace credit-card-ocr
  1. Access Jupyter Notebook:
    • Open your browser and navigate to http://localhost:8888
    • Use the token provided in the terminal output

Project Structure

CreditCard_Optical_Character_Recognition/
├── images/                    # Sample credit card images
├── notebooks/                 # Jupyter notebook implementation
├── scripts/                   # Utility functions
├── README.md                  # This file
├── objectives.md             # Project objectives and goals
└── .gitignore               # Git ignore file

Additional Resources

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

This project is open source and available under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages