用法:
class skimage.measure.EllipseModel
基礎:
skimage.measure.fit.BaseModel
2D 橢圓的總最小二乘估計量。
橢圓的函數模型為:
xt = xc + a*cos(theta)*cos(t) - b*sin(theta)*sin(t) yt = yc + a*sin(theta)*cos(t) + b*cos(theta)*sin(t) d = sqrt((x - xt)**2 + (y - yt)**2)
其中
(xt, yt)
是橢圓上最接近(x, y)
的點。因此d是從點到橢圓的最短距離。估計器基於最小二乘最小化。直接計算最優解,不需要迭代。這導致了一種簡單、穩定和魯棒的擬合方法。
params
屬性包含以下順序的參數:xc, yc, a, b, theta
例子:
>>> xy = EllipseModel().predict_xy(np.linspace(0, 2 * np.pi, 25), ... params=(10, 15, 4, 8, np.deg2rad(30))) >>> ellipse = EllipseModel() >>> ellipse.estimate(xy) True >>> np.round(ellipse.params, 2) array([10. , 15. , 4. , 8. , 0.52]) >>> np.round(abs(ellipse.residuals(xy)), 5) array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.])
- params:元組
橢圓模型參數按以下順序 xc、yc、a、b、theta。
屬性:
相關用法
- Python skimage.measure.ransac用法及代碼示例
- Python skimage.measure.profile_line用法及代碼示例
- Python skimage.measure.perimeter_crofton用法及代碼示例
- Python skimage.measure.moments_hu用法及代碼示例
- Python skimage.measure.moments_coords_central用法及代碼示例
- Python skimage.measure.LineModelND用法及代碼示例
- Python skimage.measure.block_reduce用法及代碼示例
- Python skimage.measure.moments用法及代碼示例
- Python skimage.measure.shannon_entropy用法及代碼示例
- Python skimage.measure.moments_normalized用法及代碼示例
- Python skimage.measure.euler_number用法及代碼示例
- Python skimage.measure.perimeter用法及代碼示例
- Python skimage.measure.moments_central用法及代碼示例
- Python skimage.measure.regionprops用法及代碼示例
- Python skimage.measure.find_contours用法及代碼示例
- Python skimage.measure.CircleModel用法及代碼示例
- Python skimage.measure.label用法及代碼示例
- Python skimage.measure.regionprops_table用法及代碼示例
- Python skimage.measure.moments_coords用法及代碼示例
- Python skimage.metrics.hausdorff_distance用法及代碼示例
注:本文由純淨天空篩選整理自scikit-image.org大神的英文原創作品 skimage.measure.EllipseModel。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。