Main utilities

limap.runners.functions.compute_2d_segs(cfg, imagecols, compute_descinfo=True)

Detect and desribe 2D lines for each image in the image collection

Parameters:
  • cfg (dict) – Configuration, fields refer to cfgs/examples/line2d_detect.yaml as a minimal example

  • imagecols (limap.base.ImageCollection) – image collection for the images of interest

  • compute_descinfo (bool, optional, default=True) – whether to extract the line descriptors

Returns:

all the line detections for each image descinfo_folder (str): folder to store the descriptors

Return type:

all_2d_segs (dict[int -> np.array], each with shape (N, 4) or (N, 5))

limap.runners.functions.compute_exhausive_matches(cfg, descinfo_folder, image_ids)

Match lines for each image with all the other images exhaustively

Parameters:
  • cfg (dict) – Configuration, fields refeer to cfgs/examples/line2d_match.yaml as a minimal example

  • descinfo_folder (str) – path to store the descriptors

  • image_ids (list[int]) – list of image ids

Returns:

path to store the computed matches

Return type:

matches_folder (str)

limap.runners.functions.compute_matches(cfg, descinfo_folder, image_ids, neighbors)

Match lines for each image with its visual neighbors

Parameters:
  • cfg (dict) – Configuration, fields refeer to cfgs/examples/line2d_match.yaml as a minimal example

  • descinfo_folder (str) – path to store the descriptors

  • image_ids (list[int]) – list of image ids

  • neighbors (dict[int -> list[int]]) – visual neighbors for each image

Returns:

path to store the computed matches

Return type:

matches_folder (str)

limap.runners.functions.compute_sfminfos(cfg, imagecols, fname='metainfos.txt')

Compute visual neighbors and robust 3D ranges from COLMAP point triangulation.

Parameters:
  • cfg (dict) – Configuration, fields refer to cfgs/examples/pointsfm.yaml as a minimal example

  • imagecols (limap.base.ImageCollection) – image collection for the images of interest, storing intrinsics and triangulated poses

Returns:

path to store the colmap output neighbors (dict[int -> list[int]]): visual neighbors for each image ranges (pair of np.array, each of shape (3,)): robust 3D ranges for the scene computed from the sfm point cloud.

Return type:

colmap_output_path (str)

limap.runners.functions.undistort_images(imagecols, output_dir, fname='image_collection_undistorted.npy', skip_exists=False, n_jobs=-1)

Run undistortion on the images stored in the limap.base.ImageCollection instance imagecols (only distorted images are undistorted), and store the undistorted images into output_dir. The function will return a corresponding limap.base.ImageCollection instance for the undistorted images.

Parameters:
  • imagecols (limap.base.ImageCollection) – Image collection of the images to be undistorted.

  • output_dir (str) – output folder for storing the undistorted images

  • skip_exists (bool) – whether to skip already undistorted images in the output folder.

Returns:

New image collection for the undistorted images

Return type:

limap.base.ImageCollection