Building Rome with Convex Optimization