0

So I have implemented the bi-linear interpolation as in wiki,and other sources where they use the fraction of distance from the neighboring pixels to compute their contributions. My two issues are:

  1. my results don't tally with the matlab implementation of resize that uses bi-linear interpolation
  2. I expand the original image I_org to generate I_expanded with scale s, the I expand I_expanded with scale 1/s to generate I_shrunk. The issue is I_org and I_shrunk are always invariably the exact same, I was expecting at least some pixels to differ.

link to source

original

expanded

shrunk

now original image and shrunk image are always same, I was expecting that due to the expanding and shrinking the shrunk image will slightly different from original.

My implementation in based on slide 96 , slide 96

idexi
  • 109
  • 8

1 Answers1

2

If you Increase and decrease the resolution in powers of 2 (x2 x4 x8 ...) then, most likely you will get the same image. This is because you are effectively doing pyramidal-like scaling (note that the real pyramidal scaling has a blurring step before re-sampling)

Try, instead of doing x4 scaling (as in the posted images), to perform a 3.5 scale (or any other non power of two scale). Then Most likely you'll get different results.

Ander Biguri
  • 35,140
  • 11
  • 74
  • 120
  • you are spot on, could you direct me to some link, where I can understand this in more details? – idexi Aug 27 '15 at 12:22