0

I want to implement the adaptive bilinear interpolation method for image upsampling given in this paper. But I am stuck on a very basic question.

imresize() in Matlab performs bilinear interpolation by taking a weighted average of pixels in the nearest 2x2 neighborhood.

I want to know how does Matlab determine this 2x2 neighborhood for the boundary pixels?

What I really want to know is how shall I determine the neighborhood for the boundary pixels in the attached paper, since each boundary will have no neighborhood in at least 1 direction, for example, the topmost row won't have any row for determining any vertical upper mask, the leftmost column won't have any column for determining any horizontal mask, and so on.

I gave the Matlab example to get an intuition about how boundary cases are solved by languages in such algorithms.

Nancy
  • 315
  • 1
  • 5
  • 16
  • Why do you think there is any boundary? My guess is that, for example, the top-left corner of the interpolated image is an interpolation of the pixels `(1,1), (1,2), (2,1) and (2,2)`. In other words, in your initial image is of size `NxN`, your interpolated image will be of size `N-1xN-1` – BillBokeey May 23 '16 at 11:29

1 Answers1

0

The "2x2" neighbourhood that you mentioned are the actually the intensity at the corners. So you are going to interpolate within this 2x2 intensity values.

To best understand, try doing the following and then you will see the output:

I=[1 2; 100 200]
imresize(I,2, 'bilinear')

Notice that for 'bilinear' interpolation the four corners are the same, unlike the default 'bicubic'. Hope that helps.

Bala
  • 66
  • 1