IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Public Member Functions | Protected Member Functions | List of all members
ipsdk::math::BaseHistogram Class Referenceabstract

Base class for histogram data management. More...

#include <BaseHistogram.h>

Inheritance diagram for ipsdk::math::BaseHistogram:
ipsdk::BaseSerializationObject ipsdk::BaseDynamicObject ipsdk::math::Histogram< g_bDataIntegral >

Public Member Functions

bool isInit () const
 check whether object has been initialized
 
HistogramGaussianCurveFit fitGaussianCurve (const EstimationConfig &config=createNonRobustConfig(), const bool bIncludeOutOfBoundsData=false) const
 function allowing to fit a gaussian curve on histogram data Fitted gaussian curve is defined as follow :

\[ \begin{cases} G:\Re \rightarrow \Re \\ y = G(X) = Ae^{-\frac{(x-\mu)^2}{2\sigma^2}} \end{cases} \text{where} \begin{cases} x & \text{bin population}\\ y & \text{bin mid value} \\ \end{cases} \]

More...
 
clustering::KMeansClusteringPtr applyKMeansClustering (const ipUInt32 nbClusters, const bool bIncludeOutOfBoundsData=false, const clustering::KMeansClusteringConfig &clusteringConfig=clustering::KMeansClusteringConfig()) const
 function allowing to apply K-Means clustering algorithm with K-Means++ initialization on histogram data More...
 
template<typename KernelType >
boost::shared_ptr< clustering::KernelKMeansClustering< KernelType > > applyKernelKMeansClustering (const ipUInt32 nbClusters, const KernelType &kernel, const bool bIncludeOutOfBoundsData=false, const clustering::KernelKMeansClusteringConfig &clusteringConfig=clustering::KernelKMeansClusteringConfig()) const
 function allowing to apply Kernel K-Means clustering algorithm More...
 
template<typename KernelType >
boost::shared_ptr< clustering::SpectralClustering< KernelType > > applySpectralClustering (const ipUInt32 nbClusters, const KernelType &kernel, const bool bIncludeOutOfBoundsData=false, const clustering::KernelKMeansClusteringConfig &clusteringConfig=clustering::KernelKMeansClusteringConfig()) const
 function allowing to apply spectral clustering algorithm More...
 
void clear ()
 clear of all histogram informations
 
Constructors and destructor
 BaseHistogram ()
 
virtual ~BaseHistogram ()=0
 
Histogram initialization
void initFromExisting (const ipReal64 firstHistoValue, const ipReal64 lastHistoValue, const ipReal64 binWidth, const UInt64Vector &histogramPopulation, const eHistogramOutOfBoundsPolicy &outOfBoundsPolicy=eHistogramOutOfBoundsPolicy::eHOOBP_Ignored)
 initialization of histogram with existing histogram data More...
 
Histogram data modifications
void clearData ()
 clear of all data associated to histogram More...
 
Histogram query
virtual ipBool areDataIntegral () const =0
 check whether histogram data are integral
 
ipReal64 getFirstValue () const
 retrieve first value for histogram More...
 
ipReal64 getLastValue () const
 retrieve last value for histogram More...
 
ipReal64 getLowerBound () const
 retrieve lower bound for histogram More...
 
ipReal64 getUpperBound () const
 retrieve upper bound for histogram More...
 
ipReal64 getRange () const
 retrieve range for histogram More...
 
ipReal64 getBinWidth () const
 retrieve bin width associated to histogram More...
 
ipUInt32 getNbClasses () const
 retrieve number of classes associated to histogram More...
 
ipUInt32 getNbBins () const
 retrieve number of bins associated to histogram More...
 
ipUInt32 getLowerOutOfBoundsBinIdx () const
 retrieve bin index associated to lower out of bounds data More...
 
ipUInt32 getUpperOutOfBoundsBinIdx () const
 retrieve bin index associated to upper out of bounds data More...
 
ipUInt32 getInBoundsBinOffset () const
 retrieve index associated to first in bounds data More...
 
const UInt64VectorgetHistogramPopulation () const
 access to data collection associated to histogram More...
 
ipUInt64 getTotalPopulation () const
 retrieve total population for histogram More...
 
UInt64Vector getHistogramClassPopulation () const
 retrieve sub part of collection associated to classes (ie. excluding reserved bin associated to out of bounds data)
 
