From a22df581a971c585d41bbdc7c0471e2595c87227 Mon Sep 17 00:00:00 2001 From: "Chimitt, Nicholas M" Date: Tue, 27 Jul 2021 14:58:56 -0400 Subject: [PATCH] Delete motion_compensate.py --- Turbulence_Sim_v1_python/motion_compensate.py | 31 ------------------- 1 file changed, 31 deletions(-) delete mode 100644 Turbulence_Sim_v1_python/motion_compensate.py diff --git a/Turbulence_Sim_v1_python/motion_compensate.py b/Turbulence_Sim_v1_python/motion_compensate.py deleted file mode 100644 index d647cde..0000000 --- a/Turbulence_Sim_v1_python/motion_compensate.py +++ /dev/null @@ -1,31 +0,0 @@ -import numpy as np -from skimage.transform import resize -import matplotlib.pyplot as plt - -# Python version -# of original code by Prof. Stanley Chan - -def motion_compensate(img, Mvx, Mvy, pel): - m, n = np.shape(img)[0], np.shape(img)[1] - img = resize(img, (np.int32(m/pel), np.int32(n/pel)), mode = 'reflect' ) - Blocksize = np.floor(np.shape(img)[0]/np.shape(Mvx)[0]) - m, n = np.shape(img)[0], np.shape(img)[1] - M, N = np.int32(np.ceil(m/Blocksize)*Blocksize), np.int32(np.ceil(n/Blocksize)*Blocksize) - - f = img[0:M, 0:N] - - - Mvxmap = resize(Mvy, (N,M)) - Mvymap = resize(Mvx, (N,M)) - - - xgrid, ygrid = np.meshgrid(np.arange(0,N-0.99), np.arange(0,M-0.99)) - X = np.clip(xgrid+np.round(Mvxmap/pel),0,N-1) - Y = np.clip(ygrid+np.round(Mvymap/pel),0,M-1) - - idx = np.int32(Y.flatten()*N + X.flatten()) - f_vec = f.flatten() - g = np.reshape(f_vec[idx],[N,M]) - - g = resize(g, (np.shape(g)[0]*pel,np.shape(g)[1]*pel)) - return g \ No newline at end of file