为什么当我在 matlab 中对图像进行傅立叶变换时图像会旋转
why image is rotated when i get Fourier transform of image in matlab
我使用 MatLab 处理图像。
我对图像执行以下步骤:
- 我做一个图片读取。
- 我对图像进行傅里叶运算
- 我取傅立叶变换图像的实数。
在执行上述步骤时,我得到了双重旋转的图像。我不知道为什么会这样。
谁能解释一下为什么会产生双旋转图像的原因?
这段代码在这里:
imfftreal = real(imfft);
im = uint8(ifft2(imfftreal));
imshow(im);
Figure;
为了得到正确的图像,你还需要虚部。您在进行逆变换时只使用了实部。
imfftReal = real(imfft);
imfftImag = imag(imfft);
re_imfft=imfftReal +1i*imfftImag;
im = uint8(ifft2(re_imfft));
imshow(im);
在幅度和相位的情况下
imfftMagnitude = abs(imfft);
imfftPhase = angle(imfft);
re_imfft=imfftMagnitude.*exp(1i*imfftPhase);
im = uint8(ifft2(re_imfft));
imshow(im);
我恰好遇到了同样的问题,并在两天前将其发布在 DSP StackExchange 上。
@M529 给出了一个非常好的和简单的解释:
If you have a data set which is purely real, its (inverse) Fourier transform will have Hermitian symmetry: If you find the value z at position (x,y), then you will find the complex conjugate value z∗ at the point-reflected position (−x,−y) about the origin. Note that the origin here would be the center of Fourier-space. This can be reformulated, of course, if the DC component is not in the center of your FFT implementation. And this is what you see in your image: A point-reflected version is overlaying the true image - because you forced one space to be real valued.
This property is actually being used for accelerating magnetic
resonance imaging (MRI) in some cases: MRI acquires the data directly
in Fourier-space. Since an ideal MR image can be described by real
values only (all excited magnetization vectors have phase 0), you only
have to acquire half of the data space, which saves you half of the
imaging time. Of course, MR images are not completely real valued due
to the limiations of reality... but with a few tricks you can still
use this technique advantageously.
如果你想看背后的数学,你可以通过@ThP there: https://dsp.stackexchange.com/questions/30770/why-real-part-of-fft-converts-image-into-rotation-original/30774#30774
找到详细的答案
我使用 MatLab 处理图像。
我对图像执行以下步骤:
- 我做一个图片读取。
- 我对图像进行傅里叶运算
- 我取傅立叶变换图像的实数。
在执行上述步骤时,我得到了双重旋转的图像。我不知道为什么会这样。
谁能解释一下为什么会产生双旋转图像的原因?
这段代码在这里:
imfftreal = real(imfft);
im = uint8(ifft2(imfftreal));
imshow(im);
Figure;
为了得到正确的图像,你还需要虚部。您在进行逆变换时只使用了实部。
imfftReal = real(imfft);
imfftImag = imag(imfft);
re_imfft=imfftReal +1i*imfftImag;
im = uint8(ifft2(re_imfft));
imshow(im);
在幅度和相位的情况下
imfftMagnitude = abs(imfft);
imfftPhase = angle(imfft);
re_imfft=imfftMagnitude.*exp(1i*imfftPhase);
im = uint8(ifft2(re_imfft));
imshow(im);
我恰好遇到了同样的问题,并在两天前将其发布在 DSP StackExchange 上。
@M529 给出了一个非常好的和简单的解释:
If you have a data set which is purely real, its (inverse) Fourier transform will have Hermitian symmetry: If you find the value z at position (x,y), then you will find the complex conjugate value z∗ at the point-reflected position (−x,−y) about the origin. Note that the origin here would be the center of Fourier-space. This can be reformulated, of course, if the DC component is not in the center of your FFT implementation. And this is what you see in your image: A point-reflected version is overlaying the true image - because you forced one space to be real valued.
This property is actually being used for accelerating magnetic resonance imaging (MRI) in some cases: MRI acquires the data directly in Fourier-space. Since an ideal MR image can be described by real values only (all excited magnetization vectors have phase 0), you only have to acquire half of the data space, which saves you half of the imaging time. Of course, MR images are not completely real valued due to the limiations of reality... but with a few tricks you can still use this technique advantageously.
如果你想看背后的数学,你可以通过@ThP there: https://dsp.stackexchange.com/questions/30770/why-real-part-of-fft-converts-image-into-rotation-original/30774#30774
找到详细的答案