Interpolation problem with interp2

조회 수: 12 (최근 30일)
D.
D. 2011년 5월 27일
댓글: Walter Roberson 2016년 10월 13일
Hi everyone!
I did some computations on a grayscale picture and I would like to interpolate some points in my matrix. My problem is that interp2 doesn't allow to do what I want to.
Let's say my matrix is im
im = [1 2 3; 4 nan 6; 7 8 9];
and when I do:
[colum row] = meshgrid(1:3,1:3);
colum_i = 2;
row_i = 2;
zi = interp2(colum, row, im, colum_i, row_i);
I would like that it interpoles the nan. Is there a way to redefine a point in the matrix instead of a point between the points of the matrix?
My picture is a 512x512 pixels and interp2 would be very useful and fast instead of computing for every point separately...
Thank you for yours answers.
Regards, D.

채택된 답변

Walter Roberson
Walter Roberson 2011년 5월 27일
I suggest you consider John d'Errico's MATLAB File Exchange contribution inpaint_nans
  댓글 수: 1
Jan
Jan 2011년 5월 27일
Walter, you are typing faster than me - yesterday, today and tomorrow. It would increase the efficiency of my work, if a small icon appears in the question to show, that you are reading it currently - and will have answered it some seconds later.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Jan
Jan 2011년 5월 27일
There are many tools for this task in the FEX: FEX:interpolate+nan
  댓글 수: 2
jothi lakshmi maniyan
jothi lakshmi maniyan 2016년 10월 13일
hi i need bicubic interpolation matlab code fully pl help
Walter Roberson
Walter Roberson 2016년 10월 13일
https://www.mathworks.com/matlabcentral/fileexchange/20342-image-interpolation--ba-interp2-

댓글을 달려면 로그인하십시오.


D.
D. 2011년 5월 27일
Thank you guys very much for your help...!
Regards, D.

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by