limap.line2d.line_utils package

Submodules

limap.line2d.line_utils.merge_lines module

limap.line2d.line_utils.merge_lines.get_orth_line_dist(line_seg1, line_seg2, min_overlap=0.5, return_overlap=False, mode='min')

Compute the symmetrical orthogonal line distance between two sets of lines and the average overlapping ratio of both lines. Enforce a high line distance for small overlaps. This is compatible for nD objects (e.g. both lines in 2D or 3D).

limap.line2d.line_utils.merge_lines.get_segment_overlap(seg_coord1d)

Given a list of segments parameterized by the 1D coordinate of the endpoints, compute the overlap with the segment [0, 1].

limap.line2d.line_utils.merge_lines.merge_line_cluster(lines)

Merge a cluster of line segments. First compute the principal direction of the lines, compute the endpoints barycenter, project the endpoints onto the middle line, keep the two extreme projections. :param lines: a (n, 2, 2) np array containing n lines.

Returns:

The merged (2, 2) np array line segment.

limap.line2d.line_utils.merge_lines.merge_lines(lines, thresh=5.0, overlap_thresh=0.0)

Given a set of lines, merge close-by lines together. Two lines are merged when their orthogonal distance is smaller than a threshold and they have a positive overlap. :param lines: a (N, 2, 2) np array. :param thresh: maximum orthogonal distance between two lines to be merged. :param overlap_thresh: maximum distance between 2 endpoints to merge

two aligned lines.

Returns:

The new lines after merging.

limap.line2d.line_utils.merge_lines.project_point_to_line(line_segs, points)

Given a list of line segments and a list of points (2D or 3D coordinates), compute the orthogonal projection of all points on all lines. This returns the 1D coordinates of the projection on the line, as well as the list of orthogonal distances.

Module contents