linemodelnd

LineModelND

class skimage.measure.LineModelND [source]

Bases: skimage.measure.fit.BaseModel

Total least squares estimator for N-dimensional lines.

Lines are defined by a point (origin) and a unit vector (direction) according to the following vector equation:

X = origin + lambda * direction

Attributes

params (tuple) Line model parameters in the following order origin, direction.
__init__() [source]
estimate(data) [source]

Estimate line model from data.

Parameters:

data : (N, dim) array

N points in a space of dimensionality dim >= 2.

Returns:

success : bool

True, if model estimation succeeds.

predict(x, axis=0, params=None) [source]

Predict intersection of the estimated line model with a hyperplane orthogonal to a given axis.

Parameters:

x : array

coordinates along an axis.

axis : int

axis orthogonal to the hyperplane intersecting the line.

params : (2, ) array, optional

Optional custom parameter set in the form (origin, direction).

Returns:

y : array

Predicted coordinates.

If the line is parallel to the given axis, a ValueError is raised.

predict_x(y, params=None) [source]

Predict x-coordinates for 2D lines using the estimated model.

Alias for:

predict(y, axis=1)[:, 0]
Parameters:

y : array

y-coordinates.

params : (2, ) array, optional

Optional custom parameter set in the form (origin, direction).

Returns:

x : array

Predicted x-coordinates.

predict_y(x, params=None) [source]

Predict y-coordinates for 2D lines using the estimated model.

Alias for:

predict(x, axis=0)[:, 1]
Parameters:

x : array

x-coordinates.

params : (2, ) array, optional

Optional custom parameter set in the form (origin, direction).

Returns:

y : array

Predicted y-coordinates.

residuals(data) [source]

Determine residuals of data to model.

For each point the shortest distance to the line is returned. It is obtained by projecting the data onto the line.

Parameters:

data : (N, dim) array

N points in a space of dimension dim.

Returns:

residuals : (N, ) array

Residual for each data point.

doc_scikit_image
2017-01-12 17:21:49
Comments
Leave a Comment

Please login to continue.