C++ 在OpenCV中将多项式等长分割
我有一个三阶多项式方程和位于该多边形上的两个点。我还可以用opencv arcLength函数计算这些点之间的多边形长度 如何得到这些均匀分布的点,这些点将多边形分成N个长度相同的部分C++ 在OpenCV中将多项式等长分割,c++,opencv,polynomial-math,polynomials,C++,Opencv,Polynomial Math,Polynomials,我有一个三阶多项式方程和位于该多边形上的两个点。我还可以用opencv arcLength函数计算这些点之间的多边形长度 如何得到这些均匀分布的点,这些点将多边形分成N个长度相同的部分 让我们看看这是否有帮助。具体如下: f = polynomial f' = derivative of f N = Number of subdivisions D = length of each subdivisions a = x coordinate of f for the first end
让我们看看这是否有帮助。具体如下:
f = polynomial
f' = derivative of f
N = Number of subdivisions
D = length of each subdivisions
a = x coordinate of f for the first end of the curve.
M = max of f' in the interval [a, b] where the curve is to be drawn.
k = an integer such that an error of M/k would be negligible
算法
- 对于每个
1
sum(j) = sum from i=1 to n(j) of sqrt(1 + f'(a + (i-1)/k)^2)/k
1/k * sqrt(1 + f'(a + (i-1)/k)^2)