OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage > Class Template Reference

#include <otbKMeansImageClassificationFilter.h>

+ Inheritance diagram for otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >:
+ Collaboration diagram for otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >:

Public Types

typedef std::map< LabelType, SampleTypeCentroidsMapType
 
typedef itk::SmartPointer< const SelfConstPointer
 
typedef itk::Statistics::EuclideanDistanceMetric< SampleTypeDistanceType
 
typedef InputImageType::ConstPointer InputImageConstPointerType
 
typedef TInputImage InputImageType
 
typedef itk::Array< double > KMeansParametersType
 
typedef OutputImageType::PixelType LabelType
 
typedef MaskImageType::ConstPointer MaskImageConstPointerType
 
typedef MaskImageType::Pointer MaskImagePointerType
 
typedef TMaskImage MaskImageType
 
typedef OutputImageType::Pointer OutputImagePointerType
 
typedef OutputImageType::RegionType OutputImageRegionType
 
typedef TOutputImage OutputImageType
 
typedef itk::SmartPointer< SelfPointer
 
typedef itk::FixedArray< ValueType, MaxSampleDimensionSampleType
 
typedef KMeansImageClassificationFilter Self
 
typedef itk::InPlaceImageFilter< TInputImage, TOutputImage > Superclass
 
typedef InputImageType::InternalPixelType ValueType
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
 
virtual const char * GetNameOfClass () const
 

Static Public Member Functions

static Pointer New ()
 

Static Public Attributes

static const unsigned int MaxSampleDimension = VMaxSampleDimension
 
KMeansParametersType m_Centroids
 
LabelType m_DefaultLabel
 
CentroidsMapType m_CentroidsMap
 
virtual void SetCentroids (KMeansParametersType _arg)
 
virtual const KMeansParametersTypeGetCentroids () const
 
virtual void SetDefaultLabel (LabelType _arg)
 
virtual LabelType GetDefaultLabel ()
 
void SetInputMask (const MaskImageType *mask)
 
const MaskImageTypeGetInputMask (void)
 
 KMeansImageClassificationFilter ()
 
 ~KMeansImageClassificationFilter () override=default
 
void ThreadedGenerateData (const OutputImageRegionType &outputRegionForThread, itk::ThreadIdType threadId) override
 
void BeforeThreadedGenerateData () override
 
void PrintSelf (std::ostream &os, itk::Indent indent) const override
 
 KMeansImageClassificationFilter (const Self &)=delete
 
void operator= (const Self &)=delete
 

Detailed Description

template<class TInputImage, class TOutputImage, unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
class otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >

This filter performs the classification of a VectorImage using a KMeans estimation result.

This filter is streamed and threaded, allowing to classify huge images. Because the internal sample type has to be an itk::FixedArray, one must specify at compilation time the maximum sample dimension. It is up to the user to specify a MaxSampleDimension sufficiently high to integrate all its features. This filter internally use one SVMClassifier per thread.

See also
SVMClassifier

Definition at line 45 of file otbKMeansImageClassificationFilter.h.

Member Typedef Documentation

◆ CentroidsMapType

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
typedef std::map<LabelType, SampleType> otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::CentroidsMapType

Definition at line 81 of file otbKMeansImageClassificationFilter.h.

◆ ConstPointer

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
typedef itk::SmartPointer<const Self> otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::ConstPointer

Definition at line 52 of file otbKMeansImageClassificationFilter.h.

◆ DistanceType

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
typedef itk::Statistics::EuclideanDistanceMetric<SampleType> otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::DistanceType

Definition at line 82 of file otbKMeansImageClassificationFilter.h.

◆ InputImageConstPointerType

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
typedef InputImageType::ConstPointer otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::InputImageConstPointerType

Definition at line 67 of file otbKMeansImageClassificationFilter.h.

◆ InputImageType

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
typedef TInputImage otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::InputImageType

Definition at line 66 of file otbKMeansImageClassificationFilter.h.

◆ KMeansParametersType

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
typedef itk::Array<double> otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::KMeansParametersType

Definition at line 80 of file otbKMeansImageClassificationFilter.h.

◆ LabelType

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
typedef OutputImageType::PixelType otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::LabelType

Definition at line 77 of file otbKMeansImageClassificationFilter.h.

◆ MaskImageConstPointerType

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
typedef MaskImageType::ConstPointer otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::MaskImageConstPointerType

Definition at line 71 of file otbKMeansImageClassificationFilter.h.

◆ MaskImagePointerType

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
typedef MaskImageType::Pointer otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::MaskImagePointerType

Definition at line 72 of file otbKMeansImageClassificationFilter.h.

◆ MaskImageType

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
typedef TMaskImage otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::MaskImageType

Definition at line 70 of file otbKMeansImageClassificationFilter.h.

