Rectification and structure reconstruction