ipReal64 getBinStartValue (const ipUInt32 binIdx) const
 retrieve starting value for a given histogram bin More...
 
ipReal64 getBinMidValue (const ipUInt32 binIdx) const
 retrieve mid value for a given histogram bin More...
 
ipReal64 getBinEndValue (const ipUInt32 binIdx) const
 retrieve ending value for a given histogram bin More...
 
ipReal64 getClassStartValue (const ipUInt32 classIdx) const
 retrieve starting value for a given histogram class More...
 
ipReal64 getClassMidValue (const ipUInt32 classIdx) const
 retrieve mid value for a given histogram class More...
 
ipReal64 getClassEndValue (const ipUInt32 classIdx) const
 retrieve ending value for a given histogram class More...
 
ipUInt64 getClassPopulation (const ipUInt32 classIdx) const
 access to population for a given class index More...
 
ipReal64 getClassFrequency (const ipUInt32 classIdx) const
 access to frequency for a given class index More...
 
ipUInt64 getClassCumulatedPopulation (const ipUInt32 classIdx) const
 access to cumulated population for a given class index More...
 
ipReal64 getClassCumulatedFrequency (const ipUInt32 classIdx) const
 access to cumulated frequency for a given class index More...
 
ipBool isOutOfBounds (const ipReal64 value) const
 method allowing to check whether a given input value is out of histogram bounds More...
 
ipBool isOutOfLowerBound (const ipReal64 value) const
 method allowing to check whether a given input value is lower than histogram lower bound More...
 
ipBool isOutOfUpperBound (const ipReal64 value) const
 method allowing to check whether a given input value is greater than histogram upper bound More...
 
ipBool canBeAggregated (const ipReal64 value) const
 method allowing to check whether a value can be aggregated to histogram data regards to histogram range and an out of bounds policy More...
 
ipUInt32 getBinIdx (const ipReal64 value) const
 retrieve histogram bin index associated to a given input value More...
 
ipUInt64 getPopulation (const ipReal64 value) const
 retrieve histogram population for a given value More...
 
ipReal64 getFrequency (const ipReal64 value) const
 retrieve histogram frequency for a given value More...
 
ipUInt64 getCumulatedPopulation (const ipReal64 value) const
 retrieve histogram cumulated population for a given value More...
 
ipReal64 getCumulatedFrequency (const ipReal64 value) const
 retrieve histogram cumulated frequency for a given value More...
 
void getFrequencies (Real64Vector &frequencies) const
 compute histogram frequencies
 
Real64Vector getFrequencies () const
 compute histogram frequencies
 
void getCumulatedFrequencies (Real64Vector &cumulatedFrequencies) const
 compute histogram cumulated frequencies
 
Real64Vector getCumulatedFrequencies () const
 compute histogram cumulated frequencies
 
Real64Vector getBinMidValues () const
 retrieve histogram bin mid values
 
ipUInt32 getQuantileClassIdx (const ipReal64 quantileValue) const
 retrieve class index associated to a given quantile value More...
 
ipUInt32 getMaxPopulationClassIdx () const
 retrieve class index associated to maximum population More...
 
Extrema search
UInt32Vector findLocalMaxima (const bool bStrictExtrema=true, const eExtremaBorderPolicy &extremaBorderPolicy=eExtremaBorderPolicy::eEBP_Keeped, const ipReal64 minDistance=0, const ipUInt64 populationThreshold=0) const
 function allowing to retrieve local maxima associated to histogram More...
 
UInt32Vector findLocalMinima (const bool bStrictExtrema=true, const eExtremaBorderPolicy &extremaBorderPolicy=eExtremaBorderPolicy::eEBP_Keeped, const ipReal64 minDistance=0, const ipUInt64 populationThreshold=NumericLimits< ipUInt64 >::max()) const
 function allowing to retrieve local minima associated to histogram More...
 
HistogramExtremaColl findLocalDilatedMaxima (const ipUInt64 dilateFactor, const eExtremaBorderPolicy &extremaBorderPolicy=eExtremaBorderPolicy::eEBP_Keeped, const ipReal64 minDistance=0, const ipUInt64 populationThreshold=0) const
 function allowing to retrieve local dilated maxima associated to histogram More...
 
