It demonstrates the implementation of fundamental feature detection and matching algorithms — including Harris Corner Detection, Lambda-Min, and SIFT-based matching — from scratch using Python and PyQt5.
The application provides an intuitive Graphical User Interface (GUI) that enables users to visualize corner detection and feature matching between images, explore algorithm behavior under different parameters, and compare performance between matching methods such as SSD and NCC.
The GUI includes two main functional tabs:
-
Corner Detection
- Apply Harris or λ-min (Lambda-Min) corner detection methods.
- Adjust parameters:
- Window Size: Controls Gaussian smoothing kernel for gradient computation.
- Threshold: Determines sensitivity for detecting strong corners.
- Displays both input and processed images with detected corners.
Figure: Harris Corener Detection "red points"
Figure: Lamdda-min Detection (using same parameters to notice the difference between this method and Harris)
- SIFT and Feature Matching
- Perform scale-invariant feature extraction and matching between two images.
- Upload input and template images by double-clicking on the widgets.
- Choose matching technique:
- Sum of Squared Differences (SSD)
- Normalized Cross-Correlation (NCC)
- View processing time and progress bar during execution.
Figure: SIFT & Feature Matching
The system is modular and organized into 6 core classes for clarity and reusability:
| Class | Description |
|---|---|
| ImageViewer | Manages image uploading, display, and interaction in the GUI. Supports grayscale and color modes. |
| CornerDetector | Implements Harris and Lambda-Min corner detection with gradient computation, Gaussian smoothing, thresholding, and non-maximum suppression. |
| SIFT | Implements the full Scale-Invariant Feature Transform (SIFT) algorithm, including keypoint detection, orientation assignment, and descriptor generation (based on Lowe, 2004). |
| NCCMatcher | Performs template matching using Normalized Cross-Correlation (NCC) to locate a template within an image. |
| SSDMatcher | Performs template matching using Sum of Squared Differences (SSD), optimized for speed and simplicity. |
- Corner Detection: Harris and Lambda-Min implementations for analyzing edge features.
- Parameter Control: Real-time adjustment of window size and detection thresholds.
- SIFT Implementation: Full custom implementation of the SIFT pipeline:
- Scale-space extrema detection
- Keypoint localization
- Orientation assignment
- Descriptor generation
- Feature Matching: Supports SSD and NCC algorithms for template matching.
- Performance Feedback: Displays computation time and progress indicators.
- Language: Python
- Framework: PyQt5
- Libraries: NumPy, OpenCV, Matplotlib, PIL
Make sure you have Python 3.8+ installed.
Install the required dependencies:
pip install numpy opencv-python PyQt5 matplotlib pillow