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:
Fitting point cloud in 3d

Subject: Fitting point cloud in 3d

From: Johannes Korsawe

Date: 19 Oct, 2007 13:30:45

Message: 1 of 8

Hi out there,

thanks for all help i received through this newsgroup.

Here is another problem:

Let p (size(p)=[n 3]) be a point cloud in 3d. I know, that
p roughly corresponds to a circular profilewhich is
extruded along some curved line (mid-line) in 3d (with
differing radii along the line). But now, i simply have the
rare point cloud.

The question is: Is there a simple and robust way, to get a
polynomial representation of the midline (or of "a"
midline, as the data may be polluted by some noise)?

Best regards,
Johannes Korsawe

Subject: Fitting point cloud in 3d

From: John D'Errico

Date: 19 Oct, 2007 14:02:25

Message: 2 of 8

"Johannes Korsawe" <johannes.korsawe.nospam@volkswagen.de> wrote in
message <ffabi5$ghn$1@fred.mathworks.com>...
> Hi out there,
>
> thanks for all help i received through this newsgroup.
>
> Here is another problem:
>
> Let p (size(p)=[n 3]) be a point cloud in 3d. I know, that
> p roughly corresponds to a circular profilewhich is
> extruded along some curved line (mid-line) in 3d (with
> differing radii along the line). But now, i simply have the
> rare point cloud.
>
> The question is: Is there a simple and robust way, to get a
> polynomial representation of the midline (or of "a"
> midline, as the data may be polluted by some noise)?

This can be done simply using PCA, or at
the core, by use of svd. Its available on the
FEX though. I think there is another one too
from a year or so ago.

http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?
objectId=16800&objectType=file

HTH,
John

Subject: Fitting point cloud in 3d

From: Peter Perkins

Date: 19 Oct, 2007 17:27:44

Message: 3 of 8

Johannes Korsawe wrote:
> The question is: Is there a simple and robust way, to get a
> polynomial representation of the midline (or of "a"
> midline, as the data may be polluted by some noise)?

If you have access to the Statistics Toolbox, see

<http://www.mathworks.com/products/statistics/demos.html?file=/products/demos/shipping/stats/orthoregdemo.html>

Subject: Fitting point cloud in 3d

From: Johannes Korsawe

Date: 22 Oct, 2007 06:56:46

Message: 4 of 8

Hi there,

the problem is, that the midline, i am looking for, is
highly nonlinear, so PCA won't help me so much.

On my way through the weekend i thought about the following:

1st: Identify midpoints of the start of the cloud and at
the end of the cloud.

2nd: Fit a polynomial of e.g. third order in 3d to the
cloud. One may be able to do this via Nelder-Mead-Simplex,
while i do not know, if the problem is well posed.
Otherwise, i need to identify the direction at beginning
and end of the midline also and define my polynomial by
these values.

3rd: Evaluate the polynomial in between the beginning and
endpoint for a number of e.g. 20 midpoints.

4th: Begin iteration:

        a. construct a plane through each of the inner
midpoints with the normal according to the middle line, "as
it is in the moment".
        b. find the most neighboring points in the
neighborhood of this plane , project them onto and fit a
circle to this data.
        c. use the midpoint of the circle as an update for
the current middlepoint.

5th: Do this iteration as long till it converges
(hopefully).


Does anyone have a better idea?

Best regards,
Johannes Korsae

Subject: Fitting point cloud in 3d

From: John D'Errico

Date: 22 Oct, 2007 09:00:59

Message: 5 of 8

"Johannes Korsawe" <johannes.korsawe.nospam@volkswagen.de> wrote in
message <ffhhje$f50$1@fred.mathworks.com>...
> Hi there,
>
> the problem is, that the midline, i am looking for, is
> highly nonlinear, so PCA won't help me so much.

Dp you think you might have said that the
first time? Is this not an important feature of
the problem? Sigh.


> On my way through the weekend i thought about the following:
>
> 1st: Identify midpoints of the start of the cloud and at
> the end of the cloud.

(snip)

> 5th: Do this iteration as long till it converges
> (hopefully).

