← Back to Projects
Stereo Vision & Disparity
A university stereo-vision project built with Python and OpenCV.
Gallery
Overview
A solo computer-vision project walking the entire stereo pipeline in Python and OpenCV: from single and stereo camera calibration through rectification and disparity estimation, out to depth maps, 3D point clouds and optical flow on video.
Technical Highlights
- Camera calibration and undistortion.
calibrateCameraon chessboard images recovers the intrinsic matrix and a five-coefficient distortion model, thenundistortandremapcorrect the images. Seemain.py. - Stereo calibration. Paired left and right captures give the extrinsics (rotation, translation, essential and fundamental matrices) at a mean reprojection error of 2.39 px. See
Lab2/main.py. - Rectification with epipolar lines. Image pairs are rectified and epipolar lines drawn on top to verify the alignment visually, also in
Lab2/main.py. - Three disparity methods compared. A custom 5x5 SAD block matcher alongside OpenCV’s
StereoBMandStereoSGBM, all scored against ground truth with MAE, RMSE, bad-pixel percentage and SSIM, plus error heatmaps. Seelab3.py. - Depth and point clouds. Disparity is converted to depth from baseline and focal length, and
reprojectImageTo3Dexports colored PLY point clouds. Seelab4.py. - Motion analysis on video. Lucas-Kanade sparse tracking, Farneback dense flow, and morphological motion detection. See
Lab5/main.py.
Learnings
Calibration turned out to be the most instructive part: intrinsics, distortion and extrinsics all have to be right before any disparity result downstream can be trusted.