필터 지우기
필터 지우기

HOW TO INTERPOLATE MAT 185X250X3 MATRIX USING CUBIC SPLINE

조회 수: 2 (최근 30일)
Amit Kadam
Amit Kadam 2012년 11월 20일
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