This repository contains four Python scripts demonstrating key computer vision techniques using OpenCV:
- SIFTDemo.py: Detects and matches SIFT features between two images.
- BFMDemo.py: Detects and matches ORB features using a brute-force matcher.
- FM+Homography.py: Performs feature matching with SIFT and estimates a homography to align images.
- Stitcher.py: Uses OpenCV’s Stitcher API to stitch multiple images into a panorama.
- Python 3.6 or higher
- OpenCV
- NumPy
- Matplotlib
Install the dependencies via pip:
pip install opencv-python numpy matplotlibSIFT feature detection and matching using a K-Nearest Neighbors matcher and ratio test.
python SIFTDemo.pyORB feature detection and brute-force matching.
python BFMDemo.pyMatches SIFT features, applies ratio test, computes a homography with RANSAC, and shows only inlier matches.
python FM+Homography.pyStitches multiple images into a panorama using OpenCV’s high-level Stitcher API.
python Stitcher.py --images img1.jpg img2.jpg [img3.jpg ...] --output panorama.jpg- --images: List of input image file paths (space-separated).
- --output: Path to save the stitched panorama.
- Use -h or --help for full usage details.
- Ensure images have sufficient overlap for reliable feature matching and stitching.
- Adjust
MIN_MATCH_COUNTinFM+Homography.pybased on image content. Stitcher.pyprints an error code if stitching fails; refer to OpenCV docs for details. Feel free to tweak parameters for better results.