OpenCV应用技术

OpenCV:solvePoly多项式方程求解函数

2020-04-20  本文已影响0人  AI秘籍

函数

/** @brief Finds the real or complex roots of a polynomial equation.

The function cv::solvePoly finds real and complex roots of a polynomial equation:
\f[\texttt{coeffs} [n] x^{n} +  \texttt{coeffs} [n-1] x^{n-1} + ... +  \texttt{coeffs} [1] x +  \texttt{coeffs} [0] = 0\f]
@param coeffs array of polynomial coefficients.
@param roots output (complex) array of roots.
@param maxIters maximum number of iterations the algorithm does.
*/
CV_EXPORTS_W double solvePoly(InputArray coeffs, OutputArray roots, int maxIters = 300);

参数
coeffs – array of polynomial coefficients.
roots – output (complex) array of roots. 是一个 n×2n×2 的矩阵,每一行代表一个root,第一列代表实部,第二列代表虚部
maxIters – maximum number of iterations the algorithm does.


image.png

注意
OpenCV 版本中使用 的 Coeffs 是从常数项到最高阶的,与我们一般使用的顺序相反

示例

image.png image.png image.png

参考:

  1. https://blog.csdn.net/baishuo8/article/details/81013649
上一篇 下一篇

猜你喜欢

热点阅读