HistogramExtremaColl findLocalDilatedMinima (const ipUInt64 dilateFactor, const eExtremaBorderPolicy &extremaBorderPolicy=eExtremaBorderPolicy::eEBP_Keeped, const ipReal64 minDistance=0, const ipUInt64 populationThreshold=NumericLimits< ipUInt64 >::max()) const
 function allowing to retrieve local dilated minima associated to histogram (see BaseHistogram::findLocalDilatedMaxima for an illustration of dilation process) More...
 
- Public Member Functions inherited from ipsdk::BaseSerializationObject
 BaseSerializationObject ()
 Default constructor.
 
virtual ~BaseSerializationObject ()=0
 destructor
 
- Public Member Functions inherited from ipsdk::BaseDynamicObject
virtual const std::string & getClassName () const
 method allowing to retrieve object class name
 
virtual BaseDynamicObjectcreateNew () const =0
 method allowing to create new instance of current object type
 
virtual DynamicObjectPtr createShared () const =0
 method allowing to create new shared instance of current object type
 
virtual bool hasCopySupport () const =0
 check whether objet has copy support
 
virtual BaseDynamicObjectduplicate () const =0
 method allowing to duplicate current object More...
 
virtual DynamicObjectPtr duplicateShared () const =0
 method allowing shared duplication of current object More...
 
 BaseDynamicObject ()
 
virtual ~BaseDynamicObject ()=0
 

Protected Member Functions

void checkInit () const
 
void checkClassIdx (const ipUInt32 classIdx) const
 method allowing to check validity of a class index
 
void checkBinIdx (const ipUInt32 classIdx) const
 method allowing to check validity of a bin index
 
void updateHistogramParams (const ipReal64 firstHistoValue, const ipReal64 lastHistoValue, const ipReal64 binWidth, const eHistogramOutOfBoundsPolicy &outOfBoundsPolicy)
 method allowing to update histogram parameters More...
 
void updateHistogramParams (const ipReal64 firstHistoValue, const ipReal64 lastHistoValue, const ipUInt32 nbClasses, const eHistogramOutOfBoundsPolicy &outOfBoundsPolicy)
 method allowing to update histogram parameters More...
 
ipBool insertDataInternal (const ipReal64 value)
 insertion of data into histogram More...
 
void clearCumulatedData ()
 clear of cumulated data associated to histogram
 
void collectClusteringData (const bool bIncludeOutOfBoundsData, clustering::VectorColl &inputDataColl) const
 method allowing to collect histogram data for clustering computation
 
- Protected Member Functions inherited from ipsdk::BaseSerializationObject
virtual BoolResult write (BaseOArchive &ar) const
 method allowing to ensure serialization write part for object
 
virtual BoolResult read (BaseIArchive &ar)
 method allowing to ensure serialization read part for object
 
- Protected Member Functions inherited from ipsdk::BaseDynamicObject
virtual void initCtorCopy (const BaseDynamicObject &object)
 
virtual void copy (const BaseDynamicObject &object)
 method allowing to copy data from another object
 

Additional Inherited Members

- Static Public Member Functions inherited from ipsdk::BaseSerializationObject
static ipUInt32 getVersion ()
 method allowing to retrieve class version information for serialization
 
- Static Public Member Functions inherited from ipsdk::BaseDynamicObject
static const std::string & getTypeName ()
 method allowing to retrieve name associated to class
 

Detailed Description

Base class for histogram data management.

Author
E.Noirfalise
Date
2017/08/08

Member Function Documentation

◆ initFromExisting()

void ipsdk::math::BaseHistogram::initFromExisting ( const ipReal64  firstHistoValue,
const ipReal64  lastHistoValue,
const ipReal64  binWidth,
const UInt64Vector histogramPopulation,
const eHistogramOutOfBoundsPolicy outOfBoundsPolicy = eHistogramOutOfBoundsPolicy::eHOOBP_Ignored 
)

initialization of histogram with existing histogram data

Exceptions
ipsdk::math::IPSDKMathExceptionif firstHistoValue >= lastHistoValue
ipsdk::math::IPSDKMathExceptionif binWidth <= 0
ipsdk::math::IPSDKMathExceptionif expected number of bins differs from histogram population size

◆ clearData()

