A Robust Coarse-to-fine Least-squares Stereo Matching for Automatic Terrain 3-D Reconstruction