modified global SfM to take into account rotation averaging method