OTB
9.0.0
Orfeo Toolbox
|
#include <otbSEMClassifier.h>
This class implements the Stochastic Expectation Maximization algorithm to perform an estimation of a mixture model.
The first template argument is the type of the target sample data. This estimator expects one or more model component objects of the classes derived from the ModelComponentBase. The actual component (or module) parameters are updated by each component. Users can think this class as a strategy or a integration point for the SEM procedure.
The number of classes (SetNumberOfClasses), the initial proportion (SetInitialProportions), the input sample (SetSample), the model components (AddComponent), and the maximum iteration (SetMaximumIteration) are required. The SEM procedure terminates when the current iteration reaches the maximum iteration or the model parameters converge.
The difference from ExpectationMaximizationMixtureModelEstimator is that SEMClassifier include the maximum a posteriori decision on each sample. The class is to be seen as a classification and not an estimator.
Recent API changes: N/A
Definition at line 64 of file otbSEMClassifier.h.
typedef unsigned int otb::SEMClassifier< TInputImage, TOutputImage >::ClassLabelType |
Type of the segmentation vector
Definition at line 86 of file otbSEMClassifier.h.
typedef std::vector<ClassLabelType> otb::SEMClassifier< TInputImage, TOutputImage >::ClassLabelVectorType |
Termination status after running optimization
Definition at line 87 of file otbSEMClassifier.h.
typedef itk::Statistics::Subsample<SampleType> otb::SEMClassifier< TInputImage, TOutputImage >::ClassSampleType |
Termination status after running optimization
Definition at line 80 of file otbSEMClassifier.h.
typedef ComponentType::Pointer otb::SEMClassifier< TInputImage, TOutputImage >::ComponentPointerType |
Termination status after running optimization
Definition at line 96 of file otbSEMClassifier.h.
typedef otb::Statistics::ModelComponentBase<ClassSampleType> otb::SEMClassifier< TInputImage, TOutputImage >::ComponentType |
Type of the mixture model component base class. Due to the stochastic purpose, the initial list of sample (from TInputImage) is duplicated as many times as the number of classes (into SampleLists).
Definition at line 95 of file otbSEMClassifier.h.
typedef std::vector<ComponentPointerType> otb::SEMClassifier< TInputImage, TOutputImage >::ComponentVectorType |
Type of the component pointer storage, one component per class
Definition at line 100 of file otbSEMClassifier.h.
typedef itk::SmartPointer<const Self> otb::SEMClassifier< TInputImage, TOutputImage >::ConstPointer |
Definition at line 71 of file otbSEMClassifier.h.
typedef SampleType::MeasurementType otb::SEMClassifier< TInputImage, TOutputImage >::MeasurementType |
Termination status after running optimization
Definition at line 82 of file otbSEMClassifier.h.
typedef SampleType::MeasurementVectorType otb::SEMClassifier< TInputImage, TOutputImage >::MeasurementVectorType |
Termination status after running optimization
Definition at line 83 of file otbSEMClassifier.h.
typedef itk::Statistics::MembershipSample<SampleType> otb::SEMClassifier< TInputImage, TOutputImage >::OutputType |
Output type for GetClassSample method
Definition at line 90 of file otbSEMClassifier.h.
typedef itk::Array<double> otb::SEMClassifier< TInputImage, TOutputImage >::ParameterType |
type of the parameters needed for the component vectors
Definition at line 103 of file otbSEMClassifier.h.
typedef std::vector<ParameterType> otb::SEMClassifier< TInputImage, TOutputImage >::ParameterVectorType |
Type of the parameter pointer storage, one parameter set per class
Definition at line 106 of file otbSEMClassifier.h.
typedef itk::SmartPointer<Self> otb::SEMClassifier< TInputImage, TOutputImage >::Pointer |
Definition at line 70 of file otbSEMClassifier.h.
typedef std::vector<ProbaVectorType> otb::SEMClassifier< TInputImage, TOutputImage >::ProbaByClassVectorType |
Type of the probability values of each sample per class
Definition at line 113 of file otbSEMClassifier.h.
typedef std::vector<double> otb::SEMClassifier< TInputImage, TOutputImage >::ProbaVectorType |
Termination status after running optimization
Definition at line 110 of file otbSEMClassifier.h.
typedef std::vector<double> otb::SEMClassifier< TInputImage, TOutputImage >::ProportionVectorType |
Type of the vector of the probability values for each sample
Definition at line 109 of file otbSEMClassifier.h.
typedef itk::Statistics::ListSample<typename TInputImage::PixelType> otb::SEMClassifier< TInputImage, TOutputImage >::SampleType |
TSample template argument related typedefs
Definition at line 75 of file otbSEMClassifier.h.
typedef SEMClassifier otb::SEMClassifier< TInputImage, TOutputImage >::Self |
Standard class typedef
Definition at line 68 of file otbSEMClassifier.h.
typedef itk::Statistics::SampleClassifierFilter<typename itk::Statistics::ListSample<typename TInputImage::PixelType> > otb::SEMClassifier< TInputImage, TOutputImage >::Superclass |
Definition at line 69 of file otbSEMClassifier.h.
enum otb::SEMClassifier::TerminationCodeType |
Termination status after running optimization
Enumerator | |
---|---|
CONVERGED | |
NOT_CONVERGED |
Definition at line 165 of file otbSEMClassifier.h.
|
protected |
Termination status after running optimization
Definition at line 41 of file otbSEMClassifier.hxx.
|
inlineoverrideprotected |
Termination status after running optimization
Definition at line 187 of file otbSEMClassifier.h.
int otb::SEMClassifier< TInputImage, TOutputImage >::AddComponent | ( | int | id, |
ComponentType * | component | ||
) |
Adds a new component (or class). Has to be called after SetNumberOfClasses
Definition at line 244 of file otbSEMClassifier.hxx.
virtual::itk::LightObject::Pointer otb::SEMClassifier< TInputImage, TOutputImage >::CreateAnother | ( | void | ) | const |
Termination status after running optimization
SEMClassifier< TInputImage, TOutputImage >::ClassLabelVectorType & otb::SEMClassifier< TInputImage, TOutputImage >::GetClassLabels |
Termination status after running optimization
Definition at line 192 of file otbSEMClassifier.hxx.
int otb::SEMClassifier< TInputImage, TOutputImage >::GetCurrentIteration |
Gets the current iteration.
Definition at line 238 of file otbSEMClassifier.hxx.
|
virtual |
Termination status after running optimization
|
protected |
Make Decision through a Maximum a posteriori
Definition at line 525 of file otbSEMClassifier.hxx.
|
virtual |
Termination status after running optimization
|
virtual |
Standard macros
int otb::SEMClassifier< TInputImage, TOutputImage >::GetNeighborhood |
Termination status after running optimization
Definition at line 81 of file otbSEMClassifier.hxx.
SEMClassifier< TInputImage, TOutputImage >::OutputType * otb::SEMClassifier< TInputImage, TOutputImage >::GetOutput |
Termination status after running optimization
Definition at line 270 of file otbSEMClassifier.hxx.
TOutputImage * otb::SEMClassifier< TInputImage, TOutputImage >::GetOutputImage |
Termination status after running optimization
Definition at line 264 of file otbSEMClassifier.hxx.
|
virtual |
Gets the result proportion values
const TInputImage * otb::SEMClassifier< TInputImage, TOutputImage >::GetSample |
Returns the target data
Definition at line 226 of file otbSEMClassifier.hxx.
SEMClassifier< TInputImage, TOutputImage >::SampleType * otb::SEMClassifier< TInputImage, TOutputImage >::GetSampleList |
Termination status after running optimization
Definition at line 232 of file otbSEMClassifier.hxx.
|
virtual |
Gets the termination status
|
virtual |
Termination status after running optimization
|
protected |
Initialize the first segmentation, either randomly or by using a ClassLabelVectorType given in SetClassLabels.
Definition at line 276 of file otbSEMClassifier.hxx.
References otbMsgDebugMacro, and otbMsgDevMacro.
|
override |
Termination status after running optimization
Definition at line 253 of file otbSEMClassifier.hxx.
References otbMsgDebugMacro.
|
static |
Termination status after running optimization
|
protected |
Estimation part of the SEM
Definition at line 403 of file otbSEMClassifier.hxx.
|
protected |
Maximization part of the SEM. This method should be upgraded this a contextual point of view... It required to a Neighborhood knowledge into the TSample type...
Definition at line 454 of file otbSEMClassifier.hxx.
|
protected |
Stochastic part of the SEM
Definition at line 361 of file otbSEMClassifier.hxx.
References otbMsgDebugMacro.
|
overrideprotected |
Termination status after running optimization
Definition at line 58 of file otbSEMClassifier.hxx.
void otb::SEMClassifier< TInputImage, TOutputImage >::SetClassLabels | ( | OutputType * | labels | ) |
Set/Gets the initial segmentation. the size of the vector should be the same as the number of samples (length of MeasurementVector)
Definition at line 94 of file otbSEMClassifier.hxx.
References otbMsgDebugMacro.
void otb::SEMClassifier< TInputImage, TOutputImage >::SetClassLabels | ( | TOutputImage * | imgLabels | ) |
Termination status after running optimization
Definition at line 139 of file otbSEMClassifier.hxx.
References otbMsgDebugMacro.
void otb::SEMClassifier< TInputImage, TOutputImage >::SetInitialProportions | ( | ProportionVectorType & | proportions | ) |
Set/Gets the initial proportion values. The size of proportion vector should be same as the number of component (or classes). Choose between SetInitialProportions, SetClassLabels or SetNumberOfComponents
Definition at line 87 of file otbSEMClassifier.hxx.
|
virtual |
Set/Gets the maximum number of iterations. When the optimization process reaches the maximum number of iterations, even if the class parameters aren't converged, the optimization process stops.
void otb::SEMClassifier< TInputImage, TOutputImage >::SetNeighborhood | ( | int | neighborhood | ) |
Set/Gets the neighborhood to take into consideration in the contextual decision rule. Should be odd (def. 3).
Definition at line 73 of file otbSEMClassifier.hxx.
void otb::SEMClassifier< TInputImage, TOutputImage >::SetSample | ( | const TInputImage * | sample | ) |
Sets the target data that will be classified by this
Definition at line 198 of file otbSEMClassifier.hxx.
|
virtual |
Set/Get the termination threshold (ratio of the number of sample that change affected class during iteration over the total number of samples (def is 1E-5)
|
override |
Runs the optimization process.
Definition at line 571 of file otbSEMClassifier.hxx.
|
private |
Termination status after running optimization
Definition at line 227 of file otbSEMClassifier.h.
|
mutableprivate |
Termination status after running optimization
Definition at line 230 of file otbSEMClassifier.h.
|
mutableprivate |
Termination status after running optimization
Definition at line 223 of file otbSEMClassifier.h.
|
private |
Termination status after running optimization
Definition at line 217 of file otbSEMClassifier.h.
|
private |
Termination status after running optimization
Definition at line 229 of file otbSEMClassifier.h.
|
private |
Termination status after running optimization
Definition at line 224 of file otbSEMClassifier.h.
|
private |
Termination status after running optimization
Definition at line 216 of file otbSEMClassifier.h.
|
private |
Termination status after running optimization
Definition at line 218 of file otbSEMClassifier.h.
|
private |
Termination status after running optimization
Definition at line 213 of file otbSEMClassifier.h.
|
private |
Termination status after running optimization
Definition at line 220 of file otbSEMClassifier.h.
|
private |
Termination status after running optimization
Definition at line 233 of file otbSEMClassifier.h.
|
private |
Termination status after running optimization
Definition at line 232 of file otbSEMClassifier.h.
|
private |
Termination status after running optimization
Definition at line 226 of file otbSEMClassifier.h.
|
private |
Termination status after running optimization
Definition at line 225 of file otbSEMClassifier.h.
|
private |
Target data sample pointer
Definition at line 212 of file otbSEMClassifier.h.
|
private |
Termination status after running optimization
Definition at line 214 of file otbSEMClassifier.h.
|
private |
Termination status after running optimization
Definition at line 222 of file otbSEMClassifier.h.
|
private |
Termination status after running optimization
Definition at line 219 of file otbSEMClassifier.h.