
Remember to keep the name of each corresponding image the same. Divide the images into 2 and put all the images from the left camera in one folder and from the right camera in one folder.We use the Stereo Camera Calibrator app in MATLAB for calibrating the camera and importing the parameters to our main workspace.įor calibration we require 20-25 stereo images of a chessboard pattern, taken from the to be calibrated camera from different angles. Its a calibration for the algorithm to know the different parameters about the camera, mainly dealing with the physical distance between the 2 cameras.

Here calibration does not mean any physical changes to camera. The workflow Camera Calibrationīefore starting the process of disparity extraction we first calibrate the stereo camera. This workflow has been made to get a basic understanding on how 3D depth perception works. Though there has been a lot of research and much more advance techniques using Neural Networks have been developed for 3D depth perception, the basics remain the same. It is also a field of research in the development of Autonomous Vehicles to eliminate the use of LIDAR’s. For example, the Mars Exploration Rover uses a similar method for scanning the terrain for obstacles. This concept is particularly useful in navigation. Thus 3D Point Clouds of a scene can be extracted from disparity maps pretty accurately using some mathematical transforms. This point, the representant of the cell, can be chosen in different ways. For each cell of this grid, we will only keep one representative point. Using geometry and algebra, the points that appear in the 2D stereo images can be mapped as coordinates in 3D space. The grid subsampling strategy will be based on the division of the 3D space in regular cubic cells called voxels.

This allows for depth perception in stereo images. As the distance from the camera increases, the disparity decreases. In general disparity and depth are inversely related. Once we have the notion of disparity, it is very easy to perceive depth. Block matching approach is used he for the purpose of feature matching. there is no disparity in the y image coordinates).Īfter rectification, the correspondence made by using an algorithm that scans both the left and right images for matching image features. Through the process of image rectification, both images are rotated to allow for disparities in only the horizontal direction(i.e. The disparity of features between 2 stereo images are usually computed as shift to the left of an image feature when viewed in the right image. Though this specific camera comes with an API to compute the disparity map and 3D point cloud, the purpose here is to make a generalized workflow that could be implemented to any stereo camera. Here the popular StereoLabs ZED camera was used to capture the stereo images.

This is a MATLAB workflow to generate a disparity map and consequently a 3D point cloud from the images from a stereo camera. Disparity Maps and 3D Point Clouds from Stereo-Images - MATLAB
