Azzera filtri
Azzera filtri

HOW TO INTERPOLATE MAT 185X250X3 MATRIX USING CUBIC SPLINE

2 visualizzazioni (ultimi 30 giorni)
Map provides a 185 x 250 x 3 matrix Map representing an image and “image coordinates” xi and yi. interpolation coordinates 5 < x < 180 and 5 < y < 245, both evenly spaced with spacing 0.1. Interpolate each of the 3 blocks of size 185 x 250 of the matrix Map first in one direction, then the other, to produce a 1751 x 2401 x 3 matrix InterpolatedMap. Set any values larger than 1 to 1, and any less than 0 to 0. Use the image command to compare the original image Map to the image in InterpolatedMap.
I have generated code MyCubicInterpolation which works in following way, xi = linspace(-1,1,150); zi = sin((pi.*xi)/2);
x = linspace(-1,1,200);
y = MyCubicSpline(xi,zi,x);
Now I dont understand my which one will be my 1st direction and which one my second direction, should I select entire block Map(:,:,1) out of three. In short I can not understand next steps.

Risposta accettata

Matt J
Matt J il 20 Nov 2012
Modificato: Matt J il 20 Nov 2012
It sounds like you're to first interpolate along x to produce an array of size 1751 x 250 x 3 and then interpolate that intermediate result along y to obtain an array of size 1751 x 2401 x 3. Or you can interpolate first along y and then along x. The order won't affect the result.
If you're not sure how to interpret the homework question though, the most reliable person to ask is the one who assigned it to you.

Più risposte (1)

Matt J
Matt J il 20 Nov 2012
Modificato: Matt J il 20 Nov 2012
F=griddedInterpolant(MAP,'cubic');
out=F({X,Y,1:3});
  1 Commento
Amit Kadam
Amit Kadam il 8 Dic 2012
thanks Matt It was image processing problem where i was asked to interpolate the intermediate pixels in map.
I learn a lot.

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by