mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-01 21:39:06 +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:
1 parent
8c87906971
commit
b0dd3d4730
1 file changed
+1
-1
@@ -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)
|
||||||
|
|||||||
Reference in new issue
Block a user