Check out example codes for "cv2.solvepnpransac too many values to unpack". It will help you in understanding the concepts better.

Code Example 1

So it might help to try out:

_, rvecs, tvecs, inliers  = cv2.solvePnPRansac(objp, corners2, mtx, dist)
or in case you just want to unpack the last 3 elements:

rvecs, tvecs, inliers  = cv2.solvePnPRansac(objp, corners2, mtx, dist)[:-3]

Learn ReactJs, React Native from akashmittal.com