-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Closed
Labels
Description
System Information
python code,Version:opencv-python 4.11.0.86
System: windows 11
Detailed description
If you use the cv.solveCubic function to solve a cubic equation, if the coefficient of cubic is very small, 10 ^-13, the solution is abnormal.
Steps to reproduce
example:
import cv2
import numpy as np
def solve_polynomial(a, b, c, d):
roots = np.zeros(3, dtype=np.float64)
cv2.solveCubic(np.array([a, b, c, d], dtype=np.float64), roots)
return roots.tolist()
# example:
a = 2 * 10 ** (-13)
b = 1
c = -2
d = 1
roots = solve_polynomial(a, b, c, d)
print("root:", roots)
output:
root: [-5000000000002.0, 14339.64892578125, -14337.646728515625]
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- I updated to the latest OpenCV version and the issue is still there
- There is reproducer code and related data files (videos, images, onnx, etc)
Reactions are currently unavailable