MCPcopy Create free account
hub / github.com/apple/ml-pointersect / interp_homegeneous_matrices

Function interp_homegeneous_matrices

plib/rigid_motion.py:199–229  ·  view source on GitHub ↗

Interpolate rotation and translation so that it follows the shortest path and has constant speed. Ref: https://www.geometrictools.com/Documentation/InterpolationRigidMotions.pdf Args: t: the interpolation weight in [0, 1]. If 0, we return the camera

(
        t: float,
        H0: np.ndarray,
        H1: np.ndarray,
)

Source from the content-addressed store, hash-verified

197
198
199def interp_homegeneous_matrices(
200 t: float,
201 H0: np.ndarray,
202 H1: np.ndarray,
203) -> np.ndarray:
204 """
205 Interpolate rotation and translation so that it
206 follows the shortest path and has constant speed.
207
208 Ref: https://www.geometrictools.com/Documentation/InterpolationRigidMotions.pdf
209
210 Args:
211 t:
212 the interpolation weight in [0, 1].
213 If 0, we return the camera pose of H0, and if 1, we return the pose of H1.
214 H0:
215 (4, 4)
216 H1:
217 (4, 4)
218
219 Returns:
220 (4, 4)
221
222 Returns:
223 4*4 homogeneous matrix (from camera cood to world coord)
224 """
225
226 H0_rm = RigidMotion(R=H0[:3, :3], t=H0[:3, 3])
227 H1_rm = RigidMotion(R=H1[:3, :3], t=H1[:3, 3])
228 H_rm = RigidMotion.interp(t, H0_rm, H1_rm)
229 return H_rm.homogeneous_matrix()
230
231
232def interp_homegeneous_tensors(

Callers

nothing calls this directly

Calls 3

RigidMotionClass · 0.85
interpMethod · 0.80
homogeneous_matrixMethod · 0.80

Tested by

no test coverage detected