Sorry, but I don't have high hopes for this.

 
> Does anyone have a better idea?

Much would seem to depend on the relative
magnitude of the noise. But if you expect to
do anything with this given a "highly nonlinear"
relationship, then the noise had better be darn
small.

Perhaps use k-means to reduce the cloud to
a sequence of centers. Then run a spline in
cumulative arc length through, interpolating
this sequence.

http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?
objectId=12247&objectType=FILE

John

Subject: Fitting point cloud in 3d

From: Johannes Korsawe

Date: 22 Oct, 2007 09:28:07

Message: 6 of 8

> Dp you think you might have said that the
> first time? Is this not an important feature of
> the problem? Sigh.

I thought that "curved line" and the wish for
some "polynomial" interpolation was enough hint, that i am
not talking about linear regression. I might also sigh here?

>
> > 5th: Do this iteration as long till it converges
> > (hopefully).
>
> Sorry, but I don't have high hopes for this.

Well, you are perfectly right for any arbitrary sort of
problem. My point clouds are coming from a laser optical
measurement of a pipe. The clouds are pretty along the pipe
(so much for noise, it will remain pretty small), but the
pipe itself nearly may be represented by a polynomial
(other people do this in their articles, while i prefer to
simulate this with physics inside). But the approximation
by polynomials is not too bad. So i had the hope, it would
be good enough for my problem. "Highly nonlinear" means, i
need third and fourth order polynomials for approximation.

The problem is, that the "slices" of the point cloud along
the pipe sometimes nearly become lines, and then the circle
fitting does not work too well.

> Perhaps use k-means to reduce the cloud to
> a sequence of centers. Then run a spline in
> cumulative arc length through, interpolating
> this sequence.

I will try this also. Thanks,

Johannes

Subject: Fitting point cloud in 3d

From: Peter Perkins

Date: 22 Oct, 2007 14:23:01

Message: 7 of 8

Johannes Korsawe wrote:
> Hi there,
>
> the problem is, that the midline, i am looking for, is
> highly nonlinear, so PCA won't help me so much.

Johannes, you're right, I missed the word "curved".

There is a free Total Least Squares MATLAB toolbox out there, and I seem
to remember that it would do what you want, but I am having trouble
putting my finger on it at the moment. The best I can do is

<ftp://ftp.esat.kuleuven.ac.be/sista/markovsky/abstracts/04-220.html>

which I think is the right people, but the description is not what I
remember seeing.

Subject: Fitting point cloud in 3d

From: radia

Date: 5 Apr, 2013 08:19:06

Message: 8 of 8

"John D'Errico" <woodchips@rochester.rr.com> wrote in message <ffaddh$h6m$1@fred.mathworks.com>...
> "Johannes Korsawe" <johannes.korsawe.nospam@volkswagen.de> wrote in
> message <ffabi5$ghn$1@fred.mathworks.com>...
> > Hi out there,
> >
> > thanks for all help i received through this newsgroup.
> >
> > Here is another problem:
> >
> > Let p (size(p)=[n 3]) be a point cloud in 3d. I know, that
> > p roughly corresponds to a circular profilewhich is
> > extruded along some curved line (mid-line) in 3d (with
> > differing radii along the line). But now, i simply have the
> > rare point cloud.
> >
> > The question is: Is there a simple and robust way, to get a
> > polynomial representation of the midline (or of "a"
> > midline, as the data may be polluted by some noise)?
>
> This can be done simply using PCA, or at
> the core, by use of svd. Its available on the
> FEX though. I think there is another one too
> from a year or so ago.
>
> http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?
> objectId=16800&objectType=file
>
> HTH,
> John
please i need your help, actually i dot my project
in fact I have a table that contains the values ??of voltage (V) , the frequency (f) and the power here is the table:

