mirror of
https://github.com/wassname/scikit-image.git
synced 2026-08-03 13:11:25 +08:00
Remove is_degenerate methods from estimation models
This commit is contained in:
@@ -94,24 +94,6 @@ class LineModel(BaseModel):
|
||||
|
||||
return dist - (x * math.cos(theta) + y * math.sin(theta))
|
||||
|
||||
@classmethod
|
||||
def is_degenerate(cls, data):
|
||||
"""Check whether set of points is degenerate.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
data : (N, 2) array
|
||||
N points with `(x, y)` coordinates, respectively.
|
||||
|
||||
Returns
|
||||
-------
|
||||
flag : bool
|
||||
Flag indicating if data is degenerate.
|
||||
|
||||
"""
|
||||
|
||||
return data.shape[0] < 2
|
||||
|
||||
def predict_x(self, y, params=None):
|
||||
"""Predict x-coordinates using the estimated model.
|
||||
|
||||
@@ -246,24 +228,6 @@ class CircleModel(BaseModel):
|
||||
|
||||
return r - np.sqrt((x - xc)**2 + (y - yc)**2)
|
||||
|
||||
@classmethod
|
||||
def is_degenerate(cls, data):
|
||||
"""Check whether set of points is degenerate.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
data : (N, 2) array
|
||||
N points with `(x, y)` coordinates, respectively.
|
||||
|
||||
Returns
|
||||
-------
|
||||
flag : bool
|
||||
Flag indicating if data is degenerate.
|
||||
|
||||
"""
|
||||
|
||||
return data.shape[0] < 3
|
||||
|
||||
def predict_xy(self, t, params=None):
|
||||
"""Predict x- and y-coordinates using the estimated model.
|
||||
|
||||
@@ -450,24 +414,6 @@ class EllipseModel(BaseModel):
|
||||
|
||||
return residuals
|
||||
|
||||
@classmethod
|
||||
def is_degenerate(cls, data):
|
||||
"""Check whether set of points is degenerate.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
data : (N, 2) array
|
||||
N points with `(x, y)` coordinates, respectively.
|
||||
|
||||
Returns
|
||||
-------
|
||||
flag : bool
|
||||
Flag indicating if data is degenerate.
|
||||
|
||||
"""
|
||||
|
||||
return data.shape[0] < 5
|
||||
|
||||
def predict_xy(self, t, params=None):
|
||||
"""Predict x- and y-coordinates using the estimated model.
|
||||
|
||||
|
||||
@@ -41,28 +41,6 @@ class GeometricTransform(object):
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
@classmethod
|
||||
def is_degenerate(cls, src, dst):
|
||||
"""Check whether set of points is degenerate.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
src : (N, 2) array
|
||||
Source coordinates.
|
||||
dst : (N, 2) array
|
||||
Destination coordinates.
|
||||
|
||||
Returns
|
||||
-------
|
||||
flag : bool
|
||||
Flag indicating if data is degenerate.
|
||||
|
||||
"""
|
||||
|
||||
# by default never degenerate since system equations can be under-,
|
||||
# well- and over-determined.
|
||||
return False
|
||||
|
||||
def residuals(self, src, dst):
|
||||
"""Determine residuals of transformed destination coordinates.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user