Proctoring-AI icon indicating copy to clipboard operation
Proctoring-AI copied to clipboard

cv2.solvepnp undistort error

Open joelpou opened this issue 4 years ago • 0 comments

Hello,

I'm getting the following error whenever I try to run head_pose_estimation.py code:

line 167, in <module>
    (success, rotation_vector, translation_vector) = cv2.solvePnP(model_points, image_points, camera_matrix, dist_coeffs, flags=cv2.SOLVEPNP_UPNP)
cv2.error: OpenCV(4.0.1) C:\ci\opencv-suite_1573470242804\work\modules\calib3d\src\undistort.cpp:387: error: (-215:Assertion failed) CV_IS_MAT(_src) && CV_IS_MAT(_dst) && (_src->rows == 1 || _src->cols == 1) && (_dst->rows == 1 || _dst->cols == 1) && _src->cols + _src->rows - 1 == _dst->rows + _dst->cols - 1 && (CV_MAT_TYPE(_src->type) == CV_32FC2 || CV_MAT_TYPE(_src->type) == CV_64FC2) && (CV_MAT_TYPE(_dst->type) == CV_32FC2 || CV_MAT_TYPE(_dst->type) == CV_64FC2) in function 'cvUndistortPointsInternal'

There is still an issue opened here regarding updating opencv doc with this numpy array slice requirement which it seems is the culprit. Is there another way to avoid getting this error? Any help is appreciated.

joelpou avatar Jul 19 '21 23:07 joelpou