Skip to content

Instantly share code, notes, and snippets.

@JosephRedfern
Created September 15, 2017 12:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JosephRedfern/a43135b0e92078ed709de2bb9241477f to your computer and use it in GitHub Desktop.
Save JosephRedfern/a43135b0e92078ed709de2bb9241477f to your computer and use it in GitHub Desktop.
# frames is a list of mdarrays
new_image = np.zeros(frames[n].shape, dtype=frames[n].dtype)
for ny, y in tqdm(enumerate(flow)):
for nx, flow in enumerate(y):
x_flow, y_flow = flow
new_x = int(nx+x_flow*flow_scaling)
new_y = int(ny+y_flow*flow_scaling)
try:
new_image[new_y][new_x] = frames[n+skiprate][new_y][new_x]
except Exception as ex:
print(ex)
continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment