forum.alglib.net

ALGLIB forum
It is currently Sat Apr 27, 2024 12:29 pm

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: ALGLIB and road planar and altimetric geometries detection
PostPosted: Tue Feb 15, 2011 6:00 pm 
Offline

Joined: Tue Feb 15, 2011 5:34 pm
Posts: 2
Hello ALGLIB experts.

I am working on a piece of code that aims to automatically detect main parts of a road, talking about its planar (straights, costant radius curves, parabolic curves) and altimetric trend (constant quote grow / decrease, parabolic quote grow / decrease, circular quote grow / decrease).
I already managed to detect straightways by applying a "best fitting" using a linear regression algorithm: as much as good regression, as much we are in a straight... (even if it's not a very precise algorithm - suggestions welcome).
Now I got into recognition of parabolic (and constant radius) geometries between straightways.
Can anyone suggest a method to do a parabolic fitting and get regression coefficients to state if we are analyzing a parabolic trend or a circlular trend (costant radius).
I saw that ALGLIB has a LSFitNonlinearFGH function, but I got lost on undestranding how to use it, how to test the "goodness of fitting" and how to get A, B parameters of "best fitting function"...

Could you please point me to a clear example on how to use it?
My language is Object Pascal (Delphi).

Note: data to be analyzed has "local" errors, due to GPS instrumental data retrieval (both in XY plane, both in quote Z).

Thank you.


Top
 Profile  
 
 Post subject: Re: ALGLIB and road planar and altimetric geometries detecti
PostPosted: Tue Feb 15, 2011 8:49 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 906
Even with parabolic fitting it is still linear regression. Take a look at http://en.wikipedia.org/wiki/Polynomial_regression for discussion of linear vs. nonlinear aspects. But it applies only for cases where you can formulate your problem as dependence Y(X). If your parabola can be rotated arbitrarily in X-Y plane, than you have nonlinear total-least-squares-like regression problem. Such problems can be solved with nonlinear optimizer, but the problem is that functionality you need (nonlinear derivative-free fitting) is accessible in ALGLIB 3.2 only. Delphi version is still 2.6, which is inconvenient and doesn't support modern features you will need.

Can you switch to C++ (at least for computational parts of your application)?


Top
 Profile  
 
 Post subject: Re: ALGLIB and road planar and altimetric geometries detecti
PostPosted: Mon Feb 21, 2011 12:57 pm 
Offline

Joined: Tue Feb 15, 2011 5:34 pm
Posts: 2
Sergey.Bochkanov wrote:
Even with parabolic fitting it is still linear regression. Take a look at http://en.wikipedia.org/wiki/Polynomial_regression for discussion of linear vs. nonlinear aspects. But it applies only for cases where you can formulate your problem as dependence Y(X). If your parabola can be rotated arbitrarily in X-Y plane, than you have nonlinear total-least-squares-like regression problem. Such problems can be solved with nonlinear optimizer, but the problem is that functionality you need (nonlinear derivative-free fitting) is accessible in ALGLIB 3.2 only. Delphi version is still 2.6, which is inconvenient and doesn't support modern features you will need.

Can you switch to C++ (at least for computational parts of your application)?

Let's say that switching to C++ would be possible (maybe developing a dedicated DLL), but at the moment I prefer staying in my own language. I will consider anyway your advice if I can't find a way out to parabolic fitting problem.

Let me ask you an advice on constant curve detection...
I simplyfied the problem by applying a linear regression over a sample of points, considering covered distance over local radius (or curvature) between points.
Let's say: as much distance is growing as much radius shoud remain constant.
So, putting distance in X and radius in Y (where Y(X)), applying the regression, I should get a correlation coefficient (Pearson) that shoud tell me how much distance and radius are related together. Strong correlation should return a value tending to 1. Weak correlation should return a value tending to 0.

But that's a correlation coefficient, and maybe I should verify some other normalized index telling me that there is "no correlation" between X and Y, or that the values are almost uncorrelate...
Anyway I don't get a "good" parametrable regression coefficient, talking about method decribed above.

Is this a good approach, or there may be better approaches to this problem?

Thank you.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 240 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group