OTB  9.0.0
Orfeo Toolbox
Public Types | Public Member Functions | Static Public Member Functions | List of all members
otb::SampleAugmentationFilter Class Reference

#include <otbSampleAugmentationFilter.h>

+ Inheritance diagram for otb::SampleAugmentationFilter:
+ Collaboration diagram for otb::SampleAugmentationFilter:

Public Types

typedef itk::SmartPointer< const SelfConstPointer
 
typedef itk::ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType
 
typedef OGRDataSourceType::Pointer OGRDataSourcePointerType
 
typedef ogr::DataSource OGRDataSourceType
 
typedef ogr::Layer OGRLayerType
 
typedef itk::SmartPointer< SelfPointer
 
using SampleType = sampleAugmentation::SampleType
 
using SampleVectorType = sampleAugmentation::SampleVectorType
 
typedef SampleAugmentationFilter Self
 
enum  Strategy {
  Strategy::Replicate,
  Strategy::Jitter,
  Strategy::Smote
}
 
typedef itk::ProcessObject Superclass
 

Public Member Functions

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

Static Public Member Functions

static Pointer New ()
 
typedef itk::DataObject::Pointer DataObjectPointer
 
std::string m_ClassFieldName
 
vcl_size_t m_Layer
 
int m_Label
 
std::vector< std::string > m_ExcludedFields
 
Strategy m_Strategy
 
int m_NumberOfSamples
 
double m_StdFactor
 
vcl_size_t m_SmoteNeighbors
 
int m_Seed
 
virtual void SetInput (const OGRDataSourceType *ds)
 
const OGRDataSourceTypeGetInput (unsigned int idx)
 
virtual void SetOutputSamples (ogr::DataSource *data)
 
virtual void SetClassFieldName (std::string _arg)
 
virtual std::string GetClassFieldName ()
 
virtual void SetLayer (vcl_size_t _arg)
 
virtual vcl_size_t GetLayer ()
 
virtual void SetLabel (int _arg)
 
virtual int GetLabel ()
 
void SetStrategy (Strategy s)
 
Strategy GetStrategy () const
 
virtual void SetNumberOfSamples (int _arg)
 
virtual int GetNumberOfSamples ()
 
void SetExcludedFields (const std::vector< std::string > &ef)
 
std::vector< std::string > GetExcludedFields () const
 
virtual void SetStdFactor (double _arg)
 
virtual double GetStdFactor ()
 
virtual void SetSmoteNeighbors (vcl_size_t _arg)
 
virtual vcl_size_t GetSmoteNeighbors ()
 
virtual void SetSeed (int _arg)
 
virtual int GetSeed ()
 
const OGRDataSourceTypeGetOutput ()
 
 SampleAugmentationFilter ()
 
 ~SampleAugmentationFilter () override
 
void GenerateData () override
 
DataObjectPointer MakeOutput (DataObjectPointerArraySizeType idx) override
 
SampleVectorType ExtractSamples (const ogr::DataSource::Pointer vectors, vcl_size_t layerName, const std::string &classField, const int label, const std::vector< std::string > &excludedFields={})
 
void SampleToOGRFeatures (const ogr::DataSource::Pointer &vectors, ogr::DataSource *output, const SampleVectorType &samples, const vcl_size_t layerName, const std::string &classField, int label, const std::vector< std::string > &excludedFields={})
 
std::set< vcl_size_t > GetExcludedFieldsIds (const std::vector< std::string > &excludedFields, const ogr::Layer &inputLayer)
 
bool IsNumericField (const ogr::Feature &feature, const int idx)
 
ogr::Feature SelectTemplateFeature (const ogr::Layer &inputLayer, const std::string &classField, int label)
 
 SampleAugmentationFilter (const Self &)=delete
 
void operator= (const Self &)=delete
 

Detailed Description

Filter to generate synthetic samples from existing ones.

