Public Member Functions | Protected Attributes | List of all members
vgl_fit_sphere_3d< T > Class Template Reference

#include <vgl_fit_sphere_3d.h>

Public Member Functions

 vgl_fit_sphere_3d ()=default
 
 vgl_fit_sphere_3d (std::vector< vgl_point_3d< T > > points)
 
 ~vgl_fit_sphere_3d ()=default
 
void add_point (vgl_point_3d< T > const &p)
 add a point to point set. More...
 
void add_point (const T x, const T y, const T z)
 
void clear ()
 clear internal data. More...
 
fit_linear (std::ostream *outstream=nullptr)
 fit a sphere to the stored points using a linear method. More...
 
bool fit_linear (const T error_marg, std::ostream *outstream=nullptr)
 fits a sphere to the stored points using a linear method. More...
 
fit (std::ostream *outstream=nullptr, bool verbose=false)
 fits a sphere nonlinearly to the stored points using Levenberg Marquardt. More...
 
bool fit (const T error_marg, std::ostream *outstream=nullptr, bool verbose=false)
 fits a sphere nonlinearly to the stored points using Levenberg Marquardt. More...
 
std::vector< vgl_point_3d< T > > get_points () const
 
vgl_sphere_3d< T > & get_sphere_linear_fit ()
 appropriate fit function should be called first to get the sphere corresponding to the points. More...
 
vgl_sphere_3d< T > & get_sphere_nonlinear_fit ()
 

Protected Attributes

std::vector< vgl_homg_point_3d< T > > points_
 
vgl_sphere_3d< T > sphere_lin_
 
vgl_sphere_3d< T > sphere_non_lin_
 

Detailed Description

template<class T>
class vgl_fit_sphere_3d< T >

Definition at line 50 of file vgl_fit_sphere_3d.h.

Constructor & Destructor Documentation

◆ vgl_fit_sphere_3d() [1/2]

template<class T >
vgl_fit_sphere_3d< T >::vgl_fit_sphere_3d ( )
default

◆ vgl_fit_sphere_3d() [2/2]

template<class T >
vgl_fit_sphere_3d< T >::vgl_fit_sphere_3d ( std::vector< vgl_point_3d< T > >  points)

Definition at line 60 of file vgl_fit_sphere_3d.hxx.

◆ ~vgl_fit_sphere_3d()

template<class T >
vgl_fit_sphere_3d< T >::~vgl_fit_sphere_3d ( )
default

Member Function Documentation

◆ add_point() [1/2]

template<class T >
void vgl_fit_sphere_3d< T >::add_point ( vgl_point_3d< T > const &  p)

add a point to point set.

Definition at line 69 of file vgl_fit_sphere_3d.hxx.

◆ add_point() [2/2]

template<class T >
void vgl_fit_sphere_3d< T >::add_point ( const T  x,
const T  y,
const T  z 
)

Definition at line 75 of file vgl_fit_sphere_3d.hxx.

◆ clear()

template<class T >
void vgl_fit_sphere_3d< T >::clear ( )

clear internal data.

Definition at line 81 of file vgl_fit_sphere_3d.hxx.

◆ fit() [1/2]

template<class T >
T vgl_fit_sphere_3d< T >::fit ( std::ostream *  outstream = nullptr,
bool  verbose = false 
)

fits a sphere nonlinearly to the stored points using Levenberg Marquardt.

returns the average distance from the points to the sphere

Definition at line 142 of file vgl_fit_sphere_3d.hxx.

◆ fit() [2/2]

template<class T >
bool vgl_fit_sphere_3d< T >::fit ( const T  error_marg,
std::ostream *  outstream = nullptr,
bool  verbose = false 
)

fits a sphere nonlinearly to the stored points using Levenberg Marquardt.

Definition at line 230 of file vgl_fit_sphere_3d.hxx.

◆ fit_linear() [1/2]

template<class T >
T vgl_fit_sphere_3d< T >::fit_linear ( std::ostream *  outstream = nullptr)

fit a sphere to the stored points using a linear method.

returns the average distance from the points to the sphere used as an initial condition for Levenberg Marquardt error conditions are reported on outstream

Definition at line 87 of file vgl_fit_sphere_3d.hxx.

◆ fit_linear() [2/2]

template<class T >
bool vgl_fit_sphere_3d< T >::fit_linear ( const T  error_marg,
std::ostream *  outstream = nullptr 
)

fits a sphere to the stored points using a linear method.

Definition at line 224 of file vgl_fit_sphere_3d.hxx.

◆ get_points()

template<class T >
std::vector< vgl_point_3d< T > > vgl_fit_sphere_3d< T >::get_points ( ) const

Definition at line 214 of file vgl_fit_sphere_3d.hxx.

◆ get_sphere_linear_fit()

template<class T >
vgl_sphere_3d<T>& vgl_fit_sphere_3d< T >::get_sphere_linear_fit ( )
inline

appropriate fit function should be called first to get the sphere corresponding to the points.

Definition at line 98 of file vgl_fit_sphere_3d.h.

◆ get_sphere_nonlinear_fit()

template<class T >
vgl_sphere_3d<T>& vgl_fit_sphere_3d< T >::get_sphere_nonlinear_fit ( )
inline

Definition at line 99 of file vgl_fit_sphere_3d.h.

Member Data Documentation

◆ points_

template<class T >
std::vector<vgl_homg_point_3d<T> > vgl_fit_sphere_3d< T >::points_
protected

Definition at line 54 of file vgl_fit_sphere_3d.h.

◆ sphere_lin_

template<class T >
vgl_sphere_3d<T> vgl_fit_sphere_3d< T >::sphere_lin_
protected

Definition at line 55 of file vgl_fit_sphere_3d.h.

◆ sphere_non_lin_

template<class T >
vgl_sphere_3d<T> vgl_fit_sphere_3d< T >::sphere_non_lin_
protected

Definition at line 56 of file vgl_fit_sphere_3d.h.


The documentation for this class was generated from the following files: