In this recipe, you will learn how to solve polynomial equations using OpenCV. Such problems can arise in such areas as machine learning, computational algebra, and signal processing.
Solving polynomial equations
Getting ready
Before you proceed with this recipe, you need to install the OpenCV 3.3 (or greater) Python API package.
How to do it...
You need to complete the following steps:
- Import the modules:
import cv2
import numpy as np
- Generate a fourth degree polynomial equation:
N = 4
coeffs = np.random.randn(N+1,1)
- Find all the roots in the complex domain:
retval...