https://github.com/moh-27sl/image-alignment--python-edition
Alignment of an unaligned image with a base/reference image using feature detection, feature matching, and homography in OpenCV.
https://github.com/moh-27sl/image-alignment--python-edition
ai classical-computer-vision classical-image-processing computer-vision computervision image-alignment image-processing imageprocessing neural-network numpy opencv python python3
Last synced: 4 months ago
JSON representation
Alignment of an unaligned image with a base/reference image using feature detection, feature matching, and homography in OpenCV.
- Host: GitHub
- URL: https://github.com/moh-27sl/image-alignment--python-edition
- Owner: Moh-27SL
- Created: 2025-08-13T13:57:08.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-08-13T14:03:46.000Z (4 months ago)
- Last Synced: 2025-08-24T02:23:02.119Z (4 months ago)
- Topics: ai, classical-computer-vision, classical-image-processing, computer-vision, computervision, image-alignment, image-processing, imageprocessing, neural-network, numpy, opencv, python, python3
- Language: Python
- Homepage:
- Size: 1.01 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Image-alignment--PYTHON-EDITION
Alignment of an unaligned image with a base/reference image using feature detection, feature matching, and homography in OpenCV.
## Features
- Detects keypoints and descriptors using **ORB** (can be swapped with AKAZE or SIFT for higher accuracy).
- Matches features with **Brute Force Hamming** matcher.
- Filters matches to keep only the best ones.
- Computes a **homography matrix** to warp the unaligned image into alignment with the base image.
- Optionally saves the aligned result to a file.
- Displays side-by-side comparison of the unaligned, base, and aligned images.
---
## Example Output

---
## How It Works
1. **Read the images** — Load both base and unaligned images.
2. **Resize** — Ensure both images have the same dimensions.
3. **Feature Detection** — Use ORB to detect keypoints and compute descriptors.
4. **Feature Matching** — Match descriptors between the two images.
5. **Filter Matches** — Keep the top matches (default: best 10%).
6. **Compute Homography** — Estimate the perspective transformation between matched points.
7. **Warp Image** — Apply the transformation to align the unaligned image with the base.
---
*Developed by Mohammed Yasser Mohammed*
*call me ;)*
*email : es-mohamed.yasser2027@alexu.edu.eg*