You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compiler => unknown (installed opencv-contrib-python from PyPI)
Detailed description
When using the functions cv2.omnidir.projectPoints and cv2.omnidir.undistortPoints via the python API, the results might be garbage depending on how the input points were sliced and reshaped.
If the input numpy array is copied, the issue disappears.
Steps to reproduce
importcv2importnumpyasnp# Dummy camera parameters.K=np.array([[500.0, 0.0, 500.0], [0.0, 500.0, 500.0], [0.0, 0.0, 1.0]])
D= (0.0, 0.0, 0.0, 0.0)
Xi=np.array(0.0)
R=np.eye(3)
# Generate a bunch of 2D points, with an extra 3rd channel which we'll slice away.rng=np.random.default_rng(seed=1234)
points=rng.uniform(0, 1000, size=(6, 3))
np.testing.assert_allclose(
cv2.omnidir.undistortPoints(points[:, :2].reshape(-1, 1, 2), K, D, Xi, R),
cv2.omnidir.undistortPoints(points[:, :2].reshape(-1, 1, 2).copy(), K, D, Xi, R),
atol=1e-6,
rtol=1e-6,
)
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
The text was updated successfully, but these errors were encountered:
System information (version)
opencv-contrib-python
from PyPI)Detailed description
When using the functions
cv2.omnidir.projectPoints
andcv2.omnidir.undistortPoints
via the python API, the results might be garbage depending on how the input points were sliced and reshaped.If the input numpy array is copied, the issue disappears.
Steps to reproduce
Issue submission checklist
forum.opencv.org, Stack Overflow, etc and have not found any solution
The text was updated successfully, but these errors were encountered: