How to generate a real valued spectrum of a image?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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.
0 Kommentare
Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!