I am trying to perform FFT on the boundary coordinates of a binary image, trimming off x% of the fourier descriptors and then performing IFFT to recover the image. However my image is very much distorted and does not resemble the original image at all (I was told that it is possible to recreate the image quite accurately even after trimming). I have included my code below, much help would be appreciated.
boundary_complex = boundary(:,1) + i*boundary(:,2);
boundary_freq = fft(boundary_complex);
n = round(usedPercent*length(boundary_freq));
trim_boundary_freq = boundary_freq(1:n);
IFF = ifft(trim_boundary_freq);