Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Spline smoothing in images

Subject: Spline smoothing in images

From: sudesh

Date: 8 Feb, 2013 13:41:07

Message: 1 of 3

Can anyone guide me how we use splines for interpolation in images?
I mean how we relate value of x,y of spline function in an image that has its spatial coordinates and intensity values.

Subject: Spline smoothing in images

From: Bruno Luong

Date: 8 Feb, 2013 14:09:09

Message: 2 of 3

"sudesh" wrote in message <kf2v9j$8l3$1@newscl01ah.mathworks.com>...
> Can anyone guide me how we use splines for interpolation in images?
> I mean how we relate value of x,y of spline function in an image that has its spatial coordinates and intensity values.

Straightforward use of INTERP2.

A=peaks(10);

[m n] = size(A);
x = 1:n;
y = 1:m;
xi = linspace(1,n,100);
yi = linspace(1,m,100);
Ai = interp2(x, y', A, xi, yi', 'spline');

subplot(1,2,1); surf(A);
subplot(1,2,2); surf(Ai);

% Bruno

Subject: Spline smoothing in images

From: sudesh

Date: 8 Feb, 2013 16:26:08

Message: 3 of 3

Thanks Bruno..
Now I got the point. here x and y are vector of row/column of Image.
If I need to apply spline smoothing on a 3X3 local window of image then in that case if I take only non noisy pixels of image(for example pixels apart from 0 and 255 in that window) then x and y would be coordinates of those pixels? and after interpolation using those pixels only I can get the interpolated value at noisy coordinates? Is that so?
Can you point me to any link that is related to splines in this context?
I have tried searching for this but failed to find something related to this in MATLAB.
Again thanks for your reply.

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <kf30u4$ep0$1@newscl01ah.mathworks.com>...
> "sudesh" wrote in message <kf2v9j$8l3$1@newscl01ah.mathworks.com>...
> > Can anyone guide me how we use splines for interpolation in images?
> > I mean how we relate value of x,y of spline function in an image that has its spatial coordinates and intensity values.
>
> Straightforward use of INTERP2.
>
> A=peaks(10);
>
> [m n] = size(A);
> x = 1:n;
> y = 1:m;
> xi = linspace(1,n,100);
> yi = linspace(1,m,100);
> Ai = interp2(x, y', A, xi, yi', 'spline');
>
> subplot(1,2,1); surf(A);
> subplot(1,2,2); surf(Ai);
>
> % Bruno

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us