Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenCV: apply Rotation matrix from Rodrigues() to a point

I have obtained a Rotation Matrix from Rodrigues() and I want to apply it to a point [1,0,0] in order to find its coordinates in Camera System (ignoring for the moment Translation vector)

How can I do that in Python?

Thanks in advance.

like image 299
MarcoM Avatar asked Dec 28 '17 16:12

MarcoM


1 Answers

I've found a solution that seems to work. Here is sample code to transform point (1,0,0):

# Computing rotation matrix
rotation_matrix = np.zeros(shape=(3,3))
cv2.Rodrigues(rvecs, rotation_matrix)
#Apply rotation matrix to point
original_point = np.matrix([[1],[0],[0]])
rotated_point = rotation_matrix*original_point
like image 61
MarcoM Avatar answered Sep 23 '22 23:09

MarcoM