MATLAB Answers

Binny
0

How it works : Bilinear interpolation for image resizing

Asked by Binny
on 2 Sep 2019
Latest activity Commented on by Rik
on 3 Sep 2019
How image resizing bilinear interpolation works in matlab? What neighborhood it considers? How it measures distance between pixel and its neighbors? Exactly which kernel and which equations it follows? Thanks in advance!

  6 Comments

All right, thanks for your prompt reply! 👍
At least in R2009b there have been M-fucntions for imresize and even the C-codes e.g. for the Lanczos method.
@Rik: What is the problem with "neighborhood"? The documentations say:
Bilinear interpolation; the output pixel value is a weighted average
of pixels in the nearest 2-by-2 neighborhood
As far as I understand, this interpolation uses the value of a pixel, if it exists exactly in the input, but for all other cases, there are 2x2 surrounding pixels in the input for each pixel in the output, which are used for the interpolation. Sounds like a 2x2 neighborhood.
My problem with the term neighborhood is probably that I tend to use it in the context of integer positions. It does make sort of sense to extend it this way, so maybe it is just the fact that I have never heard the term be used this way.
My main contact with the term is in the context of region growing and moving window operations.

Sign in to comment.

1 Answer

Answer by Jan
on 3 Sep 2019

According the the documentation:
"the output pixel value is a weighted average of pixels in the nearest 2-by-2 neighborhood"
The only detail, which is not explained, it the weighting factors. But according to the standard definition, the distances are used for weighting.

  0 Comments

Sign in to comment.