MCPcopy Create free account
hub / github.com/TencentARC/FreeSplatter / interp

Function interp

freesplatter/utils/recon_util.py:185–194  ·  view source on GitHub ↗

Runs multidimensional B-spline interpolation on the input points.

(points, n, k, s)

Source from the content-addressed store, hash-verified

183 return np.array([viewmatrix(p - l, u - p, p) for p, l, u in points])
184
185 def interp(points, n, k, s):
186 """Runs multidimensional B-spline interpolation on the input points."""
187 sh = points.shape
188 pts = np.reshape(points, (sh[0], -1))
189 k = min(k, sh[0] - 1)
190 tck, _ = scipy.interpolate.splprep(pts.T, k=k, s=s)
191 u = np.linspace(0, 1, n, endpoint=False)
192 new_points = np.array(scipy.interpolate.splev(u, tck))
193 new_points = np.reshape(new_points.T, (n, sh[1], sh[2]))
194 return new_points
195
196 points = poses_to_points(poses, dist=rot_weight)
197 new_points = interp(points,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected