#include <bsol_distance_histogram.h>
Definition at line 22 of file bsol_distance_histogram.h.
Public Member Functions | |
| bsol_distance_histogram () | |
| Constructors. | |
| bsol_distance_histogram (int nbins, double max_val) | |
| set up the histogram with bin spacing defined by max_val and nbins. | |
| bsol_distance_histogram (int nbins, vcl_vector< vsol_line_2d_sptr > const &lines) | |
| ~bsol_distance_histogram () | |
| Destructor. | |
| int | n_bins () |
| accessors. | |
| vcl_vector< double > & | counts () |
| vcl_vector< double > & | values () |
| vcl_vector< double > & | weights () |
| void | up_count (const double value, const double count, const double weight=1.0) |
| update the histogram. | |
| bool | distance_peaks (double &peak1, double &peak2, double min_peak_height_ratio=0.5) |
| find the first two (non-zero) distance peaks. | |
| double | min_val () const |
| utility functions. | |
| double | max_val () const |
| double | min_count () const |
| double | max_count () const |
Private Member Functions | |
| void | normalize_distance () |
| normalize the distance values which were weighted by the line length. | |
| double | interpolate_peak (int initial_peak) |
| perform a parabolic interpolation using adjacent bins. | |
Private Attributes | |
| double | delta_ |
| bin value interval | |
| vcl_vector< double > | bin_counts_ |
| histogram counts | |
| vcl_vector< double > | bin_values_ |
| histogram values | |
| vcl_vector< double > | weights_ |
| value weights | |
Friends | |
| vcl_ostream & | operator<< (vcl_ostream &os, const bsol_distance_histogram &h) |
| bsol_distance_histogram::bsol_distance_histogram | ( | ) |
| bsol_distance_histogram::bsol_distance_histogram | ( | int | nbins, | |
| double | max_val | |||
| ) |
set up the histogram with bin spacing defined by max_val and nbins.
Definition at line 19 of file bsol_distance_histogram.cxx.
| bsol_distance_histogram::bsol_distance_histogram | ( | int | nbins, | |
| vcl_vector< vsol_line_2d_sptr > const & | lines | |||
| ) |
Definition at line 33 of file bsol_distance_histogram.cxx.
| bsol_distance_histogram::~bsol_distance_histogram | ( | ) |
| int bsol_distance_histogram::n_bins | ( | ) | [inline] |
| vcl_vector<double>& bsol_distance_histogram::counts | ( | ) | [inline] |
Definition at line 32 of file bsol_distance_histogram.h.
| vcl_vector<double>& bsol_distance_histogram::values | ( | ) | [inline] |
Definition at line 33 of file bsol_distance_histogram.h.
| vcl_vector<double>& bsol_distance_histogram::weights | ( | ) | [inline] |
Definition at line 34 of file bsol_distance_histogram.h.
| void bsol_distance_histogram::up_count | ( | const double | value, | |
| const double | count, | |||
| const double | weight = 1.0 | |||
| ) |
| bool bsol_distance_histogram::distance_peaks | ( | double & | peak1, | |
| double & | peak2, | |||
| double | min_peak_height_ratio = 0.5 | |||
| ) |
find the first two (non-zero) distance peaks.
The second distance peak will correspond to periodic line segments
Definition at line 158 of file bsol_distance_histogram.cxx.
| double bsol_distance_histogram::min_val | ( | ) | const |
| double bsol_distance_histogram::max_val | ( | ) | const |
Definition at line 305 of file bsol_distance_histogram.cxx.
| double bsol_distance_histogram::min_count | ( | ) | const |
Definition at line 313 of file bsol_distance_histogram.cxx.
| double bsol_distance_histogram::max_count | ( | ) | const |
Definition at line 325 of file bsol_distance_histogram.cxx.
| void bsol_distance_histogram::normalize_distance | ( | ) | [private] |
normalize the distance values which were weighted by the line length.
Note distances can't be negative so the -1 flag indicates there was no count for that bin.
Definition at line 83 of file bsol_distance_histogram.cxx.
| double bsol_distance_histogram::interpolate_peak | ( | int | initial_peak | ) | [private] |
perform a parabolic interpolation using adjacent bins.
Definition at line 116 of file bsol_distance_histogram.cxx.
| vcl_ostream& operator<< | ( | vcl_ostream & | os, | |
| const bsol_distance_histogram & | h | |||
| ) | [friend] |
Definition at line 337 of file bsol_distance_histogram.cxx.
double bsol_distance_histogram::delta_ [private] |
vcl_vector<double> bsol_distance_histogram::bin_counts_ [private] |
vcl_vector<double> bsol_distance_histogram::bin_values_ [private] |
vcl_vector<double> bsol_distance_histogram::weights_ [private] |
1.5.1