make np.array compatible with numpy 2.0 (#3339)

* make np.array compatible with numpy 2.0

* Update camera_utils.py
This commit is contained in:
Guangyun-Xu authored and GitHub committed 2024-07-29 12:44:06 -07:00
1 parent 8c87906971
commit b0dd3d4730
1 file changed
+1 -1
+1 -1
View File
@@ -54,7 +54,7 @@ def quaternion_from_matrix(matrix: NDArray, isprecise: bool = False) -> np.ndarr
matrix: rotation matrix to obtain quaternion matrix: rotation matrix to obtain quaternion
isprecise: if True, input matrix is assumed to be precise rotation matrix and a faster algorithm is used. isprecise: if True, input matrix is assumed to be precise rotation matrix and a faster algorithm is used.
""" """
M = np.array(matrix, dtype=np.float64, copy=False)[:4, :4] M = np.array(matrix, dtype=np.float64, copy=True)[:4, :4]
if isprecise: if isprecise:
q = np.empty((4,)) q = np.empty((4,))
t = np.trace(M) t = np.trace(M)