def LaplaceFFTDemo(self):
origfftimg = self.PrepareFFT()
fftimg = origfftimg.copy()
sz = fftimg.shape
center = np.mat(fftimg.shape) / 2.0
for i in xrange(0, 512):
for j in xrange(0, 512):
#pass
#print -(np.float64(i - center[0, 0]) ** 2.0 + np.float64(j - center[0, 1]) ** 2.0)
fftimg[i, j] *= - 0.00001* (np.float64(i - 256) ** 2.0 + np.float64(j - 256) ** 2.0)
ifft = self.GetIFFT(fftimg)
#plt.imshow(np.real(fftimg))
#plt.show()
# cv2.namedWindow("fft1")
# cv2.imshow("fft1", np.real(origfftimg))
cv2.namedWindow("fft")
cv2.imshow("fft", np.real(fftimg))
# cv2.imshow("ifft", np.uint8(ifft))
cv2.namedWindow("ifft")
cv2.imshow("ifft", ifft)
cv2.waitKey(0)
评论列表
文章目录