circlemodel

CircleModel

class skimage.measure.CircleModel [source]

Bases: skimage.measure.fit.BaseModel

Total least squares estimator for 2D circles.

The functional model of the circle is:

r**2 = (x - xc)**2 + (y - yc)**2

This estimator minimizes the squared distances from all points to the circle:

min{ sum((r - sqrt((x_i - xc)**2 + (y_i - yc)**2))**2) }

A minimum number of 3 points is required to solve for the parameters.

Attributes

params (tuple) Circle model parameters in the following order xc, yc, r.
__init__() [source]
estimate(data) [source]

Estimate circle model from data using total least squares.

Parameters:

data : (N, 2) array

N points with (x, y) coordinates, respectively.

Returns:

success : bool

True, if model estimation succeeds.

predict_xy(t, params=None) [source]

Predict x- and y-coordinates using the estimated model.

Parameters:

t : array

Angles in circle in radians. Angles start to count from positive x-axis to positive y-axis in a right-handed system.

params : (3, ) array, optional

Optional custom parameter set.

Returns:

xy : (..., 2) array

Predicted x- and y-coordinates.

residuals(data) [source]

Determine residuals of data to model.

For each point the shortest distance to the circle is returned.

Parameters:

data : (N, 2) array

N points with (x, y) coordinates, respectively.

Returns:

residuals : (N, ) array

Residual for each data point.

doc_scikit_image
2017-01-12 17:20:26
Comments
Leave a Comment

Please login to continue.