MCPcopy Create free account
hub / github.com/dcharatan/flowmap / transform_rigid

Function transform_rigid

flowmap/model/projection.py:25–30  ·  view source on GitHub ↗

Apply a rigid-body transformation to points or vectors.

(
    homogeneous_coordinates: Float[Tensor, "*#batch dim"],
    transformation: Float[Tensor, "*#batch dim dim"],
)

Source from the content-addressed store, hash-verified

23
24
25def transform_rigid(
26 homogeneous_coordinates: Float[Tensor, "*#batch dim"],
27 transformation: Float[Tensor, "*#batch dim dim"],
28) -> Float[Tensor, "*batch dim"]:
29 """Apply a rigid-body transformation to points or vectors."""
30 return einsum(transformation, homogeneous_coordinates, "... i j, ... j -> ... i")
31
32
33def transform_cam2world(

Callers 2

transform_cam2worldFunction · 0.85
transform_world2camFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected