image thumbnail

Bilinear interpolation of an image or matrix

version (3.28 KB) by Disi A
This function performs bilinear interpolation for a given image or matrix at any location


Updated 17 Jun 2016

View License

This function uses biLinear interpolation and looks at 4 pixels around the target location with ceil convention.
--RGB = 1 for gray scale images.
--img can be a single layer matrix or a RGB layer colored image
--yx =[y_value, x_value]; It can be either horizontal or vertical vector
--zpad is a boolean variable. if true, zeros are used for pixel values outside of the given img. If false, the nearest edge value is repeated.
--> 2 3 4
3 4 5
4 5 6
--> 4.6
Disi A

Cite As

Disi A (2021). Bilinear interpolation of an image or matrix (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!