Visual localization and registration without matching