|
@@ -99,10 +99,14 @@ while True:
|
|
|
point = cv2.drawFrameAxes(frame, cam_mat, dist_coef, rVec[i], tVec[i], 4, 4)
|
|
point = cv2.drawFrameAxes(frame, cam_mat, dist_coef, rVec[i], tVec[i], 4, 4)
|
|
|
|
|
|
|
|
|
|
|
|
|
- R, _ = cv2.Rodrigues(rVec[i]) # Chuyển rVec sang ma trận quay
|
|
|
|
|
- R_inv = R.T # Lấy nghịch đảo của ma trận quay (tức là R^T nếu R là trực giao)
|
|
|
|
|
- position = - R_inv @ tVec[i].reshape(3, 1) # Tính vị trí camera trong hệ marker
|
|
|
|
|
- position = position.reshape(3,)
|
|
|
|
|
|
|
+ # R, _ = cv2.Rodrigues(rVec[i]) # Chuyển rVec sang ma trận quay
|
|
|
|
|
+ # R_inv = R.T # Lấy nghịch đảo của ma trận quay (tức là R^T nếu R là trực giao)
|
|
|
|
|
+ # position = - R_inv @ tVec[i].reshape(3, 1) # Tính vị trí camera trong hệ marker
|
|
|
|
|
+ #
|
|
|
|
|
+ #
|
|
|
|
|
+ # position = position.reshape(3,)
|
|
|
|
|
+
|
|
|
|
|
+ position =np.array([-tVec[i][0][0], tVec[i][0][1], tVec[i][0][2]])
|
|
|
position += default_positions[ids[0]]
|
|
position += default_positions[ids[0]]
|
|
|
|
|
|
|
|
angles = rotationMatrixEulerAngles(R.T)
|
|
angles = rotationMatrixEulerAngles(R.T)
|