limap.base.functions module

limap.base.functions.get_all_lines_2d(all_2d_segs)

Convert np.array representations of 2D line segments to dict of Line2d.

Parameters:

all_2d_segs (dict[int -> np.array]) – Map image IDs to np.array of shape (N, 4), each row (4 numbers) is concatenated by the start and end of a 2D line segment.

Returns:

Map image IDs to list of Line2d.

Return type:

dict[int -> list[Line2d]]

limap.base.functions.get_all_lines_3d(all_3d_segs)

Convert np.array representations of 3D line segments to dict of Line3d.

Parameters:

all_3d_segs (dict[int -> np.array]) – Map image IDs to np.array of shape (N, 2, 3), each 2*3 matrix is stacked from the two endpoints of a 3D line segment.

Returns:

Map image IDs to list of Line3d.

Return type:

dict[int -> list[Line3d]]

limap.base.functions.get_invert_idmap_from_linetracks(all_lines_2d, linetracks)

Get the mapping from a 2D line segment (identified by an image and its line ID) to the index of its associated linetrack.

Parameters:
  • all_lines_2d (dict[int -> list[Line2d]]) – Map image IDs to the list of 2D line segments in each image.

  • linetracks (list[LineTrack]) – All line tracks.

Returns:

Map image ID to list of the associated line track indices for each 2D line, -1 if not associated to any track.

Return type:

dict[int -> list[int]]