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:
smoothing

Subject: smoothing

From: Mathew Thomas

Date: 22 Nov, 2009 06:45:05

Message: 1 of 7

Hey all..

I have coordinate points for an image. I know the general shape I get if I connect the points is a parabola. Can anyone tell me how to smooth the curve out (since the number of points are less). I tried using SPLINE...didnt work...Any other methods????

Thanks for any help in advance...

Matt

Subject: smoothing

From: Jan Simon

Date: 22 Nov, 2009 11:49:02

Message: 2 of 7

Dear Mathew!

> I have coordinate points for an image. I know the general shape I get if I connect the points is a parabola. Can anyone tell me how to smooth the curve out (since the number of points are less). I tried using SPLINE...didnt work...Any other methods????

Please define "smooth" and "didn't work".
Jan

Subject: smoothing

From: Miroslav Balda

Date: 22 Nov, 2009 11:50:05

Message: 3 of 7

"Mathew Thomas" <mathew99@gmail.com> wrote in message <heamlh$81c$1@fred.mathworks.com>...
> Hey all..
>
> I have coordinate points for an image. I know the general shape I get if I connect the points is a parabola. Can anyone tell me how to smooth the curve out (since the number of points are less). I tried using SPLINE...didnt work...Any other methods????
>
> Thanks for any help in advance...
>
> Matt

Hi Matt.

If I understand your question well, your problem is rather simple. The equation of (quadratic) parabola is f(x) = c1*x^2 +c2*x + c3. I should be an approximation of measured points y(x). The unknowns coefficients of f(x) may be obtained by the following code:

x = x(:);
c = [x.^2, x, ones(size(x))] \ y(:);

Hope it helps.
Mira

Subject: smoothing

From: Matt

Date: 22 Nov, 2009 14:17:03

Message: 4 of 7

"Miroslav Balda" <miroslav.nospam@balda.cz> wrote in message <heb8hd$p9j$1@fred.mathworks.com>...
> "Mathew Thomas" <mathew99@gmail.com> wrote in message <heamlh$81c$1@fred.mathworks.com>...
> > Hey all..
> >
> > I have coordinate points for an image. I know the general shape I get if I connect the points is a parabola. Can anyone tell me how to smooth the curve out (since the number of points are less). I tried using SPLINE...didnt work...Any other methods????
> >
> > Thanks for any help in advance...
> >
> > Matt
>
> Hi Matt.
>
> If I understand your question well, your problem is rather simple. The equation of (quadratic) parabola is f(x) = c1*x^2 +c2*x + c3. I should be an approximation of measured points y(x). The unknowns coefficients of f(x) may be obtained by the following code:
>
> x = x(:);
> c = [x.^2, x, ones(size(x))] \ y(:);

Or by using

c=polyfit(x,y,2);

which has some beefed up measures to handle numerical issues.

Subject: smoothing

From: Mathew Thomas

Date: 22 Nov, 2009 15:19:02

Message: 5 of 7

"Miroslav Balda" <miroslav.nospam@balda.cz> wrote in message <heb8hd$p9j$1@fred.mathworks.com>...
> "Mathew Thomas" <mathew99@gmail.com> wrote in message <heamlh$81c$1@fred.mathworks.com>...
> > Hey all..
> >
> > I have coordinate points for an image. I know the general shape I get if I connect the points is a parabola. Can anyone tell me how to smooth the curve out (since the number of points are less). I tried using SPLINE...didnt work...Any other methods????
> >
> > Thanks for any help in advance...
> >
> > Matt
>
> Hi Matt.
>
> If I understand your question well, your problem is rather simple. The equation of (quadratic) parabola is f(x) = c1*x^2 +c2*x + c3. I should be an approximation of measured points y(x). The unknowns coefficients of f(x) may be obtained by the following code:
>
> x = x(:);
> c = [x.^2, x, ones(size(x))] \ y(:);
>
> Hope it helps.
> Mira

Thank you soo much...About to try it out right now...

Subject: smoothing

From: Mathew Thomas

Date: 22 Nov, 2009 15:22:04

Message: 6 of 7

"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <heb8fd$l8t$1@fred.mathworks.com>...
> Dear Mathew!
>
> > I have coordinate points for an image. I know the general shape I get if I connect the points is a parabola. Can anyone tell me how to smooth the curve out (since the number of points are less). I tried using SPLINE...didnt work...Any other methods????
>
> Please define "smooth" and "didn't work".
> Jan

Hey Jan,

I meant the points are being connected as a straight line...and I want it curved...When all the points are connected, it should more or less have a parabolic shape...

Thanks.

Subject: smoothing

From: Jan Simon

Date: 22 Nov, 2009 19:32:06

Message: 7 of 7

Dear Mathew!

> I meant the points are being connected as a straight line...and I want it curved...When all the points are connected, it should more or less have a parabolic shape...

With the above mentioned POLYFIT, you can get even an exact parabolic shape.

Good luck, Jan

Tags for this Thread

No tags are associated with 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