Estimating pose by minimizing reprojection error