Authors: Simone Bonfrate, Christian Vitucci
Institution: Faculty of Computer Science (FIC), University of Coruna (UDC)
This project implements a computer vision system for retinal image matching based on the unique structure of retinal vessel trees. It addresses challenges in biometric identification such as variations in orientation, lighting, and noise. The system extracts the vessel tree from retinal images and performs feature-based matching to identify individuals.
.
├── LICENSE
├── README.md
├── main.py # Main entry point of the application
├── docs/
│ ├── report.md # Detailed project report
│ └── images/ # Images for documentation
├── images/
│ ├── ref_images/ # Reference retinal images
│ └── test_images/ # Test retinal images
└── libs/
├── __init__.py
├── part_1.py # Preprocessing and Optic Disc Detection
├── part_2.py # Vessel Tree Extraction
├── part_3.py # Feature Matching (AKAZE)
The pipeline consists of three main stages:
-
Preprocessing & Optic Disc Detection (
libs/part_1.py)- Preprocessing: Images are enhanced using Contrast Limited Adaptive Histogram Equalization (CLAHE) to improve local contrast and Gaussian Blur to reduce noise.
- Detection: The optic disc is located using Template Matching (
cv2.matchTemplate). Different matching methods (CCORR, SQDIFF, CCOEFF) are used depending on the image characteristics.
-
Vessel Tree Extraction (
libs/part_2.py)- The region of interest (ROI) around the optic disc is isolated.
- Inverse thresholding is applied to separate the darker vessel structures.
- Morphological erosion removes noise and artifacts, resulting in a clean vessel tree mask.
-
Vessel Tree Matching (
libs/part_3.py)- Feature Extraction: The Accelerated KAZE (AKAZE) algorithm detects keypoints and generates binary descriptors.
- Matching: Descriptors are matched using Brute-Force matching with Hamming distance.
- Verification: RANSAC-based homography filters "good matches" (inliers).
- Scoring: A similarity score (0 to 1) is calculated based on the ratio of inliers to total matches.
-
Clone the repository:
git clone <repository-url> cd vessel_tree_identification
-
Install the required dependencies:
pip install opencv-python numpy matplotlib
To run the identification pipeline and generate the similarity matrix:
python main.pyThe script will:
- Load test and reference images from the
images/directory. - Process each image to extract the vessel tree.
- Compare every test image against every reference image.
- Output a 6x6 similarity matrix to the console, where each cell represents the similarity score between a test image and a reference image.
The system achieves high accuracy in identifying matching vessel trees. In experimental validation, matching pairs typically yield a high similarity score (> 0.85), while non-matching pairs result in a score of 0.
Example Output Matrix:
[[0.96 0. 0. 0. 0. 0. ]
[0. 0.90 0. 0. 0. 0. ]
[0. 0. 1. 0. 0. 0. ]
[0. 0. 0. 1. 0. 0. ]
[0. 0. 0. 0. 0.60 0. ]
[0. 0. 0. 0. 0. 0.91]]
- OpenCV Documentation: Histogram Equalization, AKAZE local feature matching, Smoothing Images.
- Towards Data Science: Vision Transformers.