limap.line2d.endpoints package

Submodules

limap.line2d.endpoints.extractor module

class limap.line2d.endpoints.extractor.SuperPointEndpointsExtractor(options=BaseDetectorOptions(set_gray=True, max_num_2d_segs=3000, do_merge_lines=False, visualize=False, weight_path=None), device=None)

Bases: BaseDetector

compute_descinfo(img, segs)

A desc_info is composed of the following tuple / np arrays: - the original image shape (h, w) - the 2D endpoints of the lines in shape [N*2, 2] (xy convention) - the line score of shape [N] (NFA * sqrt(line_length)) - the descriptor of each endpoints of shape [256, N*2]

extract(camview, segs)

Virtual method (for extractor) - extract the features for the detected segments

Parameters:
  • view (limap.base.CameraView) – The limap.base.CameraView instance corresponding to the image

  • segsnp.array of shape (N, 5), line detections. Each row corresponds to x1, y1, x2, y2 and score. Computed from the detect method.

Returns:

The extracted feature

get_descinfo_fname(descinfo_folder, img_id)

Virtual method (for extractor) - Get the target filename of the extracted feature

Parameters:
  • descinfo_folder (str) – The output folder

  • img_id (int) – The image id

Returns:

target filename

Return type:

str

get_module_name()

Virtual method (need to be implemented) - return the name of the module

read_descinfo(descinfo_folder, img_id)

Virtual method (for extractor) - Read in the extracted feature. Dual function for save_descinfo.

Parameters:
  • descinfo_folder (str) – The output folder

  • img_id (int) – The image id

Returns:

The extracted feature

save_descinfo(descinfo_folder, img_id, descinfo)

Virtual method (for extractor) - Save the extracted feature to the target folder

Parameters:
  • descinfo_folder (str) – The output folder

  • img_id (int) – The image id

  • descinfo – The features extracted from the function extract

limap.line2d.endpoints.matcher module

class limap.line2d.endpoints.matcher.NNEndpointsMatcher(extractor, options=BaseMatcherOptions(topk=10, n_neighbors=20, n_jobs=1, weight_path=None), device=None)

Bases: BaseMatcher

get_module_name()
match_pair(descinfo1, descinfo2)
match_segs_with_descinfo(descinfo1, descinfo2)
match_segs_with_descinfo_topk(descinfo1, descinfo2, topk=10)
class limap.line2d.endpoints.matcher.SuperGlueEndpointsMatcher(extractor, options=BaseMatcherOptions(topk=10, n_neighbors=20, n_jobs=1, weight_path=None), weights='outdoor', device=None)

Bases: BaseMatcher

get_module_name()
match_pair(descinfo1, descinfo2)
match_segs_with_descinfo(descinfo1, descinfo2)
match_segs_with_descinfo_topk(descinfo1, descinfo2, topk=10)

Module contents