Hacker News new | past | comments | ask | show | jobs | submit login

This approach will inherently have the ringing; FFT is really not meant for local features. STFT may be a more interesting approach.

Anyhow, I ran something like the following in Matlab for testing upsampling 4 pixels to 8 pixels:

  fft_mx = fft( eye(4) ); #forward FFT transform matrix
  fft_mx = padarray( fft_mx, [2 0], 0, 'both' ); #pads result vector with zeroes
  fft_iv = ifft( eye(8) ); #inverse FFT matrix
  abs( fft_iv * fft_mx ) * 2
The result is:

    1.0000         0         0         0
    0.6533    0.6533    0.2706    0.2706
         0    1.0000         0         0
    0.2706    0.6533    0.6533    0.2706
         0         0    1.0000         0
    0.2706    0.2706    0.6533    0.6533
         0         0         0    1.0000
    0.6533    0.2706    0.2706    0.6533
Basically, your idea (which boils down to an FIR scaler) samples the entire image when resampling. That isn't a very good behavior, IMHO.

EDIT: fixed math




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: