How to implement sub-pixel linear interpolation in matlab?
Afficher commentaires plus anciens
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.

Réponse acceptée
Plus de réponses (1)
Alex Taylor
le 18 Juin 2015
2 votes
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.
Catégories
En savoir plus sur Interpolation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!