void ipsdk::math::BaseHistogram::clearData ( )

clear of all data associated to histogram

Note
histogram parameters are not cleared (see clear method)

◆ getFirstValue()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::BaseHistogram::getFirstValue ( ) const

retrieve first value for histogram

Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false

◆ getLastValue()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::BaseHistogram::getLastValue ( ) const

retrieve last value for histogram

Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false

◆ getLowerBound()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::BaseHistogram::getLowerBound ( ) const

retrieve lower bound for histogram

Note
equals to getFirstValue()
Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false

◆ getUpperBound()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::BaseHistogram::getUpperBound ( ) const

retrieve upper bound for histogram

Note
equals to :
Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false

◆ getRange()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::BaseHistogram::getRange ( ) const

retrieve range for histogram

Note
returns :
Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false

◆ getBinWidth()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::BaseHistogram::getBinWidth ( ) const

retrieve bin width associated to histogram

Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false

◆ getNbClasses()

IPSDK_FORCEINLINE ipUInt32 ipsdk::math::BaseHistogram::getNbClasses ( ) const

retrieve number of classes associated to histogram

Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false

◆ getNbBins()

IPSDK_FORCEINLINE ipUInt32 ipsdk::math::BaseHistogram::getNbBins ( ) const

retrieve number of bins associated to histogram

Note
this value may differs from getNbClasses depending on predefined out of bounds policy
Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false

◆ getLowerOutOfBoundsBinIdx()

IPSDK_FORCEINLINE ipUInt32 ipsdk::math::BaseHistogram::getLowerOutOfBoundsBinIdx ( ) const

retrieve bin index associated to lower out of bounds data

Returns
NumericLimits<ipUInt32>::max() if value is not used
Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false

◆ getUpperOutOfBoundsBinIdx()

IPSDK_FORCEINLINE ipUInt32 ipsdk::math::BaseHistogram::getUpperOutOfBoundsBinIdx ( ) const

retrieve bin index associated to upper out of bounds data

Returns
NumericLimits<ipUInt32>::max() if value is not used
Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false

◆ getInBoundsBinOffset()

IPSDK_FORCEINLINE ipUInt32 ipsdk::math::BaseHistogram::getInBoundsBinOffset ( ) const

retrieve index associated to first in bounds data

Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false

◆ getHistogramPopulation()

IPSDK_FORCEINLINE const UInt64Vector & ipsdk::math::BaseHistogram::getHistogramPopulation ( ) const

access to data collection associated to histogram

Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false

◆ getTotalPopulation()

IPSDK_FORCEINLINE ipUInt64 ipsdk::math::BaseHistogram::getTotalPopulation ( ) const

retrieve total population for histogram

Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false

◆ getBinStartValue()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::BaseHistogram::getBinStartValue ( const ipUInt32  binIdx) const

retrieve starting value for a given histogram bin

Note
return value in case of out of bounds bins is computed has standard bins with respect to their bin index
Exceptions
ipsdk::math::IPSDKMathExceptionif binIdx >= getNbBins()

◆ getBinMidValue()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::BaseHistogram::getBinMidValue ( const ipUInt32  binIdx) const

retrieve mid value for a given histogram bin

Note
mid value of bin associated to last class is set to mean of its starting value and _lastHistoValue
return value in case of out of bounds bins is computed has standard bins with respect to their bin index
Exceptions
ipsdk::math::IPSDKMathExceptionif binIdx >= getNbBins()

◆ getBinEndValue()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::BaseHistogram::getBinEndValue ( const ipUInt32  binIdx) const

retrieve ending value for a given histogram bin

Note
end value of bin associated to last class is set to _lastHistoValue
return value in case of out of bounds bins is computed has standard bins with respect to their bin index
Exceptions
ipsdk::math::IPSDKMathExceptionif binIdx >= getNbBins()

◆ getClassStartValue()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::BaseHistogram::getClassStartValue ( const ipUInt32  classIdx) const

retrieve starting value for a given histogram class

Exceptions
ipsdk::math::IPSDKMathExceptionif classIdx >= getNbClasses()

◆ getClassMidValue()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::BaseHistogram::getClassMidValue ( const ipUInt32  classIdx) const

retrieve mid value for a given histogram class

