LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fftshift array difference from matlab

i'm trying to convert matlab script into labview using fft block. this is the matlab code i want to convert:

 

>>clear all
>> Img1=imread('quil1.jpg','jpg');
>> a=rgb2gray(Img1);
>> b=fft2(double(a),640,640);
>> c=fftshift(b);

 

i want to find the fft of an image as attach. but the problem is the value return in labview is different from matlab. can anyone help me on how to find fft of an image in labview?

0 Kudos
Message 1 of 5
(3,521 Views)

this is the program in labview

0 Kudos
Message 2 of 5
(3,516 Views)

Different how? I don't have the Image Processing Toolbox, so I can't use the rgb2gray function, so I can't see what the Matlab script generates. How are you doing this in the LabVIEW code?

0 Kudos
Message 3 of 5
(3,501 Views)

here i attach the solution of 2D fftshift in matlab. the array should be in 640x640. But the attach array only show half of the array start from (0,0) and the numerical answer in labview show different answer from matlab..the labview program is as attach previously where i use IMAQ ExtractSingleColorPlane VI to luminance to substitude rgb2gray in matlab. the array show in labview and in matlab are the same.. but when i put fftshift block in labview the array answer is different from matlab. 

0 Kudos
Message 4 of 5
(3,473 Views)

hi
see this vi it's completely match with matlab code.
it's may be useful for you.

 

fft.jpg

0 Kudos
Message 5 of 5
(3,186 Views)