Nonlinear Least Squares C/C++ Code for Carpet Evaluation

Click For Summary
SUMMARY

The discussion centers on implementing nonlinear least squares fitting in C/C++ for evaluating carpet wear using a point cloud of several hundred thousand points. The user mentions the Levmar library, which is inadequately documented, and suggests alternatives like the Galahad library in Fortran and Ipopt for nonlinear optimization in C++. Additionally, the book "Numerical Recipes in C" is recommended for algorithms related to nonlinear least squares, although its code requires ownership of the book for use.

PREREQUISITES
  • Understanding of nonlinear least squares fitting techniques
  • Familiarity with C/C++ programming languages
  • Knowledge of point cloud data processing
  • Basic concepts of numerical optimization
NEXT STEPS
  • Explore the Levmar library for nonlinear least squares fitting in C/C++
  • Investigate the Galahad library for optimization tasks
  • Learn about Ipopt for advanced nonlinear optimization in C++
  • Read "Numerical Recipes in C" for algorithms related to nonlinear least squares
USEFUL FOR

This discussion is beneficial for software developers, data scientists, and researchers involved in computational geometry, particularly those working on point cloud analysis and optimization problems in C/C++.

Simon666
Messages
93
Reaction score
0
Do you know of code (preferably C/C++) to do this for non linear least squares? i found a program called levmar on the internet, but it seems inadequately documented on how to use it and probably not so useful to my purposes.

My problem is evaluation of a carpet. The middle is worn out and it is laser scanned. i have a point cloud of about a couple of hundred thousand pointsand I need to model the following profile through it. Desired to find are the lengths l1, l2 l3, l4 (l5=width of carpet-l1-l2-l3-l4) and the height difference z. I have to find this using Least Squares Fitting. This seems quite non linear (unless maybe around good initial values which could be found) and the partial derivatives would also have to be determined approximatingly and numerically.


Code:
[FONT="Courier New"]-------------\                     /---------------     ^
              \-------------------/                     |  z
l1            l2         l3        l4         l5        |
 
Last edited:
Technology news on Phys.org
Well there's galahad but it's in fortran
http://galahad.rl.ac.uk/

You can use it in C/C++ code though I believe.Also there's Ipopt for nonlinear optimization written in C++.
https://projects.coin-or.org/Ipopt

You might also want to check out Numerical Recipes in C
The book is available online (here - http://www.nrbook.com/a/bookcpdf.php) and it provides algorithms for a large number of problems including nonlinear least squares. You can't copy their code without owning the book though I believe.
 
Last edited:

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 36 ·
2
Replies
36
Views
5K
Replies
6
Views
5K
  • · Replies 5 ·
Replies
5
Views
9K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 13 ·
Replies
13
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K