Note
mid value of last class is set to mean of its starting value and _lastHistoValue
Exceptions
ipsdk::math::IPSDKMathExceptionif classIdx >= getNbClasses()

◆ getClassEndValue()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::BaseHistogram::getClassEndValue ( const ipUInt32  classIdx) const

retrieve ending value for a given histogram class

Note
end value of last class is set to _lastHistoValue
Exceptions
ipsdk::math::IPSDKMathExceptionif classIdx >= getNbClasses()

◆ getClassPopulation()

IPSDK_FORCEINLINE ipUInt64 ipsdk::math::BaseHistogram::getClassPopulation ( const ipUInt32  classIdx) const

access to population for a given class index

Exceptions
ipsdk::math::IPSDKMathExceptionif classIdx >= getNbClasses()

◆ getClassFrequency()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::BaseHistogram::getClassFrequency ( const ipUInt32  classIdx) const

access to frequency for a given class index

Exceptions
ipsdk::math::IPSDKMathExceptionif classIdx >= getNbClasses()

◆ getClassCumulatedPopulation()

IPSDK_FORCEINLINE ipUInt64 ipsdk::math::BaseHistogram::getClassCumulatedPopulation ( const ipUInt32  classIdx) const

access to cumulated population for a given class index

Exceptions
ipsdk::math::IPSDKMathExceptionif classIdx >= getNbClasses()

◆ getClassCumulatedFrequency()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::BaseHistogram::getClassCumulatedFrequency ( const ipUInt32  classIdx) const

access to cumulated frequency for a given class index

Exceptions
ipsdk::math::IPSDKMathExceptionif classIdx >= getNbClasses()

◆ isOutOfBounds()

IPSDK_FORCEINLINE ipBool ipsdk::math::BaseHistogram::isOutOfBounds ( const ipReal64  value) const

method allowing to check whether a given input value is out of histogram bounds

Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false

◆ isOutOfLowerBound()

IPSDK_FORCEINLINE ipBool ipsdk::math::BaseHistogram::isOutOfLowerBound ( const ipReal64  value) const

method allowing to check whether a given input value is lower than histogram lower bound

Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false

◆ isOutOfUpperBound()

IPSDK_FORCEINLINE ipBool ipsdk::math::BaseHistogram::isOutOfUpperBound ( const ipReal64  value) const

method allowing to check whether a given input value is greater than histogram upper bound

Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false

◆ canBeAggregated()

IPSDK_FORCEINLINE ipBool ipsdk::math::BaseHistogram::canBeAggregated ( const ipReal64  value) const

method allowing to check whether a value can be aggregated to histogram data regards to histogram range and an out of bounds policy

Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false

◆ getBinIdx()

IPSDK_FORCEINLINE ipUInt32 ipsdk::math::BaseHistogram::getBinIdx ( const ipReal64  value) const

retrieve histogram bin index associated to a given input value

Note
return ipsdk::NumericLimits<ipUInt32>::max() if canBeAggregated(value) == false
Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false

◆ getPopulation()

IPSDK_FORCEINLINE ipUInt64 ipsdk::math::BaseHistogram::getPopulation ( const ipReal64  value) const

retrieve histogram population for a given value

Note
return ipsdk::NumericLimits<ipUInt64>::max() if canBeAggregated(value) == false

◆ getFrequency()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::BaseHistogram::getFrequency ( const ipReal64  value) const

retrieve histogram frequency for a given value

Note
return 0 if canBeAggregated(value) == false

◆ getCumulatedPopulation()

IPSDK_FORCEINLINE ipUInt64 ipsdk::math::BaseHistogram::getCumulatedPopulation ( const ipReal64  value) const

retrieve histogram cumulated population for a given value

Note
return ipsdk::NumericLimits<ipUInt64>::max() if canBeAggregated(value) == false

◆ getCumulatedFrequency()

IPSDK_FORCEINLINE ipReal64 ipsdk::math::BaseHistogram::getCumulatedFrequency ( const ipReal64  value) const

retrieve histogram cumulated frequency for a given value

Note
return 0 if canBeAggregated(value) == false

◆ getQuantileClassIdx()

ipUInt32 ipsdk::math::BaseHistogram::getQuantileClassIdx ( const ipReal64  quantileValue) const

retrieve class index associated to a given quantile value

Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false
ipsdk::math::IPSDKMathExceptionif quantileValue < 0 || quantileValue > 1

