MATLAB Answers

How it works : Bilinear interpolation for image resizing

45 views (last 30 days)
Binny on 2 Sep 2019
Commented: 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!


Show 3 older comments
Jan on 3 Sep 2019
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.
Rik on 3 Sep 2019
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.

Answers (1)

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.


Sign in to comment.