#include <Surprise/SurpriseMap.H>
Public Member Functions | |
SurpriseMap () | |
Constructor; you must call init() before using. | |
void | init (const uint qlen=1, const double updatefac=0.7, const double neighupdatefac=0.7, const double sampleval=0.0, const double samplevar=1.0, const float neighsigma=0.5f, const float locsigma=3.0f, const Point2D< int > &probe=Point2D< int >(-1,-1), const double slfac=1.0, const double ssfac=0.1, const SU_KL_BIAS=SU_KL_NONE, const bool takeSTMax=false) |
initialization | |
~SurpriseMap () | |
Virtual destructor ensures proper destruction of derived classes. | |
void | reset () |
Reset to initial state. | |
void | initModels (const SurpriseImage< T > &sample, const bool setBias=false) |
reset and create empty surprise models for temporal surprise | |
Image< double > | surprise (const SurpriseImage< T > &sample) |
Update by receiving a new sample and sample measurement error. | |
const SurpriseImage< T > & | getSurpriseImage (const uint index) const |
Access to underlying SurpriseImage members: | |
template<> | |
Image< double > | surprise (const SurpriseImage< SurpriseModelPM > &sample) |
template<> | |
Image< double > | surprise (const SurpriseImage< SurpriseModelGG > &sample) |
A Surprise Map.
This class contains a SurpriseImage of our current models at each pixel, plus an ImageCache of SurpriseImage objects built to represent the neighborhood distributions.
Definition at line 57 of file SurpriseMap.H.
SurpriseMap< T >::SurpriseMap | ( | ) | [inline] |
Constructor; you must call init() before using.
Definition at line 46 of file SurpriseMap.C.
SurpriseMap< T >::~SurpriseMap | ( | ) | [inline] |
Virtual destructor ensures proper destruction of derived classes.
Definition at line 81 of file SurpriseMap.C.
const SurpriseImage< T > & SurpriseMap< T >::getSurpriseImage | ( | const uint | index | ) | const [inline] |
Access to underlying SurpriseImage members:
Definition at line 440 of file SurpriseMap.C.
References ASSERT.
void SurpriseMap< T >::init | ( | const uint | qlen = 1 , |
|
const double | updatefac = 0.7 , |
|||
const double | neighupdatefac = 0.7 , |
|||
const double | sampleval = 0.0 , |
|||
const double | samplevar = 1.0 , |
|||
const float | neighsigma = 0.5f , |
|||
const float | locsigma = 3.0f , |
|||
const Point2D< int > & | probe = Point2D<int>(-1, -1) , |
|||
const double | slfac = 1.0 , |
|||
const double | ssfac = 0.1 , |
|||
const SU_KL_BIAS | klbias = SU_KL_NONE , |
|||
const bool | takeSTMax = false | |||
) | [inline] |
initialization
qlen | number of maps | |
updatefac | factor by which the current model is combined with a new model on an update. Valid values are in [0..1] | |
neighupdatefac | factor by which local data is combined with neighborhood models, or 0.0 to use the value of updatefac | |
sampleval | the value of the samples previously received. | |
samplevar | a variance expressing the intrinsic variability in the measurement of those samples. | |
neighsigma | sigma to use for the neighborhoods as a fraction of max(map width, map height) | |
locsigma | sigma to use for local neighborhood, in pixels |
Definition at line 56 of file SurpriseMap.C.
References Image< T >::freeMem().
Referenced by SingleChannelSurprise< SMODEL >::start1().
void SurpriseMap< T >::initModels | ( | const SurpriseImage< T > & | sample, | |
const bool | setBias = false | |||
) | [inline] |
reset and create empty surprise models for temporal surprise
Definition at line 94 of file SurpriseMap.C.
References Image< T >::getDims(), Image< T >::getHeight(), getMinMax(), Image< T >::getWidth(), inplaceRectify(), and max().
Referenced by SurpriseMap< T >::surprise().
void SurpriseMap< T >::reset | ( | void | ) | [inline] |
Reset to initial state.
Definition at line 86 of file SurpriseMap.C.
Image< double > SurpriseMap< T >::surprise | ( | const SurpriseImage< T > & | sample | ) | [inline] |
Update by receiving a new sample and sample measurement error.
The returned image is the surprise (combined temporal and spatial for each map, then combined over all maps) resulting from that update. NOTE: SurpriseModelPM has a special implementation, other surprise models follow the generic template implementation.
Definition at line 304 of file SurpriseMap.C.
References Image< T >::coordsOk(), Image< T >::getDims(), SurpriseImage< T >::getMean(), Image< T >::getVal(), SurpriseImage< T >::getVar(), SurpriseMap< T >::initModels(), inplaceRectify(), SurpriseImage< T >::neighborhoods(), SurpriseImage< T >::resetUpdFac(), SurpriseImage< T >::surprise(), takeMax(), toPower(), and ZEROS.