How to implement sub-pixel linear interpolation in matlab?
이전 댓글 표시
The problem is quite clear, but I really don't know where to start.
Assuming this is a gray scale image, the black dot(not the rectangle) is the pixel. For example, x0 is a pixel, it has a x-y location (say (70, 82) ) and a gray value. And I have a direction value(say 135 degree) for pixel x0.
I want to do the linear interpolation along the direction from x0, the method is using the two nearest pixels' gray value. For example, I want to get x's value, the two nearest pixels around x is a and b.
I only want to interpolate pixels on the direction line, and either it's x-coordinate value or y-coordinate value is integer, like the red dots on this picture.
I think my function's input should be a gray scale image, start point x0's coordinate location, a direction value, and a range value to limit how many red dot's I want to get, and output should be the interpolated gray scale values for these red dots.
Thanks for your advices.

채택된 답변
추가 답변 (1개)
Alex Taylor
2015년 6월 18일
2 개 추천
Out of curiosity, why not just use interp2 in MATLAB? Just pass in the image and the x,y query points and you are done.
카테고리
도움말 센터 및 File Exchange에서 Interpolation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!