![]() |
|
A structure for accumulating coordinates and computing statistics thereof: area, centroid, horizontality, verticality, variance and elongation. More...
#include <SegmentStatisticsProber.h>
Public Member Functions | |
virtual void | clear () |
Resets the statistics. | |
virtual void | add (const int &i, const int &j) |
Accumulate location (i,j) in the statistics. | |
double | getSize () const |
Returns the size of the segment. | |
double | getMeanX () const |
Returns the horizontal coordinate of centre of mass. | |
double | getMeanY () const |
Returns the horizontal coordinate of centre of mass. | |
double | getHorizontality () const |
Returns the horizontal variance $\sigma_x$ scaled with total variance $\sigma_x + \sigma_y$. Takes values in [0,1]. | |
double | getVerticality () const |
Returns the vertical variance scaled with total variance. Takes values in [0,1]. | |
double | getVariance () const |
Returns the total variance of the pixel coordinates. | |
double | getVarianceHorz () const |
double | getVarianceVert () const |
double | getSlimness () const |
Returns the proportion in which the variance equals the variance of an annulus. | |
double | getElongation () const |
Returns the proportion in which the variance equals the variance of an annulus. | |
double | getEigenValue1 () const |
double | getEigenValue2 () const |
void | toOstr (std::ostream &ostr) const |
Protected Member Functions | |
void | updateStats () const |
A structure for accumulating coordinates and computing statistics thereof: area, centroid, horizontality, verticality, variance and elongation.
This class is applied by SegmentStatisticProber which implements the recursive traversal through a segment.
All the statistics are based only on locations (i,j), not on intensities.
|
inline |
Returns the proportion in which the variance equals the variance of an annulus.
Returns getSlimness() * (1 - getElongation()). Returns the principal access ratio (e1-e2)/(e1+e2).
1-e2/e1 = e1-e2 / e1
|
inline |
Returns the horizontal variance $\sigma_x$ scaled with total variance $\sigma_x + \sigma_y$. Takes values in [0,1].
Size [ m_x = \frac{\sqrt{}}{N} ]
|
inline |
Returns the horizontal coordinate of centre of mass.
Size [ m_x = \frac{1}{N}\sum_{i=1}^N x_i ]
|
inline |
Returns the horizontal coordinate of centre of mass.
Size [ m_x = \frac{1}{N}\sum_{i=1}^N x_i ]
|
inline |
Returns the size of the segment.
Size [ s = ]
|
inline |
Returns the proportion in which the variance equals the variance of an annulus.
The variance returned by getVariance() is defined as
where
For an annulus, with inner radius
and the variance
Hence, for circular areas the variance varies between
However, thin line segments achieve values close to those of annula. Consider a thing rectangle of "radius"
(Under construction.)
If a segment is circular, its radius squared is
|
inline |
Returns the total variance of the pixel coordinates.
Returns the squared mean radius from the centroid. In physics, moment of inertia corresponds to this quantity, assuming that the body has constant density.
|
inlineprotected |
Near undetectValue