如何安装封闭的轮廓?(How to fit a closed contour?)
我有一个代表闭合轮廓(有噪音)的数据:
contour = [(x1, y1), (x2, y2), ...]
有没有简单的方法来适应轮廓? 有numpy.polyfit 。 但是如果重复x值并且需要一些努力来确定多项式的适当程度,它就会失败。
I have a data that represents a closed contour (with noise):
contour = [(x1, y1), (x2, y2), ...]
Is there any simple way to fit the contour? There is numpy.polyfit. But it fails if x values are repeated and requires some effort to determine an adequate degree of the polynomial.
原文:https://stackoverflow.com/questions/13604611
更新时间:2023-11-02 21:11