Unsupervised Learning of Depth and Ego-Motion: A Structured Approach