300,000000 -50,000000 0,039079
300,000000 -49,000000 0,031420
300,000000 -48,000000 0,031420
300,000000 -47,000000 0,033973
300,000000 -46,000000 0,044185
300,000000 -45,000000 0,041632
300,000000 -44,000000 0,049291
300,000000 -43,000000 0,044185
300,000000 -42,000000 0,039079
300,000000 -41,000000 0,033973
300,000000 -40,000000 0,166725
300,000000 -39,000000 0,263737
300,000000 -38,000000 0,286713
300,000000 -37,000000 0,337772
300,000000 -36,000000 0,373513
300,000000 -35,000000 0,401595
300,000000 -34,000000 0,434783
300,000000 -33,000000 0,478183
300,000000 -32,000000 0,539453
300,000000 -31,000000 0,577747
300,000000 -30,000000 0,621147
300,000000 -29,000000 0,679864
300,000000 -28,000000 0,710499
300,000000 -27,000000 0,761558
300,000000 -26,000000 0,815169
300,000000 -25,000000 0,843251
300,000000 -24,000000 0,894310
300,000000 -23,000000 0,960686
300,000000 -22,000000 1,009192
300,000000 -21,000000 1,060250
300,000000 -20,000000 1,108756
300,000000 -19,000000 1,175132
300,000000 -18,000000 1,213426
300,000000 -17,000000 1,264485
300,000000 -16,000000 1,318096
300,000000 -15,000000 1,376814
300,000000 -14,000000 1,425319
300,000000 -13,000000 1,478931
300,000000 -12,000000 1,524884
300,000000 -11,000000 1,596366
300,000000 -10,000000 1,634659
300,000000 -9,000000 1,683165
300,000000 -8,000000 1,731671
300,000000 -7,000000 1,792941
300,000000 -6,000000 1,841447
300,000000 -5,000000 1,905270
300,000000 -4,000000 1,953776
300,000000 -3,000000 2,002281
300,000000 -2,000000 2,050787
300,000000 -1,000000 2,106951
300,000000 0,000000 2,150351
550,000000 -50,000000 0,039079
550,000000 -49,000000 0,044185
550,000000 -48,000000 0,039079
550,000000 -47,000000 0,036526
550,000000 -46,000000 0,041632
550,000000 -45,000000 0,036526
550,000000 -44,000000 0,049291
550,000000 -43,000000 0,033973
550,000000 -42,000000 0,046738
550,000000 -41,000000 0,028867
550,000000 -40,000000 0,041632
550,000000 -39,000000 0,225443
550,000000 -38,000000 0,279054
550,000000 -37,000000 0,335219
550,000000 -36,000000 0,365854
550,000000 -35,000000 0,406701
550,000000 -34,000000 0,437336
550,000000 -33,000000 0,475630
550,000000 -32,000000 0,508818
550,000000 -31,000000 0,549665
550,000000 -30,000000 0,603276
550,000000 -29,000000 0,646676
550,000000 -28,000000 0,713052
550,000000 -27,000000 0,738581
550,000000 -26,000000 0,792193
550,000000 -25,000000 0,838146
550,000000 -24,000000 0,878993
550,000000 -23,000000 0,945369
550,000000 -22,000000 1,004086
550,000000 -21,000000 1,044933
550,000000 -20,000000 1,103650
550,000000 -19,000000 1,152156
550,000000 -18,000000 1,208320
550,000000 -17,000000 1,244061
550,000000 -16,000000 1,315543
550,000000 -15,000000 1,364049
550,000000 -14,000000 1,417660
550,000000 -13,000000 1,478931
550,000000 -12,000000 1,517225
550,000000 -11,000000 1,568283
550,000000 -10,000000 1,624448
550,000000 -9,000000 1,685718
550,000000 -8,000000 1,724012
550,000000 -7,000000 1,782729
550,000000 -6,000000 1,838894
550,000000 -5,000000 1,892505
550,000000 -4,000000 1,941011
550,000000 -3,000000 1,992069
550,000000 -2,000000 2,040575
550,000000 -1,000000 2,101845
550,000000 0,000000 2,137586
800,000000 -50,000000 0,039079
800,000000 -49,000000 0,041632
800,000000 -48,000000 0,036526
800,000000 -47,000000 0,028867
800,000000 -46,000000 0,039079
800,000000 -45,000000 0,036526
800,000000 -44,000000 0,028867
800,000000 -43,000000 0,044185
800,000000 -42,000000 0,039079
800,000000 -41,000000 0,041632
800,000000 -40,000000 0,064608
800,000000 -39,000000 0,250972
800,000000 -38,000000 0,286713
800,000000 -37,000000 0,330113
800,000000 -36,000000 0,368407
800,000000 -35,000000 0,399042
800,000000 -34,000000 0,434783
800,000000 -33,000000 0,478183
800,000000 -32,000000 0,513924
800,000000 -31,000000 0,559876
800,000000 -30,000000 0,595617
800,000000 -29,000000 0,646676
800,000000 -28,000000 0,710499
800,000000 -27,000000 0,743687
800,000000 -26,000000 0,789640
800,000000 -25,000000 0,848357
800,000000 -24,000000 0,894310
800,000000 -23,000000 0,932604
800,000000 -22,000000 0,996427
800,000000 -21,000000 1,042380
800,000000 -20,000000 1,098544
800,000000 -19,000000 1,152156
800,000000 -18,000000 1,193003
800,000000 -17,000000 1,249167
800,000000 -16,000000 1,318096
800,000000 -15,000000 1,358943
800,000000 -14,000000 1,404896
800,000000 -13,000000 1,461060
800,000000 -12,000000 1,519778
800,000000 -11,000000 1,568283
800,000000 -10,000000 1,624448
800,000000 -9,000000 1,657636
800,000000 -8,000000 1,713800
800,000000 -7,000000 1,772518
800,000000 -6,000000 1,823576
800,000000 -5,000000 1,869529
800,000000 -4,000000 1,935905
800,000000 -3,000000 1,974199
800,000000 -2,000000 2,038022
800,000000 -1,000000 2,081422
800,000000 0,000000 2,135034
1050,000000 -50,000000 0,036526
1050,000000 -49,000000 0,039079
1050,000000 -48,000000 0,028867
1050,000000 -47,000000 0,039079
1050,000000 -46,000000 0,044185
1050,000000 -45,000000 0,039079
1050,000000 -44,000000 0,039079
1050,000000 -43,000000 0,044185
1050,000000 -42,000000 0,049291
1050,000000 -41,000000 0,039079
1050,000000 -40,000000 0,174384
1050,000000 -39,000000 0,253525
1050,000000 -38,000000 0,294372
1050,000000 -37,000000 0,335219
1050,000000 -36,000000 0,376066
1050,000000 -35,000000 0,409254
1050,000000 -34,000000 0,455206
1050,000000 -33,000000 0,480736
1050,000000 -32,000000 0,539453
1050,000000 -31,000000 0,575194
1050,000000 -30,000000 0,608382
1050,000000 -29,000000 0,669652
1050,000000 -28,000000 0,710499
1050,000000 -27,000000 0,748793
1050,000000 -26,000000 0,802405
1050,000000 -25,000000 0,853463
1050,000000 -24,000000 0,891757
1050,000000 -23,000000 0,950475
1050,000000 -22,000000 1,011745
1050,000000 -21,000000 1,055145
1050,000000 -20,000000 1,111309
1050,000000 -19,000000 1,154709
1050,000000 -18,000000 1,198109
1050,000000 -17,000000 1,259379
1050,000000 -16,000000 1,315543
1050,000000 -15,000000 1,366602
1050,000000 -14,000000 1,412555
1050,000000 -13,000000 1,481484
1050,000000 -12,000000 1,507013
1050,000000 -11,000000 1,573389
1050,000000 -10,000000 1,632107
1050,000000 -9,000000 1,683165
1050,000000 -8,000000 1,729118
1050,000000 -7,000000 1,782729
1050,000000 -6,000000 1,826129
1050,000000 -5,000000 1,895058
1050,000000 -4,000000 1,943564
1050,000000 -3,000000 1,999728
1050,000000 -2,000000 2,027811
1050,000000 -1,000000 2,086528
1050,000000 0,000000 2,150351

This curve is plotted with labview, what I want to do in matlab first find the fits after draw 3D curve and find the right fit and finally calculate the coefficients
please i wait your response i need your help

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