Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] linear_least_squares_fitting_3() gives bad fitting quality for input of only 3 points

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] linear_least_squares_fitting_3() gives bad fitting quality for input of only 3 points


Chronological Thread 
  • From: Gael Guennebaud <>
  • To:
  • Subject: Re: [cgal-discuss] linear_least_squares_fitting_3() gives bad fitting quality for input of only 3 points
  • Date: Sat, 24 Sep 2011 22:23:07 +0200

This is because the default tolerance value in eigen.h is much too
high. Setting it to:

static const FT EPSILON = std::numeric_limits<FT>::epsilon();

fix the issue.

gael

2011/9/23 Pierre Alliez
<>:
> dear Leon,
>
> thank you for discussing this bug.
> I think the problem comes from the eigenvalue computation.
>
> we will dig this out.
>
> in the meantime I invite you to replace the code which computes the
> eigenvalues/vectors by
> calls to the eigen library, and report whay you get here in this list.
>
> thank you,
>
> Pierre
>
>
>
> Le 21/09/2011 08:13, Leon Nan a écrit :
>> Hi all,
>>
>> I am using CGAL::linear_least_squares_fitting_3() to fit planes from point
>> set. It works pretty well for data set with more than 3 points. But I was
>> surprised that this function behaved when fitting a plane form 3 points.
>> The function returned 0.495031, which meant the variance orthogonally to
>> the fitting plane was quite big. Acutally 1.0 is expected because 3 points
>> are exactlly in the same plane. Can someone explain?
>>
>> Here is the code I call the fitting function:
>>                 Plane3f plane;
>>               double q = CGAL::linear_least_squares_fitting_3(
>>                       pts.begin(),
>>                       pts.end(),
>>                       plane,
>>                       CGAL::Dimension_tag<0>()
>>                       );
>>
>>
>> And the input(only 3 points):
>>       ==================================
>>               86.1817 3075.31 1031.53
>>               164.575 3075.31 913.936
>>               754.546 0 28.9401
>>       ==================================
>>
>> --
>> Leon
>> http://web.siat.ac.cn/~liangliang/
>>
>>
>
>
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://lists-sop.inria.fr/wws/info/cgal-discuss
>
>



Archive powered by MHonArc 2.6.16.

Top of Page