HOW TO INTERPOLATE MAT 185X250X3 MATRIX USING CUBIC SPLINE

2 次查看(过去 30 天)
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.

采纳的回答

Matt J
Matt J 2012-11-20
编辑:Matt J 2012-11-20
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.

更多回答(1 个)

Matt J
Matt J 2012-11-20
编辑:Matt J 2012-11-20
F=griddedInterpolant(MAP,'cubic');
out=F({X,Y,1:3});
  1 个评论
Amit Kadam
Amit Kadam 2012-12-8
thanks Matt It was image processing problem where i was asked to interpolate the intermediate pixels in map.
I learn a lot.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Geometric Transformation and Image Registration 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by