POV-Ray : Newsgroups : povray.advanced-users : Least Squares fitting : Least Squares fitting Server Time
15 Jul 2024 12:50:58 EDT (-0400)
  Least Squares fitting  
From: Bald Eagle
Date: 10 Mar 2023 18:40:00
Message: <web.640bbedd42ffa061f9dae3025979125@news.povray.org>
So, I've had a few ideas that I've wanted to pursue, and for those, I need a few
tools to perform the tasks more rigorously than "by eye".

I looked at converting some Javascript code, but gave up on that,
then found a semi-encouraging post,
and then found the original paper,
which I thought I could puzzle out - the solution seemed tantalizingly close,
But good ole' Coope just used too many x's and changes of variables, and
sparsely described methods of getting from point A to point B.

Luckily, I found some "good" c++ code, and I was able to successfully convert
the Taubin algebraic solution before I left for work:
and then got back home and worked on the geometric Levenberg-Marquardt fit, only
to find that it's written with a host of ugly "goto" statements.  :O :(

I somehow navigated a path to simulate that in SDL, code the few dependencies,
and fake or ignore the rest.  Got stuck in an endless while loop somewhere when
I started whittling down the circle to an arc of pi*0.6, but fixed that, and...

Seems to be working well enough.   So now I have a regular linear least squares
regression macro, and at least one set of (seemingly) fully functional circle
fitting macros.

Onwards we trudge....

Post a reply to this message

Download 'leastsquares_circle.png' (37 KB)

Preview of image 'leastsquares_circle.png'


Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.