MATLAB Answers


get familiar with image resampling

Asked by Quang Quac on 13 Aug 2018
Latest activity Commented on by Rik
on 14 Aug 2018
I have 2 images:
- DEM (Digital Elevation Model): spatial resolution 40x40m, represents of an area between (284500E, 2800260N) and (309180E, 2758620N). link:
- TPE: spatial resolution 10x10m, upper left corner coordinate is (284511.25E, 2800238.75N)). link:
I have 4 requirements following:
1. Covers the intersected area of DEM.tif and TPE.jpg
2. With a spatial resolution of 20 meter (i.e. each pixel represents 20m by 20m)
3. The first three channels of the image have the Red, Green and Blue values obtained from TPE.jpg
4. The fourth channel stores the elevation calculated from DEM.tif
For step 3 and 4, I want to implement both "Nearest Neighbor" and "Bi-Linear" interpolation.
Anybody can help me answer and write code.


Maybe griddedinterpolant would be a good choice to try here.
I already read the link you send but I still not understand something. Can you explain to me?
What is it specifically you don't understand?
An image can be thought of as a function x and y, that is essentially the underlying assumption when you resample an image. You happen to have the coordinates of both images you're trying to match, so that means you can use those to have an explicit interpolation using those coordinates. Functions like griddedinterpolant do exactly that.

Sign in to comment.

0 Answers