refactory: task generate

This commit is contained in:
2025-09-04 16:28:11 +08:00
parent 87b3198e26
commit da022d4f83
19 changed files with 2926 additions and 22 deletions

12
others/transforms.py Executable file
View File

@@ -0,0 +1,12 @@
import numpy as np
from numpy import ndarray
def transform_coordinates_3d(coordinates: ndarray, sRT: ndarray):
assert coordinates.shape[0] == 3
coordinates = np.vstack(
[coordinates, np.ones((1, coordinates.shape[1]), dtype=np.float32)]
)
new_coordinates = sRT @ coordinates
new_coordinates = new_coordinates[:3, :] / new_coordinates[3, :]
return new_coordinates