MCPcopy Create free account
hub / github.com/Ropedia/SpatialBench / apply_sim3_to_points

Function apply_sim3_to_points

benchmark/utils/sim3_align.py:173–188  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

171
172
173def 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
191def apply_sim3_to_c2w(c2w_44, s, R, t):

Callers 2

predictMethod · 0.90
predictMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected