2 import matplotlib.pyplot
as plt
9 return np.fft.fftshift(np.fft.fft2(np.fft.fftshift(f)))
13 return np.fft.fftshift(np.fft.ifft2(np.fft.fftshift(f)))
17 """single side band encoding""" 18 height, width = ch.shape
19 a = np.zeros((height, width), dtype=
'complex128')
21 CH = CH[height // 4: (height * 3) // 4, :]
22 a[0:height // 2, :] = CH
23 a[height // 2:, :] = np.conj(CH)
30 arrin = np.copy(np.imag(arr))
32 arrin = np.copy(np.real(arr))
34 arrin = np.copy(np.angle(arr))
35 elif type ==
'amplitude':
36 arrin = np.copy(np.abs(arr))
40 arrin -= np.min(arrin)
42 arrin = arrin / np.max(arrin)
49 img = np.zeros((h, w, 3))
53 plt.imsave(fname, img)
58 """Get Single channel image""" 60 phase = fname +
'_IM.bmp' 61 plt.imsave(phase, im, cmap=
'gray')
63 real = fname +
'_RE.bmp' 64 plt.imsave(real, re, cmap=
'gray')
def normalize(arr, type='angle')
def getRGBImage(R, G, B, fname, type='phase')
def getMonoImage(ch, fname)