2 #ifndef vgl_conic_2d_regression_h_ 3 #define vgl_conic_2d_regression_h_ 61 # include <vcl_msvc_warnings.h> 63 #include <vnl/vnl_matrix_fixed.h> 149 #define VGL_CONIC_2D_REGRESSION_INSTANTIATE(T) extern "please include vgl/algo/vgl_conic_2d_regression.hxx first" 151 #endif // vgl_conic_2d_regression_h_
void remove_point(vgl_point_2d< T > const &p)
void compute_partial_sums()
a point in 2D nonhomogeneous space
T cost_
The algebraic fitting cost in the normalized frame.
void add_point(vgl_point_2d< T > const &p)
~vgl_conic_2d_regression()=default
vnl_matrix_fixed< T, 3, 3 > S12_
T get_rms_sampson_error() const
get the current Euclidean fitting error in the original frame.
unsigned get_n_pts() const
Number of regression points.
vgl_conic_2d_regression()
Constructors.
vgl_conic< T > conic() const
std::vector< T > partial_sums_
The partial scatter term sums, updated with each ::add_point.
The similarity transform that normalizes a point set.
T get_rms_error_est(vgl_point_2d< T > const &p) const
get the estimated Euclidean error with respect to the fitted conic segment in the original frame.
void clear_points()
clear the regression data.
bool fit()
the fitting method.
vnl_matrix_fixed< T, 3, 3 > S11_
The fitting matrices.
void set_sampson_error(T a, T b, T c, T d, T e, T f)
std::vector< vgl_homg_point_2d< T > > hnorm_points_
Normalized points.
vgl_norm_trans_2d< T > trans_
The normalizing transformation.
vnl_matrix_fixed< T, 3, 3 > Dinv_
unsigned npts_
Size of point set.
point in projective 2D space
void fill_scatter_matrix()
T sampson_error_
The Sampson approximation to Euclidean distance in the normalized frame.
vnl_matrix_fixed< T, 3, 3 > S22_
void print_pointset(std::ostream &str=std::cout)
std::vector< vgl_point_2d< T > > points_
The current set of points.
vgl_conic< T > conic_
The fitted conic in the un-normalized frame.
T get_rms_algebraic_error() const
get the current algebraic fitting error in the normalized frame.