1

Take a look at the following diagrams:

The original picture:

Original image

The upscaled (2x, bilinear) picture:

enter image description here

In both cases the first item in the first row is the input image. There is its 2d fft next to it. Below it there is a downscaled version of the image and its 2d fft. Notice the difference in spectrum amplitude in both cases. While in the first case nothing changes, in the second the spectrum actually gets better (it was weak in the first place)—I mean there is more "weight" put in the corners.

Is it some sort of well-known property? Should I expect the upscaled image to be crisper when downscaling it?

2
  • Is fft supposed to be something generally known? I've never heard that term in photography.
    – dpollitt
    Mar 1 '15 at 17:40
  • fast fourier transform. i suppose this would be better suited for graphics.stackexchange.com
    – ths
    Mar 1 '15 at 17:49
2

In both cases the blur will be reduced, it's just that in the second case you can see that effect more clearly from the powerspectrum in k-space. In general, when you are downscaling, you will not only reduce the blur, you will also lose small details (because you keep the pixel size the same, anything that becomes smaller than one pixel will vanish from view, being absorbed in the grey value of that pixel). So, you are not just rescaling, you are also averaging over the smallest details.

If you were only rescaling, then the width of the powerspectrum would increase correspondingly. Now, that's exactly what happens in the case of the picture obtained by first upscaling the image, as you are then not putting in new details at the smallest scale.

5
  • Thank you for your detailed explanation! So is there a way to get use of this phenomenon to determine if a picture was resized or not? I mean this gives pretty good results if I use an original picture as the input and the upscaled version of it. What bothers me is that those two pictures are not of same size. If I first enlarge the photo and then shrink it the algorithm doesn't work anymore. Or maybe I should use some Difference of Gaussians, Entropy or something else...? I'm stuck.
    – kboom
    Mar 1 '15 at 19:25
  • You could compute the correlation function between neighboring pixels. You can do that directly, you can also extract these from the powerspectrum. The Fourier transform of the powerspectrum gives you the auto-correlation function. Then, if the image was upscaled via interpolation then you should find strong correlations between nearby pixels. Note that all pictures are upscaled due to the demosaicing, this causes the nearest and next nearest neighbors to be correlated. But at a distance of two pixels the correlation should be very small unless more upscaling was done. Mar 1 '15 at 19:44
  • That sounds great! But is there a way to do this more relative? I mean independent of picture size and type. Ideally, this value should be negative for non-scaled and positive for scaled. My current approach was based on a simple fact, that in the upscaled picture there are less higher frequencies in the spectrum... but if the pixels are corelated this is kind of similar, yeah? How this is better than just analyzing the spectrum? I mean I hope it is, but I'd like to be sure :). This technique would need to be different for each scaling type (bilinear, nearest, lanczos and so on)?
    – kboom
    Mar 1 '15 at 20:32
  • The theoretical spectrum when you start with white noise (which has uniform power spectrum) and then apply the upscaling using some given interpolation method should be easy to compute. I can look into this... Mar 2 '15 at 14:06
  • Starting with white noise is a very good idea! I mean any changes in the spectrum after resizing the picture should be clearly visible. I will also try it out.
    – kboom
    Mar 2 '15 at 16:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.