Structure-and-motion Pipeline on a Hierarchical Cluster Tree