This project is an image processing–based Bingo card detection and validation system, developed as part of an academic assignment. The system analyzes an input image of a Bingo card, detects stamped cells, corrects rotation if necessary, digitizes the card into a logical grid, and determines whether a valid Bingo pattern exists.
The project demonstrates practical use of MATLAB image processing techniques, including frequency-domain analysis, geometric correction, shape detection, and logical validation. The solution is designed in a modular and readable way, making the processing pipeline transparent and easy to understand.
Scanned or photographed Bingo cards often suffer from:
- Rotation or skew
- Uneven lighting
- Background noise
- Imperfect stamp placement
The objective of this assignment is to build a custom optical recognition system that can:
- Automatically straighten a rotated Bingo card
- Detect circular stamps placed by the player
- Map visual detections to a 5×5 digital grid
- Check for a Bingo (row, column, or diagonal)
- Display intermediate processing steps visually
The output includes both terminal output (digitized array + Bingo status) and graphical visualization.
The assignment requires the processing function to present a figure composed of multiple subplots, each illustrating a key step of the pipeline.
-
Original Image
Raw input image of the Bingo card. -
Fourier Magnitude of Edge Image
Shows frequency-domain representation used to estimate the card’s rotation angle. -
Straightened and Cropped Image
The image after rotation correction and cropping to the Bingo grid. -
Hough Space – Line Detection
Visualization of detected grid lines used to infer the Bingo grid structure. -
Hough Space – Circle Detection
Visualization of detected circular stamps. -
Final Overlay Visualization
Grayscale image with detected circles marked. If a Bingo exists, the winning row/column/diagonal is drawn with a green line.
The system processes each image using the following steps:
-
Preprocessing & Masking
Filters out unnecessary image regions and enhances relevant features. -
Rotation Estimation (FFT-based)
Uses Fourier transform magnitude to detect dominant orientation. -
Rotation Correction & Cropping
Aligns the Bingo card to a canonical orientation. -
Grid Line Detection
Applies a Hough-like transformation to detect grid lines. -
Circle Detection
Detects circular Bingo stamps using geometric and Hough-based methods. -
Digitization
Maps detected circles to a 5×5 logical matrix. -
Bingo Validation
Checks rows, columns, and diagonals for a valid Bingo pattern.
The main script of the project is:
main.m
- Open MATLAB
- Set the project root directory as the current folder
- Run:
mainThe script automatically loops through all images in the input folder and processes them sequentially.
├── main.m % Main controller script
├── scanner.m % Core processing function
├── findRotationAngle.m % Rotation estimation using FFT
├── findCircle.m % Circular stamp detection
├── findBingoLine.m % Identifies winning Bingo line
├── checkBingo.m % Validates Bingo rules
├── README.md % Project documentation
└── input/ % Folder containing Bingo card images
- Iterates through the input image folder
- Calls the processing pipeline
- Displays results and prints output
- Core required function
- Input: image matrix
- Output: 5×5 digitized matrix + Bingo boolean
- Produces visualization subplots
- Estimates image rotation using frequency-domain analysis
- Detects circular Bingo stamps
- Determines which row/column/diagonal forms a Bingo
- Applies logical Bingo rules and returns final decision
For each processed image, the system:
- Prints the digitized 5×5 matrix to the terminal
- Prints whether a Bingo exists
- Displays a multi-panel visualization of processing steps
This project received full marks (100/100) for successfully fulfilling all functional, visual, and structural requirements of the assignment, including correct digitization, rotation handling, Bingo detection, and clear visual presentation.
Author: Shihab Muhtasim
Course: Basic Image Processing Algorithms, IPCVAI, PPCU, Budapest, Hungary
Language: MATLAB