#include <vgl_line_2d_regression.h>
In addition to fitting a line to a set of points (orthogonal regression), it is designed to help with incremental fitting. You can inexpensively add and remove points. This class does not store the points; it merely stores enough aggregate information to estimate the line parameters.
Definition at line 31 of file vgl_line_2d_regression.h.
Public Member Functions | |
| vgl_line_2d_regression () | |
| Constructor. | |
| ~vgl_line_2d_regression () | |
| unsigned int | get_n_pts () const |
| The number of points added. | |
| void | increment_partial_sums (const T x, const T y) |
| Add a point to the 2d_regression. | |
| void | decrement_partial_sums (const T x, const T y) |
| Remove a point from the 2d_regression. | |
| void | clear () |
| Clear 2d_regression sums. | |
| double | get_rms_error (const T a, const T b, const T c) |
| Get fitting error for a given line. | |
| double | get_rms_error () |
| Get fitting error for current fitted line. | |
| void | init_rms_error_est () |
| Initialize estimated fitting error. | |
| double | get_rms_error_est (vgl_point_2d< T > const &p, bool increment=true) |
| Get estimated fitting error if the point (x, y) were added to the fit. | |
| vgl_line_2d< T > | get_line () const |
| Get the fitted line. | |
| bool | fit () |
| Fit a line to the current point set. | |
| bool | fit_constrained (T x, T y) |
| Fit a line to the current point set constrained to pass through (x,y). | |
Private Attributes | |
| unsigned int | npts_ |
| number of points in the regression data | |
| vgl_line_2d< T > | line_ |
| the fitted line | |
| T | Sx_ |
| T | Sy_ |
| T | Sxx_ |
| T | Sxy_ |
| T | Syy_ |
| partial sums | |
| double | squared_error_ |
| an estimate of the squared error | |
|
|||||||||
|
Constructor.
Definition at line 17 of file vgl_line_2d_regression.txx. |
|
|||||||||
|
Definition at line 40 of file vgl_line_2d_regression.h. |
|
|||||||||
|
Clear 2d_regression sums. This will reset the object to the freshly constructed state of having zero points. Definition at line 49 of file vgl_line_2d_regression.txx. |
|
||||||||||||||||
|
Remove a point from the 2d_regression. This should be a previously added point, although this cannot be verified. Definition at line 36 of file vgl_line_2d_regression.txx. |
|
|||||||||
|
Fit a line to the current point set.
Definition at line 62 of file vgl_line_2d_regression.txx. |
|
||||||||||||||||
|
Fit a line to the current point set constrained to pass through (x,y).
Definition at line 84 of file vgl_line_2d_regression.txx. |
|
|||||||||
|
Get the fitted line.
Definition at line 82 of file vgl_line_2d_regression.h. |
|
|||||||||
|
The number of points added.
Definition at line 43 of file vgl_line_2d_regression.h. |
|
|||||||||
|
Get fitting error for current fitted line.
Definition at line 115 of file vgl_line_2d_regression.txx. |
|
||||||||||||||||||||
|
Get fitting error for a given line.
Definition at line 104 of file vgl_line_2d_regression.txx. |
|
||||||||||||||||
|
Get estimated fitting error if the point (x, y) were added to the fit. You must call init_rms_error_est() to initialize the running totals before the first use of this function. If increment is true, the running totals are updated as if the point p was added to the point set. It does not update the point set, however, so the point will not affect subsequent line estimation. Definition at line 142 of file vgl_line_2d_regression.txx. |
|
||||||||||||||||
|
Add a point to the 2d_regression.
Definition at line 24 of file vgl_line_2d_regression.txx. |
|
|||||||||
|
Initialize estimated fitting error.
squared_error_ = squared_error_ + d^2
npts_+1
Definition at line 131 of file vgl_line_2d_regression.txx. |
|
|||||
|
the fitted line
Definition at line 35 of file vgl_line_2d_regression.h. |
|
|||||
|
number of points in the regression data
Definition at line 34 of file vgl_line_2d_regression.h. |
|
|||||
|
an estimate of the squared error
Definition at line 37 of file vgl_line_2d_regression.h. |
|
|||||
|
Definition at line 36 of file vgl_line_2d_regression.h. |
|
|||||
|
Definition at line 36 of file vgl_line_2d_regression.h. |
|
|||||
|
Definition at line 36 of file vgl_line_2d_regression.h. |
|
|||||
|
Definition at line 36 of file vgl_line_2d_regression.h. |
|
|||||
|
partial sums
Definition at line 36 of file vgl_line_2d_regression.h. |
1.4.4