Lines

class limap.base.Line2d

A finite 2D line (segment).

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: _limap._base.Line2d) -> None

    Default constructor

  2. __init__(self: _limap._base.Line2d, seg2d: numpy.ndarray[numpy.float64[m, n]]) -> None

    Constructor from np.array of shape (2, 2) stacking the two 2D endpoints

  3. __init__(self: _limap._base.Line2d, start: numpy.ndarray[numpy.float64[2, 1]], end: numpy.ndarray[numpy.float64[2, 1]]) -> None

    Constructor from start and end endpoints, each a np.array of shape (2,)

  4. __init__(self: _limap._base.Line2d, start: numpy.ndarray[numpy.float64[2, 1]], end: numpy.ndarray[numpy.float64[2, 1]], score: float) -> None

    Constructor from two endpoints and optionally the score

as_array(self: _limap._base.Line2d) numpy.ndarray[numpy.float64[m, n]]
Returns:

Array stacking start and end endpoints

Return type:

np.array of shape (2, 2)

coords(self: _limap._base.Line2d) numpy.ndarray[numpy.float64[3, 1]]
Returns:

Normalized homogeneous coordinate of the 2D line

Return type:

np.array of shape (3,)

direction(self: _limap._base.Line2d) numpy.ndarray[numpy.float64[2, 1]]
Returns:

Direction vector of the 2D line from start to end

Return type:

np.array of shape (2,)

length(self: _limap._base.Line2d) float
Returns:

The length of the 2D line segment

Return type:

float

midpoint(self: _limap._base.Line2d) numpy.ndarray[numpy.float64[2, 1]]
Returns:

Coordinate of the midpoint of the 2D line segment

Return type:

np.array of shape (2,)

point_distance(self: _limap._base.Line2d, p: numpy.ndarray[numpy.float64[2, 1]]) float
Parameters:

p (np.array) – Coordinate of a 2D point, of shape (2,)

Returns:

Distance from the point p to the 2D line segment

Return type:

float

point_projection(self: _limap._base.Line2d, p: numpy.ndarray[numpy.float64[2, 1]]) numpy.ndarray[numpy.float64[2, 1]]
Parameters:

p (np.array) – Coordinate of a 2D point, of shape (2,)

Returns:

Coordinate of the projection of the point p on the 2D line segment

Return type:

np.array of shape (2,)

property end

np.array of shape (2,)

property score

float

property start

np.array of shape (2,)

class limap.base.Line3d

A finite 3D line (segment).

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: _limap._base.Line3d) -> None

    Default constructor

  2. __init__(self: _limap._base.Line3d, seg3d: numpy.ndarray[numpy.float64[m, n]]) -> None

    Constructor from np.array of shape (2, 3) stacking the two 3D endpoints

  3. __init__(self: _limap._base.Line3d, start: numpy.ndarray[numpy.float64[3, 1]], end: numpy.ndarray[numpy.float64[3, 1]]) -> None

    Constructor from start and end endpoints, each a np.array of shape (3,)

  4. __init__(self: _limap._base.Line3d, start: numpy.ndarray[numpy.float64[3, 1]], end: numpy.ndarray[numpy.float64[3, 1]], score: float, depth_start: float, depth_end: float, uncertainty: float) -> None

    Constructor from two endpoints, and optionally: the score, the start and/or end depth of the 3D segment, and the uncertainty value

as_array(self: _limap._base.Line3d) numpy.ndarray[numpy.float64[m, n]]
Returns:

Array stacking start and end endpoints

Return type:

np.array of shape (2, 3)

computeUncertainty(self: _limap._base.Line3d, arg0: _limap._base.CameraView, arg1: float) float
Parameters:
Returns:

The computed uncertainty value with respect to view and var2d

Return type:

float

direction(self: _limap._base.Line3d) numpy.ndarray[numpy.float64[3, 1]]
Returns:

Direction vector of the 3D line from start to end

Return type:

np.array of shape (3,)

length(self: _limap._base.Line3d) float
Returns:

The length of the 3D line segment

Return type:

float

midpoint(self: _limap._base.Line3d) numpy.ndarray[numpy.float64[3, 1]]
Returns:

Coordinate of the midpoint of the 3D line segment

Return type:

np.array of shape (3,)

point_distance(self: _limap._base.Line3d, p: numpy.ndarray[numpy.float64[3, 1]]) float
Parameters:

p (np.array) – Coordinate of a 3D point, of shape (3,)

Returns:

Distance from the point p to the 3D line segment

Return type:

float

point_projection(self: _limap._base.Line3d, p: numpy.ndarray[numpy.float64[3, 1]]) numpy.ndarray[numpy.float64[3, 1]]
Parameters:

p (np.array) – Coordinate of a 3D point, of shape (3,)

Returns:

Coordinate of the projection of the point p on the 3D line segment

Return type:

np.array of shape (3,)

projection(self: _limap._base.Line3d, view: _limap._base.CameraView) _limap._base.Line2d
Parameters:

view (CameraView) – CameraView instance used to project the 3D line segment to 2D

Returns:

The 2D line segment projected from the 3D line segment

Return type:

Line2d

sensitivity(self: _limap._base.Line3d, view: _limap._base.CameraView) float
Parameters:

view (CameraView) – CameraView instance

Returns:

Sensitivity with respect to view

Return type:

float

set_uncertainty(self: _limap._base.Line3d, arg0: float) None

Setter for the uncertainty value

property depths

float

property end

np.array of shape (3,)

property score

float

property start

np.array of shape (3,)

property uncertainty

float

class limap.base.InfiniteLine2d

