limap.line2d.LBD package
Submodules
limap.line2d.LBD.extractor module
- class limap.line2d.LBD.extractor.LBDExtractor(options=BaseDetectorOptions(set_gray=True, max_num_2d_segs=3000, do_merge_lines=False, visualize=False, weight_path=None))
Bases:
BaseDetector
- compute_descinfo(img, segs)
A desc_info is composed of the following tuple / np arrays: - the multiscale lines [N, 5] containing tuples of (scale, scaled_line) - the line descriptors [N, dim]
- 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 imagesegs –
np.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.LBD.extractor.process_pyramid(img, detector, n_levels=5, level_scale=1.4142135623730951, presmooth=True)
- limap.line2d.LBD.extractor.to_multiscale_lines(lines)
limap.line2d.LBD.matcher module
- class limap.line2d.LBD.matcher.LBDMatcher(extractor, options=BaseMatcherOptions(topk=10, n_neighbors=20, n_jobs=1, weight_path=None))
Bases:
BaseMatcher
- check_compatibility(extractor)
- get_module_name()
- match_pair(descinfo1, descinfo2)
- match_segs_with_descinfo(descinfo1, descinfo2)
- match_segs_with_descinfo_topk(descinfo1, descinfo2, topk=10)