用于执行二维曲线拟合的库
fitting2d的Python项目详细描述
装配2D
用于执行二维曲线拟合的库。在
安装
pip install . # within this repository
大概也可以从PyPI安装:
^{pr2}$使用
有关更详细的文档,请访问我们的documentation page。在
类
目前,它只有两种类型的装配程序作为类:
Ellipse
Circle
Parabola
这两个类都被构建为namedtuple
s
您还可以通过在类中添加FittingMixin
混合来扩展库
到您的形状类(构建为namedtuple
)。在
安装
要执行装配程序,请运行例如
# xp and yp consisting of x- and y- coordinates as arraysmodel=Ellipse.fit(xp,yp)
绘制拟合形状
这两个类都有draw
方法,使用基于参数的表示:
# t being the coordinate parameterxp,yp=model.draw(t)
上面的参数t
的性质取决于拟合的形状。
在draw
方法的docstring中有一些提示。在
许可证
版权所有(c)2020 Keisuke Sehara,麻省理工学院许可证
- 项目
标签: