Created
September 15, 2017 12:45
-
-
Save JosephRedfern/a43135b0e92078ed709de2bb9241477f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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