Apply SIM(3) transform to a point cloud. Args: point_maps: (B, H, W, 3) or (N, 3) s: scale R: (3, 3) t: (3,) Returns: transformed point cloud with the same shape as the input
(point_maps, s, R, t)
| 171 | |
| 172 | |
| 173 | def apply_sim3_to_points(point_maps, s, R, t): |
| 174 | """Apply SIM(3) transform to a point cloud. |
| 175 | |
| 176 | Args: |
| 177 | point_maps: (B, H, W, 3) or (N, 3) |
| 178 | s: scale |
| 179 | R: (3, 3) |
| 180 | t: (3,) |
| 181 | |
| 182 | Returns: |
| 183 | transformed point cloud with the same shape as the input |
| 184 | """ |
| 185 | original_shape = point_maps.shape |
| 186 | pts = point_maps.reshape(-1, 3) |
| 187 | transformed = s * (R @ pts.T).T + t |
| 188 | return transformed.reshape(original_shape) |
| 189 | |
| 190 | |
| 191 | def apply_sim3_to_c2w(c2w_44, s, R, t): |