[Python 3.X] OpenCV 3, utilisation fonction cv2.undistortPoints
Bonjour,
J'essai tant bien que mal d'utiliser la fonction undistortPoints de la librairie OpenCV, mais sans obtenir de resultats..
Voici mon code
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
K = array([[486, 0., 374],
[0., 589, 212],
[0., 0., 1.]])
d = array([-0.3899507, 0.13557542, 0.00493184, -0.00536627, -0.01834243])
Kn = array([[316, 0., 367],
[0., 382, 216],
[0., 0., 1.]])
point_matrix = np.zeros(shape=frame.shape, dtype=np.float32)
point_matrix_new = cv2.undistortPoints(point_matrix, K, d, Kn) |
et j'obtient l'erreur suivante
Code:
OpenCV Error: Assertion failed (src.isContinuous() && (src.depth() == CV_32F || src.depth() == CV_64F) && ((src.rows == 1 && src.channels() == 2) || src.cols*src.channels() == 2)) in cv::undistortPoints, file E:\opencv\op\opencv\modules\imgproc\src\undistort.cpp, line 423
J'imagine que c'est la source qui n'est pas bonne mais je n'ai trouver aucun exemple utilisant cette fonction
Voici la definition de la fonction:
Code:
1 2 3
| def undistortPoints(src, cameraMatrix, distCoeffs, dst=None, R=None, P=None): # real signature unknown; restored from __doc__
""" undistortPoints(src, cameraMatrix, distCoeffs[, dst[, R[, P]]]) -> dst """
pass |