Stereo imaging depicts how the human eye works. In this technique two cameras are used to capture the image of a test object. The disparity of points from the two images is used to reconstruct the 3D of the object. To further understand this, let’s consider Figure 1.
This is similar for the second camera. Hence we can also write,
It should be observed that the Z seen at both of the cameras are equal. Thus it follows that,
Substituting Equation 3 to Equation 1 and solving for Z yields,
The equation for Z tells us that the depth or the height of a test object is dependent on the focal length of the camera, the baseline or the distance between the two cameras and the difference between the corresponding image coordinates along the x axis.
In this activity we render the shape of a box using stereo imaging. Figure 2 shows the stereo images of the box obtained.
Figure 2: Stereo images of a box with baseline equal to 10cm, and focal length of 4.2cm
Using the Rquation for Z, the real world coordinates of the box were solved. Plotting these points, the 3D reconstruction of the object was rendered. This is shown in Figure 3.
Since the obtained values for the X, Y and Z are in pixels, these were multiplied by some calibration constants obtained by placing an object with known dimensions. For this purpose, a chess board known to have squares of side 2.5cm was used to obtain the x any y calibration constant. The Z calibration constant used is the same as the X calibration constant.
The 3D reconstruction of the box shown in Figure 3 was obtained by using seven points. As can be observed the reconstruction was able to get the shape of the box. To verify the accuracy of the reconstruction, the Euclidean distances between points constituting sides n, o and m in the reconstruction were calculated. These sides were found to have a value of 8.6cm, 8.2cm and 8cm respectively. Sides m, n and o should have the same value. However the calculated value of the sides doesn’t show this. This error is due to the dependence of Z in the difference of corresponding points in the images. In reconstructing the box, we manually pointed corresponding points from the stereo images. Point mismatch by some pixel can introduce error in the final reconstruction. This problem is actually the main dilemma in stereo imaging and is known as the correspondence problem.