How to generate a real valued spectrum of a image?

2 Ansichten (letzte 30 Tage)
Pawl
Pawl am 26 Nov. 2018
I need to generate the real valued spectrum of an image. Therefore I mirroring the image (size MxN) at i=M and j=N to make it symmetric.
ImSize=10;
Image=peaks(ImSize);
Im_Vertical_Mirror= [Image; flip(Image(:,end-1),2)];
Im_Horiz_Mirror=[Im_Vertical_Mirror; flip(Im_Vertical_Mirror(1:end-1,:),1)];
fft_Im=fft2(Im_Horiz_Mirror);
This code does not achieve the desired solution. I think this is due to the index values which are not distributed symmetrically around zero. Therefore I tried:
fft_Im=fft2(circshift(Im_Horiz_Mirror,[ImSize-1, ImSize-1]));
Which does not achieve the desired solution as well. Imaginary part occure which are not caused by floating point errors, the imaginary parts are quite large.

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by