Saturday, January 25, 2014

Playing with Disparity II

So, learning from previous attempt, let's try again.

This time, with better calibration. Turns out just taking many pictures of the calibration chequerboard is not enough. At least in this case adding two more odd angles improved the lens distortion correction:

 While the individual horizontal and vertical lines on the left image are straight, they are not perpendicular to each other. A property preserved with better calibration images.

Next, improved stereo image rectification. Very important for epipolar geometry is the computation of a good fundamental matrix. Turns out, that just using the best weighted features is not enough. Some manual checking that they are distributed throughout the pictures does wonders:

The bad and good example, the difference a couple of different points used in the fundamental matrix calculation can make.

All this produces a more correct disparity image, where the benches are before the trees and the trees are straight:

And now, that we have a good calibration of intrinsic parameters and a better fundamental matrix, we can calculate the existential matrix and place each camera in to the global coordinate system. And from there we can do 3D reconstruction:

Matched feature points on both images used in the reconstruction. Note the points on the trees, the bench and the table in the background behind the trees.

Camera view of the reconstructed points in 3D space. We can make out the trees, the bench and the background table.

But the reconstruction becomes apparent when we shift the view to the top down perspective. Here we can see the distance and the relative placement between the bench, the trees and the background table.