◆ getMaxPopulationClassIdx()

ipUInt32 ipsdk::math::BaseHistogram::getMaxPopulationClassIdx ( ) const

retrieve class index associated to maximum population

Exceptions
ipsdk::math::IPSDKMathExceptionif isInit() == false

◆ findLocalMaxima()

UInt32Vector ipsdk::math::BaseHistogram::findLocalMaxima ( const bool  bStrictExtrema = true,
const eExtremaBorderPolicy extremaBorderPolicy = eExtremaBorderPolicy::eEBP_Keeped,
const ipReal64  minDistance = 0,
const ipUInt64  populationThreshold = 0 
) const

function allowing to retrieve local maxima associated to histogram

Parameters
bStrictExtremaspecify whether extrema must be strict
extremaBorderPolicyborder policy used for processing (note that eExtremaBorderPolicy::eEBP_MakeRing can be used to handle angular continuity problems)
minDistanceminimum distance between extrema expressed with respect to bin coordinates
populationThresholdthreshold on extrema value (ie. on associated bin population)
Returns
collection of class indexes for local strict maxima

◆ findLocalMinima()

UInt32Vector ipsdk::math::BaseHistogram::findLocalMinima ( const bool  bStrictExtrema = true,
const eExtremaBorderPolicy extremaBorderPolicy = eExtremaBorderPolicy::eEBP_Keeped,
const ipReal64  minDistance = 0,
const ipUInt64  populationThreshold = NumericLimitsipUInt64 >::max() 
) const

function allowing to retrieve local minima associated to histogram

Parameters
bStrictExtremaspecify whether extrema must be strict
extremaBorderPolicyborder policy used for processing (note that eExtremaBorderPolicy::eEBP_MakeRing can be used to handle angular continuity problems)
minDistanceminimum distance between extrema expressed with respect to bin coordinates
populationThresholdthreshold on extrema value (ie. on associated bin population)
Returns
collection of class indexes for local strict minima

◆ findLocalDilatedMaxima()

HistogramExtremaColl ipsdk::math::BaseHistogram::findLocalDilatedMaxima ( const ipUInt64  dilateFactor,
const eExtremaBorderPolicy extremaBorderPolicy = eExtremaBorderPolicy::eEBP_Keeped,
const ipReal64  minDistance = 0,
const ipUInt64  populationThreshold = 0 
) const

function allowing to retrieve local dilated maxima associated to histogram

dilateLocalExtremaGraph.png
Parameters
dilateFactordilation factor used to merge local extrema neighbors
extremaBorderPolicyborder policy used for processing (note that eExtremaBorderPolicy::eEBP_MakeRing can be used to handle angular continuity problems)
minDistanceminimum distance between extrema expressed with respect to bin coordinates
populationThresholdthreshold on extrema value (ie. on associated bin population)
Returns
collection of information on found extrema
Note
Note that on output (and during processings), populations associated to extrema are equal to the sum of neighbors population around dilated extrema

◆ findLocalDilatedMinima()

HistogramExtremaColl ipsdk::math::BaseHistogram::findLocalDilatedMinima ( const ipUInt64  dilateFactor,
const eExtremaBorderPolicy extremaBorderPolicy = eExtremaBorderPolicy::eEBP_Keeped,
const ipReal64  minDistance = 0,
const ipUInt64  populationThreshold = NumericLimitsipUInt64 >::max() 
) const

function allowing to retrieve local dilated minima associated to histogram (see BaseHistogram::findLocalDilatedMaxima for an illustration of dilation process)

Parameters
dilateFactordilation factor used to merge local extrema neighbors
extremaBorderPolicyborder policy used for processing (note that eExtremaBorderPolicy::eEBP_MakeRing can be used to handle angular continuity problems)
minDistanceminimum distance between extrema expressed with respect to bin coordinates
populationThresholdthreshold on extrema value (ie. on associated bin population)
Returns
collection of information on found extrema
Note
Note that on output (and during processings), populations associated to extrema are equal to the sum of neighbors population around dilated extrema

◆ fitGaussianCurve()

HistogramGaussianCurveFit ipsdk::math::BaseHistogram::fitGaussianCurve ( const EstimationConfig config = createNonRobustConfig(),
const bool  bIncludeOutOfBoundsData = false 
) const

