How can I use the nearest neighbor interpolation and exclude the use of a specific value?

조회 수: 1 (최근 30일)
I would like to interpolate using the "nearest" method.
I have an 2D array that has zeros and non zeros.
I would like the interpolation to select the nearest non-zero value.
I have been looking around the matlab forums and have not been able to find a solution.
  댓글 수: 2
Jon
Jon 2017년 5월 17일
Seems ill-posed. If you have a pixel who has 7 nonzero neighbors (all different values) and only one zero neighbor, which of the 7 pixels do you choose?
Taylor Shropshire
Taylor Shropshire 2017년 5월 18일
Hey Jon,
Thanks for your response.
In the case you described above I would assume that the value would be the average of all 7 non-zero points.
I was thinking this is what the interpolate "nearest" function does if all the points are equally close.

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

답변 (0개)

카테고리

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