◆ OutputImagePointerType

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
typedef OutputImageType::Pointer otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::OutputImagePointerType

Definition at line 75 of file otbKMeansImageClassificationFilter.h.

◆ OutputImageRegionType

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
typedef OutputImageType::RegionType otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::OutputImageRegionType

Definition at line 76 of file otbKMeansImageClassificationFilter.h.

◆ OutputImageType

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
typedef TOutputImage otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::OutputImageType

Definition at line 74 of file otbKMeansImageClassificationFilter.h.

◆ Pointer

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
typedef itk::SmartPointer<Self> otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::Pointer

Definition at line 51 of file otbKMeansImageClassificationFilter.h.

◆ SampleType

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
typedef itk::FixedArray<ValueType, MaxSampleDimension> otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::SampleType

Definition at line 79 of file otbKMeansImageClassificationFilter.h.

◆ Self

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
typedef KMeansImageClassificationFilter otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::Self

Standard typedefs

Definition at line 49 of file otbKMeansImageClassificationFilter.h.

◆ Superclass

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
typedef itk::InPlaceImageFilter<TInputImage, TOutputImage> otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::Superclass

Definition at line 50 of file otbKMeansImageClassificationFilter.h.

◆ ValueType

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
typedef InputImageType::InternalPixelType otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::ValueType

Definition at line 68 of file otbKMeansImageClassificationFilter.h.

Constructor & Destructor Documentation

◆ KMeansImageClassificationFilter() [1/2]

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::KMeansImageClassificationFilter ( )
protected

Constructor

◆ ~KMeansImageClassificationFilter()

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::~KMeansImageClassificationFilter ( )
overrideprotecteddefault

Destructor

◆ KMeansImageClassificationFilter() [2/2]

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::KMeansImageClassificationFilter ( const Self )
privatedelete

Centroids used for classification

Member Function Documentation

◆ BeforeThreadedGenerateData()

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
void otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::BeforeThreadedGenerateData ( )
overrideprotected

Before threaded generate data

◆ CreateAnother()

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
virtual::itk::LightObject::Pointer otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::CreateAnother ( void  ) const

◆ GetCentroids()

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
virtual const KMeansParametersType& otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::GetCentroids ( ) const
virtual

Centroids used for classification

◆ GetDefaultLabel()

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
virtual LabelType otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::GetDefaultLabel ( )
virtual

Centroids used for classification

◆ GetInputMask()

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
const MaskImageType* otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::GetInputMask ( void  )

Get the input mask.

Returns
The mask.

◆ GetNameOfClass()

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
virtual const char* otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::GetNameOfClass ( ) const
virtual

Creation through object factory macro

◆ New()

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
static Pointer otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::New ( )
static

Type macro

◆ operator=()

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
void otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::operator= ( const Self )
privatedelete

Centroids used for classification

◆ PrintSelf()

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
void otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::PrintSelf ( std::ostream &  os,
itk::Indent  indent 
) const
overrideprotected

PrintSelf method

◆ SetCentroids()

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
virtual void otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::SetCentroids ( KMeansParametersType  _arg)
virtual

Set/Get the centroids

◆ SetDefaultLabel()

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
virtual void otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::SetDefaultLabel ( LabelType  _arg)
virtual

Set/Get the default label

◆ SetInputMask()

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
void otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::SetInputMask ( const MaskImageType mask)

If set, only pixels within the mask will be classified.

Parameters
maskThe input mask.

◆ ThreadedGenerateData()

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
void otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::ThreadedGenerateData ( const OutputImageRegionType outputRegionForThread,
itk::ThreadIdType  threadId 
)
overrideprotected

Threaded generate data

Member Data Documentation

◆ m_Centroids

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
KMeansParametersType otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::m_Centroids
private

Centroids used for classification

Definition at line 127 of file otbKMeansImageClassificationFilter.h.

◆ m_CentroidsMap

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
CentroidsMapType otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::m_CentroidsMap
private

Centroids - labels map

Definition at line 133 of file otbKMeansImageClassificationFilter.h.

◆ m_DefaultLabel

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
LabelType otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::m_DefaultLabel
private

Default label for invalid pixels (when using a mask)

Definition at line 130 of file otbKMeansImageClassificationFilter.h.

◆ MaxSampleDimension

template<class TInputImage , class TOutputImage , unsigned int VMaxSampleDimension = 10, class TMaskImage = TOutputImage>
const unsigned int otb::KMeansImageClassificationFilter< TInputImage, TOutputImage, VMaxSampleDimension, TMaskImage >::MaxSampleDimension = VMaxSampleDimension
static

The max dimension of the sample to classify. This filter internally uses itk::FixedArray as input for the classifier, so the max sample size has to be fixed at compilation time.

Definition at line 64 of file otbKMeansImageClassificationFilter.h.


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