This project implements a Stereo Vision System to extract depth information from stereo image pairs. The system uses advanced computer vision techniques, including camera calibration, stereo rectification, and disparity map generation, to compute depth maps for various environments such as classrooms, trap rooms, and storage rooms. The implementation is done in Python using OpenCV and follows a structured methodology to ensure accuracy and robustness.
Stereo image pairs were collected for three different environments: Classroom, Trap Room, and Storage Room. Images were manually focused for higher resolution and accuracy.
Calibration was performed using a checkerboard pattern to compute the camera's intrinsic and extrinsic parameters.
- Harris Corner Detection was used to identify checkerboard corners.
- Intrinsic matrix (focal length and principal point) and extrinsic matrix (rotation and translation) were computed using OpenCV's cv2.calibrateCamera function.
- Reprojection error analysis was conducted to validate calibration accuracy.
Fundamental and Essential Matrices were computed using matched feature points between stereo image pairs.
- Feature detection with SIFT.
- Matching features using FLANN-based matcher.
- Computing the Fundamental Matrix with RANSAC to eliminate outliers.
- Deriving the Essential Matrix to decompose rotation and translation matrices.
Stereo rectification aligned the epipolar lines horizontally for better disparity computation.
Homography matrices were computed for both images using cv2.stereoRectifyUncalibrated.
Rectified images were generated by applying perspective transformations.
Disparity maps were created using OpenCV's cv2.StereoSGBM_create function. Parameters like block size, minimum disparity, and uniqueness ratio were tuned for optimal results.
Depth maps were visualized in grayscale and heatmap formats for better interpretation.
Epipolar lines aligned horizontally in rectified images for all environments (Classroom, Trap Room, Storage Room).

Generated disparity maps highlighted depth variations effectively

This project successfully demonstrates a robust implementation of a stereo vision system capable of estimating depth information across various environments with high accuracy. The results validate its applicability in real-world scenarios such as robotics navigation, SLAM, and object detection in cluttered spaces.