numpy.linalg.inv error
hi i wrote these codes:
M, mask = cv2.findHomography(src_pts, dst_pts, cv2.RANSAC, 5.0)
homography = M, mask
camera = {
"u0": 240,
"v0": 320,
"f0": 800,
"fv": 800,
}
def projection_matrix(homography):
global camera
other_dict = list(camera.items())
# Compute rotation along the x and y axis as well as the translation
homography = homography * (-1)
rot_and_transl = np.dot(np.linalg.inv(other_dict), homography)
but pycharm gives this error:
numpy.linalg.LinAlgError: Last 2 dimensions of the array must be square
I know my Two Matrices arent Square, Please Tell me How Convert Them into Square Matrices
what are you trying to achieve with the dot product ?
(we also cannot help you with numpy or pycharm problems)
you say
np.linalg.inv(other_dict)
. show meother_dict
. is it REALLY a matrix?also fix the formatting of your code. your indentation is mangled. this destroys the code.