Main function: hybrid localization

limap.runners.line_localization.line_localization(cfg, imagecols_db, imagecols_query, point_corresp, linemap_db, retrieval, results_path, img_name_dict=None, logger=None)

Run visual localization on query images with imagecols, it takes 2D-3D point correspondences from HLoc; runs line matching using 2D line matcher (“epipolar” for Gao et al. “Pose Refinement with Joint Optimization of Visual Points and Lines”); calls pl_estimate_absolute_pose() to estimate the absolute camera pose for all query images, and writes results in results file in results_path.

Parameters:
  • cfg (dict) – Configuration, fields refer to cfgs/localization/default.yaml

  • imagecols_db (limap.base.ImageCollection) – Image collection of database images, with triangulated camera poses

  • imagecols_query (limap.base.ImageCollection) – Image collection of query images, camera poses only used for epipolar matcher/filter as coarse poses, can be left uninitialized otherwise

  • linemap_db (list[limap.base.LineTrack]) – LIMAP triangulated/fitted line tracks

  • retrieval (dict) – Mapping of query image file path to list of neighbor image file paths, e.g. returned from hloc.utils.parsers.parse_retrieval()

  • results_path (str | Path) – File path to write the localization results

  • img_name_dict (dict, optional) – Mapping of query image IDs to the image file path, by default the image names from imagecols

  • logger (logging.Logger, optional) – Logger to print logs for information

Returns:

Mapping of query image IDs to the localized camera poses for all query images.

Return type:

Dict[int -> limap.base.CameraPose]