How to produce SAR image cross-spectra after FFT for ocean waves?

18 views Asked by At

I have been trying to obtain image spectrum after running my SAR image through FFT in python, and subsequently can allow me to get the wavelength of the ocean waves in the SAR image, however, I am not getting the images like as shown: Graphs of image spectrum in researhc papers

My current code for FFT:

def calculate_2dft(input):
    ft = np.fft.ifftshift(input)
    ft = np.fft.fft2(ft)
    return np.fft.fftshift(ft)

#Read and process image
image = img[400:600, 400:600, :3].mean(axis=2)  # Convert to grayscale

plt.set_cmap("gray")

ft = calculate_2dft(image)

fig, axs = plt.subplots(1, 2, figsize=(12, 6))

axs[0].imshow(image)
axs[1].imshow(np.log(abs(ft)))
plt.show()

My output after FFT

Anyone has some idea on how to produce the images? Or maybe some good lead on how I can start coding to produce that? Thank you!

0

There are 0 answers