4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-11 02:24:38 +08:00

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 2024-07-30 03:44:06 +08:00 committed by GitHub
parent 8c87906971
commit b0dd3d4730
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -54,7 +54,7 @@ def quaternion_from_matrix(matrix: NDArray, isprecise: bool = False) -> np.ndarr
matrix: rotation matrix to obtain quaternion
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:
q = np.empty((4,))
t = np.trace(M)