Computer Vision project for image processing and 3D reconstruction.
- SIFT Feature Matching: Detect and match keypoints between two RGB images
- Camera Pose Estimation: Estimate rotation (R) and translation (t) using Essential Matrix with RANSAC
- 3D Point Cloud: Triangulate matched points to create 3D reconstruction in camera-1 frame
- Homography Computation: Calculate homographies for image sequences relative to a reference image
- Visualization: Display 3D point clouds and warped image overlays
- Python 3.11
- NumPy
- Matplotlib
- OpenCV (cv2)
- Pillow
Create and activate the conda environment:
conda create -n piv-project python=3.11 numpy matplotlib pillow opencv -y
conda activate piv-projectpython Home2.pyThe script expects two input images:
320.jpg(reference image)330.jpg(target image)
- Console output with match statistics, R/t estimates, and inlier counts
- Interactive matplotlib plots showing:
- Original reference image
- 3D point cloud
- Homography visualizations
- Saved files:
homography_visualization.pnghomographies.npy
Project1/
├── Home2.py # Main script
├── 320.jpg # Reference image
├── 330.jpg # Target image
├── .gitignore
└── README.md
- Load two RGB images
- Extract SIFT keypoints and match using ratio test
- Estimate Essential Matrix with RANSAC
- Recover camera pose (R, t) using recoverPose
- Triangulate 3D points with cheirality check
- Compute homographies for image alignment
- Warp and blend images for visualization
PIV Course - Universidade de Lisboa