function allowing to fit a gaussian curve on histogram data Fitted gaussian curve is defined as follow :

\[ \begin{cases} G:\Re \rightarrow \Re \\ y = G(X) = Ae^{-\frac{(x-\mu)^2}{2\sigma^2}} \end{cases} \text{where} \begin{cases} x & \text{bin population}\\ y & \text{bin mid value} \\ \end{cases} \]

Warning
check estimation results status before using associated estimation results

◆ applyKMeansClustering()

clustering::KMeansClusteringPtr ipsdk::math::BaseHistogram::applyKMeansClustering ( const ipUInt32  nbClusters,
const bool  bIncludeOutOfBoundsData = false,
const clustering::KMeansClusteringConfig clusteringConfig = clustering::KMeansClusteringConfig() 
) const

function allowing to apply K-Means clustering algorithm with K-Means++ initialization on histogram data

Warning
check clustering status before using associated results
Exceptions
ipsdk::math::IPSDKMathExceptionif
  • nbClusters > getNbClasses() && bIncludeOutOfBoundsData == false
  • nbClusters > getNbBins() && bIncludeOutOfBoundsData == true

◆ applyKernelKMeansClustering()

template<typename KernelType >
boost::shared_ptr<clustering::KernelKMeansClustering<KernelType> > ipsdk::math::BaseHistogram::applyKernelKMeansClustering ( const ipUInt32  nbClusters,
const KernelType &  kernel,
const bool  bIncludeOutOfBoundsData = false,
const clustering::KernelKMeansClusteringConfig clusteringConfig = clustering::KernelKMeansClusteringConfig() 
) const

function allowing to apply Kernel K-Means clustering algorithm

Warning
check clustering status before using associated results
Exceptions
ipsdk::math::IPSDKMathExceptionif
  • nbClusters > getNbClasses() && bIncludeOutOfBoundsData == false
  • nbClusters > getNbBins() && bIncludeOutOfBoundsData == true

◆ applySpectralClustering()

template<typename KernelType >
boost::shared_ptr<clustering::SpectralClustering<KernelType> > ipsdk::math::BaseHistogram::applySpectralClustering ( const ipUInt32  nbClusters,
const KernelType &  kernel,
const bool  bIncludeOutOfBoundsData = false,
const clustering::KernelKMeansClusteringConfig clusteringConfig = clustering::KernelKMeansClusteringConfig() 
) const

function allowing to apply spectral clustering algorithm

Warning
check clustering status before using associated results
Exceptions
ipsdk::math::IPSDKMathExceptionif
  • nbClusters > getNbClasses() && bIncludeOutOfBoundsData == false
  • nbClusters > getNbBins() && bIncludeOutOfBoundsData == true

◆ checkInit()

void ipsdk::math::BaseHistogram::checkInit ( ) const
protected

method allowing to throw an exception in case where histogram has not been initialized

◆ updateHistogramParams() [1/2]

void ipsdk::math::BaseHistogram::updateHistogramParams ( const ipReal64  firstHistoValue,
const ipReal64  lastHistoValue,
const ipReal64  binWidth,
const eHistogramOutOfBoundsPolicy outOfBoundsPolicy 
)
protected

method allowing to update histogram parameters

Exceptions
ipsdk::math::IPSDKMathExceptionif firstHistoValue >= lastHistoValue
ipsdk::math::IPSDKMathExceptionif binWidth <= 0

◆ updateHistogramParams() [2/2]

void ipsdk::math::BaseHistogram::updateHistogramParams ( const ipReal64  firstHistoValue,
const ipReal64  lastHistoValue,
const ipUInt32  nbClasses,
const eHistogramOutOfBoundsPolicy outOfBoundsPolicy 
)
protected

method allowing to update histogram parameters

Exceptions
ipsdk::math::IPSDKMathExceptionif firstHistoValue >= lastHistoValue
ipsdk::math::IPSDKMathExceptionif nbClasses == 0

◆ insertDataInternal()

IPSDK_FORCEINLINE ipBool ipsdk::math::BaseHistogram::insertDataInternal ( const ipReal64  value)
protected

insertion of data into histogram

Returns
true if data has been successfully inserted

The documentation for this class was generated from the following file: