fft2 on grayscale image
Peter von Niederhaeusern
pvonnied at gmail.com
Tue Jul 13 16:42:45 CEST 2010
OK, found out the solution:
What about converting the image to double precision? That did the trick...
But why is this even necessary?
On Wed, Jun 30, 2010 at 5:05 PM, Peter von Niederhaeusern
<pvonnied at gmail.com> wrote:
> Hi,
>
> I'm a bit confused about the fact that I'm not able to fft2 a grayscale image.
> I get the following error:
>
> %%% snippet %%%
>
> // color image, works
> square=imread('square.bmp');
> square_fft2=fftshift(fft2(square,246,247));
>
> // grayscale image, does not work
> square_g=RGB2Gray(square);
> square_fft2=fftshift(fft2(square_g,246,247));
>
> !--error 4
> Undefined variable: x
>
> at line 45 of function fft2 called by :
> square_fft2=fftshift(fft2(square_g,246,247));
>
> %%% snippet %%%
>
> What's the reason/rationale for this error?
>
> Thank you very much for a hint.
>
> Peter
>
More information about the users
mailing list