Sparse and dense 3D reconstruction from multiple views