#include <osl_fit_lines.h>
Public Member Functions | |
osl_fit_lines (osl_fit_lines_params const ¶ms, double scale=1.0, double x0=0.0, double y0=0.0) | |
~osl_fit_lines () | |
void | SetSqrOrMean (bool sm) |
void | SetMinFitLength (unsigned int l) |
void | SetThreshold (double th) |
void | SetTheta (double theta) |
void | SetIgnoreEndEdgels (unsigned int ignore) |
void | incremental_fit_to_list (vcl_list< osl_edge * > *in, vcl_list< osl_edge * > *out) |
Method that takes a vcl_list<Edge*>* that represents the current segmentation and breaks off each Edge for further investigation. | |
void | simple_fit_to_list (vcl_list< osl_edge * > *in, vcl_list< osl_edge * > *out) |
void | SquareIncrementalFit (vcl_list< osl_edgel_chain * > *curves_, osl_edge *) |
Method that takes the canny edge data stored in an edge and its associated DigitalCurve, and fits lines using orthogonal regression with mean square error residual and incremental fitting. | |
void | MeanIncrementalFit (vcl_list< osl_edgel_chain * > *curves_, osl_edge *) |
This method is used to fit lines incrementally using the mean absolute error instead of the mean square error. | |
void | OutputLine (vcl_list< osl_edgel_chain * > *curves_, int, int, osl_edgel_chain *, float) |
Output the fitted line. | |
void | MergeLines (vcl_list< osl_edgel_chain * > *curves_) |
Takes the top two lines from the vcl_list<ImplicitDigitalLine*> and tests whether a single line fit would satisfy them both. | |
bool | SanityCheck () |
Checks that parameters are within acceptable bounds. | |
Static Public Member Functions | |
static float | MyGetCost (osl_OrthogRegress const *, int, int, osl_edgel_chain *) |
This method calculates the current mean absolute cost of fitting a line. | |
Public Attributes | |
unsigned int | min_fit_length_ |
bool | use_square_fit_ |
double | threshold_ |
double | theta_ |
bool | dc_only_ |
bool | incremtl_ |
unsigned int | ignore_end_edgels_ |
Private Attributes | |
osl_OrthogRegress * | data_ |
int | old_finish_ |
Definition at line 51 of file osl_fit_lines.h.
osl_fit_lines::osl_fit_lines | ( | osl_fit_lines_params const & | params, |
double | scale = 1.0 , |
||
double | x0 = 0.0 , |
||
double | y0 = 0.0 |
||
) |
Definition at line 22 of file osl_fit_lines.cxx.
osl_fit_lines::~osl_fit_lines | ( | ) |
Definition at line 32 of file osl_fit_lines.cxx.
void osl_fit_lines::incremental_fit_to_list | ( | vcl_list< osl_edge * > * | myedges, |
vcl_list< osl_edge * > * | outedges | ||
) |
Method that takes a vcl_list<Edge*>* that represents the current segmentation and breaks off each Edge for further investigation.
An incremental fitting process is applied to the osl_edgel_chain in each osl_edge. The resultant segmentation is then written to output (with edges destroyed).
Definition at line 130 of file osl_fit_lines.cxx.
void osl_fit_lines::MeanIncrementalFit | ( | vcl_list< osl_edgel_chain * > * | curves_, |
osl_edge * | edge | ||
) |
This method is used to fit lines incrementally using the mean absolute error instead of the mean square error.
The difference between this and SquareIncrementalFit is very small.
Definition at line 202 of file osl_fit_lines.cxx.
void osl_fit_lines::MergeLines | ( | vcl_list< osl_edgel_chain * > * | curves_ | ) |
Takes the top two lines from the vcl_list<ImplicitDigitalLine*> and tests whether a single line fit would satisfy them both.
The process involves fitting a single line to the other two lines by minimising the integral of the Euclidean distance between the lines. If the lines appear to come from the same line, a refit should be done using the underlying edgel data, *** BUT THIS IS NOT YET IMPLEMENTED ***
Definition at line 569 of file osl_fit_lines.cxx.
float osl_fit_lines::MyGetCost | ( | osl_OrthogRegress const * | fitter, |
int | start, | ||
int | finish, | ||
osl_edgel_chain * | dc | ||
) | [static] |
This method calculates the current mean absolute cost of fitting a line.
Definition at line 837 of file osl_fit_lines.cxx.
void osl_fit_lines::OutputLine | ( | vcl_list< osl_edgel_chain * > * | curves_, |
int | start, | ||
int | finish, | ||
osl_edgel_chain * | dc, | ||
float | |||
) |
Output the fitted line.
Definition at line 523 of file osl_fit_lines.cxx.
bool osl_fit_lines_params::SanityCheck | ( | ) | [inherited] |
Checks that parameters are within acceptable bounds.
Definition at line 23 of file osl_fit_lines_params.cxx.
void osl_fit_lines::SetIgnoreEndEdgels | ( | unsigned int | ignore | ) | [inline] |
Definition at line 61 of file osl_fit_lines.h.
void osl_fit_lines::SetMinFitLength | ( | unsigned int | l | ) | [inline] |
Definition at line 58 of file osl_fit_lines.h.
void osl_fit_lines::SetSqrOrMean | ( | bool | sm | ) | [inline] |
Definition at line 57 of file osl_fit_lines.h.
void osl_fit_lines::SetTheta | ( | double | theta | ) | [inline] |
Definition at line 60 of file osl_fit_lines.h.
void osl_fit_lines::SetThreshold | ( | double | th | ) | [inline] |
Definition at line 59 of file osl_fit_lines.h.
void osl_fit_lines::simple_fit_to_list | ( | vcl_list< osl_edge * > * | in, |
vcl_list< osl_edge * > * | out | ||
) |
Definition at line 47 of file osl_fit_lines.cxx.
void osl_fit_lines::SquareIncrementalFit | ( | vcl_list< osl_edgel_chain * > * | curves_, |
osl_edge * | edge | ||
) |
Method that takes the canny edge data stored in an edge and its associated DigitalCurve, and fits lines using orthogonal regression with mean square error residual and incremental fitting.
Definition at line 377 of file osl_fit_lines.cxx.
osl_OrthogRegress* osl_fit_lines::data_ [private] |
Definition at line 77 of file osl_fit_lines.h.
bool osl_fit_lines_params::dc_only_ [inherited] |
Definition at line 30 of file osl_fit_lines_params.h.
unsigned int osl_fit_lines_params::ignore_end_edgels_ [inherited] |
Definition at line 32 of file osl_fit_lines_params.h.
bool osl_fit_lines_params::incremtl_ [inherited] |
Definition at line 31 of file osl_fit_lines_params.h.
unsigned int osl_fit_lines_params::min_fit_length_ [inherited] |
Definition at line 26 of file osl_fit_lines_params.h.
int osl_fit_lines::old_finish_ [private] |
Definition at line 78 of file osl_fit_lines.h.
double osl_fit_lines_params::theta_ [inherited] |
Definition at line 29 of file osl_fit_lines_params.h.
double osl_fit_lines_params::threshold_ [inherited] |
Definition at line 28 of file osl_fit_lines_params.h.
bool osl_fit_lines_params::use_square_fit_ [inherited] |
Definition at line 27 of file osl_fit_lines_params.h.