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,
)
| 197 | |
| 198 | |
| 199 | def 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 | |
| 232 | def interp_homegeneous_tensors( |
nothing calls this directly
no test coverage detected