Interpolation in an image at specific query points

I am trying to interpolate an image of size 120x160 at specific query points. say R = [ r1,r2,r3,....rn]; C = [ c1,c2,c3,....cn]. I would like to interpolate the values at (r1,c1), (r2,c2)...(rn,cn) from the original image. I see that interp2, griddata,scatteredInterpolant, griddedInterpolant, seem to need a meshgrid of query points. Is there a way to estimate the interpolation at just these point (r,c)? If not, how do I convert such scattered points into a meshgrid?

 Respuesta aceptada

KSSV
KSSV el 19 de Abr. de 2017
Editada: KSSV el 19 de Abr. de 2017
load clown ;
imagesc(X);
colormap gray ;
[nx,ny] = size(X) ;
r = 1:ny ;
c = 1:nx ;
[R,C] = meshgrid(r,c) ;
%%do interpolation
Ri = 5 ; Ci = 5 ;
Xi1 = interp2(R,C,X,Ri,Ci) ;
% or can be used without mesh grid like below
Xi2 = interp2(r,c,X,Ri,Ci) ;

Más respuestas (0)

Categorías

Más información sobre Interpolation en Centro de ayuda y File Exchange.

Preguntada:

el 19 de Abr. de 2017

Comentada:

el 19 de Abr. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by