This class generates synthetic samples from existing ones either by replication, jitter (adding gaussian noise to the features of existing samples) or SMOTE (linear combination of pairs neighbouring samples of the same class.

Definition at line 47 of file otbSampleAugmentationFilter.h.

Member Typedef Documentation

◆ ConstPointer

typedef itk::SmartPointer<const Self> otb::SampleAugmentationFilter::ConstPointer

Definition at line 54 of file otbSampleAugmentationFilter.h.

◆ DataObjectPointer

typedef itk::DataObject::Pointer otb::SampleAugmentationFilter::DataObjectPointer
protected

DataObject pointer

Definition at line 140 of file otbSampleAugmentationFilter.h.

◆ DataObjectPointerArraySizeType

typedef itk::ProcessObject::DataObjectPointerArraySizeType otb::SampleAugmentationFilter::DataObjectPointerArraySizeType

Definition at line 66 of file otbSampleAugmentationFilter.h.

◆ OGRDataSourcePointerType

Definition at line 63 of file otbSampleAugmentationFilter.h.

◆ OGRDataSourceType

Definition at line 60 of file otbSampleAugmentationFilter.h.

◆ OGRLayerType

Definition at line 64 of file otbSampleAugmentationFilter.h.

◆ Pointer

typedef itk::SmartPointer<Self> otb::SampleAugmentationFilter::Pointer

Definition at line 53 of file otbSampleAugmentationFilter.h.

◆ SampleType

Definition at line 68 of file otbSampleAugmentationFilter.h.

◆ SampleVectorType

Definition at line 69 of file otbSampleAugmentationFilter.h.

◆ Self

typedef for the classes standards.

Definition at line 51 of file otbSampleAugmentationFilter.h.

◆ Superclass

typedef itk::ProcessObject otb::SampleAugmentationFilter::Superclass

Definition at line 52 of file otbSampleAugmentationFilter.h.

Member Enumeration Documentation

◆ Strategy

Enumerator
Replicate 
Jitter 
Smote 

Definition at line 71 of file otbSampleAugmentationFilter.h.

Constructor & Destructor Documentation

◆ SampleAugmentationFilter() [1/2]

otb::SampleAugmentationFilter::SampleAugmentationFilter ( )
protected

DataObject pointer

◆ ~SampleAugmentationFilter()

otb::SampleAugmentationFilter::~SampleAugmentationFilter ( )
inlineoverrideprotected

DataObject pointer

Definition at line 132 of file otbSampleAugmentationFilter.h.

◆ SampleAugmentationFilter() [2/2]

otb::SampleAugmentationFilter::SampleAugmentationFilter ( const Self )
privatedelete

DataObject pointer

Member Function Documentation

◆ CreateAnother()

virtual::itk::LightObject::Pointer otb::SampleAugmentationFilter::CreateAnother ( void  ) const

◆ ExtractSamples()

SampleVectorType otb::SampleAugmentationFilter::ExtractSamples ( const ogr::DataSource::Pointer  vectors,
vcl_size_t  layerName,
const std::string &  classField,
const int  label,
const std::vector< std::string > &  excludedFields = {} 
)
protected

DataObject pointer

◆ GenerateData()

void otb::SampleAugmentationFilter::GenerateData ( )
overrideprotected

Generate Data method

◆ GetClassFieldName()

virtual std::string otb::SampleAugmentationFilter::GetClassFieldName ( )
virtual

Return the Field name in which labels have been written.

◆ GetExcludedFields()

std::vector<std::string> otb::SampleAugmentationFilter::GetExcludedFields ( ) const
inline

DataObject pointer

Definition at line 115 of file otbSampleAugmentationFilter.h.

◆ GetExcludedFieldsIds()

std::set<vcl_size_t> otb::SampleAugmentationFilter::GetExcludedFieldsIds ( const std::vector< std::string > &  excludedFields,
const ogr::Layer inputLayer 
)
protected

DataObject pointer

◆ GetInput()

const OGRDataSourceType* otb::SampleAugmentationFilter::GetInput ( unsigned int  idx)

DataObject pointer

◆ GetLabel()

virtual int otb::SampleAugmentationFilter::GetLabel ( )
virtual

DataObject pointer

◆ GetLayer()

virtual vcl_size_t otb::SampleAugmentationFilter::GetLayer ( )
virtual

DataObject pointer

◆ GetNameOfClass()

virtual const char* otb::SampleAugmentationFilter::GetNameOfClass ( ) const
virtual

Return the name of the class.

◆ GetNumberOfSamples()

virtual int otb::SampleAugmentationFilter::GetNumberOfSamples ( )
virtual

DataObject pointer

◆ GetOutput()

const OGRDataSourceType* otb::SampleAugmentationFilter::GetOutput ( )

Get the output ogr::DataSource which is a "memory" datasource.

◆ GetSeed()

virtual int otb::SampleAugmentationFilter::GetSeed ( )
virtual

DataObject pointer

◆ GetSmoteNeighbors()

virtual vcl_size_t otb::SampleAugmentationFilter::GetSmoteNeighbors ( )
virtual

DataObject pointer

◆ GetStdFactor()

virtual double otb::SampleAugmentationFilter::GetStdFactor ( )
virtual

DataObject pointer

◆ GetStrategy()

Strategy otb::SampleAugmentationFilter::GetStrategy ( ) const
inline

DataObject pointer

Definition at line 105 of file otbSampleAugmentationFilter.h.

◆ IsNumericField()

bool otb::SampleAugmentationFilter::IsNumericField ( const ogr::Feature feature,
const int  idx 
)
protected

DataObject pointer

◆ MakeOutput()

DataObjectPointer otb::SampleAugmentationFilter::MakeOutput ( DataObjectPointerArraySizeType  idx)
overrideprotected

DataObject pointer

◆ New()

static Pointer otb::SampleAugmentationFilter::New ( )
static

Method for management of the object factory.

◆ operator=()

void otb::SampleAugmentationFilter::operator= ( const Self )
privatedelete

DataObject pointer

◆ SampleToOGRFeatures()

void otb::SampleAugmentationFilter::SampleToOGRFeatures ( const ogr::DataSource::Pointer vectors,
ogr::DataSource output,
const SampleVectorType samples,
const vcl_size_t  layerName,
const std::string &  classField,
int  label,
const std::vector< std::string > &  excludedFields = {} 
)
protected

DataObject pointer

◆ SelectTemplateFeature()

ogr::Feature otb::SampleAugmentationFilter::SelectTemplateFeature ( const ogr::Layer inputLayer,
const std::string &  classField,
int  label 
)
protected

DataObject pointer

◆ SetClassFieldName()

virtual void otb::SampleAugmentationFilter::SetClassFieldName ( std::string  _arg)
virtual

Set the Field Name in which labels will be written. (default is "class") A field "ClassFieldName" of type integer is created in the output memory layer.

◆ SetExcludedFields()

void otb::SampleAugmentationFilter::SetExcludedFields ( const std::vector< std::string > &  ef)
inline

DataObject pointer

Definition at line 111 of file otbSampleAugmentationFilter.h.

◆ SetInput()

virtual void otb::SampleAugmentationFilter::SetInput ( const OGRDataSourceType ds)
virtual

DataObject pointer

◆ SetLabel()

virtual void otb::SampleAugmentationFilter::SetLabel ( int  _arg)
virtual

DataObject pointer

◆ SetLayer()

virtual void otb::SampleAugmentationFilter::SetLayer ( vcl_size_t  _arg)
virtual

DataObject pointer

◆ SetNumberOfSamples()

virtual void otb::SampleAugmentationFilter::SetNumberOfSamples ( int  _arg)
virtual

DataObject pointer

◆ SetOutputSamples()

virtual void otb::SampleAugmentationFilter::SetOutputSamples ( ogr::DataSource data)
virtual

DataObject pointer

◆ SetSeed()

virtual void otb::SampleAugmentationFilter::SetSeed ( int  _arg)
virtual

DataObject pointer

◆ SetSmoteNeighbors()

virtual void otb::SampleAugmentationFilter::SetSmoteNeighbors ( vcl_size_t  _arg)
virtual

DataObject pointer

◆ SetStdFactor()

virtual void otb::SampleAugmentationFilter::SetStdFactor ( double  _arg)
virtual

DataObject pointer

◆ SetStrategy()

void otb::SampleAugmentationFilter::SetStrategy ( Strategy  s)
inline

DataObject pointer

Definition at line 101 of file otbSampleAugmentationFilter.h.

Member Data Documentation

◆ m_ClassFieldName

std::string otb::SampleAugmentationFilter::m_ClassFieldName
private

DataObject pointer

Definition at line 161 of file otbSampleAugmentationFilter.h.

◆ m_ExcludedFields

std::vector<std::string> otb::SampleAugmentationFilter::m_ExcludedFields
private

DataObject pointer

Definition at line 164 of file otbSampleAugmentationFilter.h.

◆ m_Label

int otb::SampleAugmentationFilter::m_Label
private

DataObject pointer

Definition at line 163 of file otbSampleAugmentationFilter.h.

◆ m_Layer

vcl_size_t otb::SampleAugmentationFilter::m_Layer
private

DataObject pointer

Definition at line 162 of file otbSampleAugmentationFilter.h.

◆ m_NumberOfSamples

int otb::SampleAugmentationFilter::m_NumberOfSamples
private

DataObject pointer

Definition at line 166 of file otbSampleAugmentationFilter.h.

◆ m_Seed

int otb::SampleAugmentationFilter::m_Seed
private

DataObject pointer

Definition at line 169 of file otbSampleAugmentationFilter.h.

◆ m_SmoteNeighbors

vcl_size_t otb::SampleAugmentationFilter::m_SmoteNeighbors
private

DataObject pointer

Definition at line 168 of file otbSampleAugmentationFilter.h.

◆ m_StdFactor

double otb::SampleAugmentationFilter::m_StdFactor
private

DataObject pointer

Definition at line 167 of file otbSampleAugmentationFilter.h.

◆ m_Strategy

Strategy otb::SampleAugmentationFilter::m_Strategy
private

DataObject pointer

Definition at line 165 of file otbSampleAugmentationFilter.h.


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