Bilinear interpolation of an image or matrix
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.
Example:
[m,n]=meshgrid(1:3);img=[m+n]
--> 2 3 4
3 4 5
4 5 6
interpImg(img,[2.4,2.2])
--> 4.6
Disi A
adis@mit.edu
Cite As
Disi A (2024). Bilinear interpolation of an image or matrix (https://www.mathworks.com/matlabcentral/fileexchange/43533-bilinear-interpolation-of-an-image-or-matrix), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.