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!