An infinite 2D line.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: _limap._base.InfiniteLine2d) -> None

    Default constructor

  2. __init__(self: _limap._base.InfiniteLine2d, coords: numpy.ndarray[numpy.float64[3, 1]]) -> None

    Constructor from homogeneous coordinate (np.array of shape (3,))

  3. __init__(self: _limap._base.InfiniteLine2d, p: numpy.ndarray[numpy.float64[2, 1]], direc: numpy.ndarray[numpy.float64[2, 1]]) -> None

    Constructor from a start point and a direction, both np.array of shape (2,)

  4. __init__(self: _limap._base.InfiniteLine2d, line: _limap._base.Line2d) -> None

    Constructor from a Line2d

direction(self: _limap._base.InfiniteLine2d) numpy.ndarray[numpy.float64[2, 1]]
Returns:

The direction of the line

Return type:

np.array of shape (2,)

point(self: _limap._base.InfiniteLine2d) numpy.ndarray[numpy.float64[2, 1]]
Returns:

A point on the line (in fact the projection of (0, 0))

Return type:

np.array of shape (2,)

point_distance(self: _limap._base.InfiniteLine2d, p: numpy.ndarray[numpy.float64[2, 1]]) float
Parameters:

p (np.array) – Coordinate of a 2D point, of shape (2,)

Returns:

Distance from the point p to the 2D infinite line

Return type:

float

point_projection(self: _limap._base.InfiniteLine2d, p: numpy.ndarray[numpy.float64[2, 1]]) numpy.ndarray[numpy.float64[2, 1]]
Parameters:

p (np.array) – Coordinate of a 2D point, of shape (2,)

Returns:

Coordinate of the projection of the point p on the 2D infinite line

Return type:

np.array of shape (2,)

property coords

Homogeneous coordinate, np.array of shape (3,)

class limap.base.InfiniteLine3d

An infinite 3D line.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: _limap._base.InfiniteLine3d) -> None

    Default constructor

  2. __init__(self: _limap._base.InfiniteLine3d, a: numpy.ndarray[numpy.float64[3, 1]], b: numpy.ndarray[numpy.float64[3, 1]], use_normal: bool) -> None

    Constructor using normal coordinate (a start point and direction) or Plücker coordinate.
    if use_normal is True -> (a, b) is (p, direc): normal coordinate with a point and a direction;
    if use_normal is False -> (a, b) is (direc, m): Plücker coordinate.
  3. __init__(self: _limap._base.InfiniteLine3d, line: _limap._base.Line3d) -> None

    Constructor from a Line3d

direction(self: _limap._base.InfiniteLine3d) numpy.ndarray[numpy.float64[3, 1]]
Returns:

The direction of the line (d)

Return type:

np.array of shape (3,)

matrix(self: _limap._base.InfiniteLine3d) numpy.ndarray[numpy.float64[4, 4]]
Returns:

The Plücker matrix

Return type:

np.array of shape (4, 4)

point(self: _limap._base.InfiniteLine3d) numpy.ndarray[numpy.float64[3, 1]]
Returns:

A point on the line (in fact the projection of (0, 0, 0))

Return type:

np.array of shape (3,)

point_distance(self: _limap._base.InfiniteLine3d, p: numpy.ndarray[numpy.float64[3, 1]]) float
Parameters:

p (np.array) – Coordinate of a 3D point, of shape (3,)

Returns:

Distance from the point p to the 3D infinite line

Return type:

float

point_projection(self: _limap._base.InfiniteLine3d, p: numpy.ndarray[numpy.float64[3, 1]]) numpy.ndarray[numpy.float64[3, 1]]
Parameters:

p (np.array) – Coordinate of a 3D point, of shape (3,)

Returns:

Coordinate of the projection of the point p on the 3D infinite line

Return type:

np.array of shape (3,)

project_from_infinite_line(self: _limap._base.InfiniteLine3d, line: _limap._base.InfiniteLine3d) numpy.ndarray[numpy.float64[3, 1]]

Projection from another infinite 3D line by finding the closest point on this 3D line to the other line.

Parameters:

line (InfiniteLine3d) – The other infinite line to project from

Returns:

The projected point on this 3D line from the other line

Return type:

np.array of shape (3,)

project_to_infinite_line(self: _limap._base.InfiniteLine3d, line: _limap._base.InfiniteLine3d) numpy.ndarray[numpy.float64[3, 1]]

Inverse of the previous function: finding the closest point on the other line to this line.

Parameters:

line (InfiniteLine3d) – The other infinite line to project to

Returns:

The projected point on the other line from this line

Return type:

np.array of shape (3,)

projection(self: _limap._base.InfiniteLine3d, view: _limap._base.CameraView) _limap._base.InfiniteLine2d

Projection from Plücker coordinate to 2D homogeneous line coordinate.

Parameters:

view (CameraView) – CameraView instance used to project the 3D infinite line to 2D

Returns:

The 2D infinite line projected from the 3D infinite line

Return type:

InfiniteLine2D

unprojection(self: _limap._base.InfiniteLine3d, p2d: numpy.ndarray[numpy.float64[2, 1]], view: _limap._base.CameraView) numpy.ndarray[numpy.float64[3, 1]]

Unproject a 2D point by finding the closest point on the 3D line from the camera ray of the 2D point.

Parameters:
  • p2d (np.array) – The 2D point to unproject, of shape (2,)

  • view (CameraView) – CameraView instance to unproject the point

Returns:

The closest point on the 3D line from the unprojected camera ray of the 2D point

Return type:

np.array of shape (3,)

property d

Direction, np.array of shape (3,)

property m

Moment, np.array of shape (3,)