OTB  9.0.0
Orfeo Toolbox
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel > Class Template Reference

#include <otbNeighborhoodMajorityVotingImageFilter.h>

+ Inheritance diagram for otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >:
+ Collaboration diagram for otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >:

Classes

struct  CompareHistoFequencies
 
struct  HistoSummary
 

Public Types

typedef itk::SmartPointer< const SelfConstPointer
 
typedef Superclass::DefaultBoundaryConditionType DefaultBoundaryConditionType
 
typedef Superclass::KernelIteratorType KernelIteratorType
 
typedef Superclass::KernelType KernelType
 
typedef Superclass::NeighborhoodIteratorType NeighborhoodIteratorType
 
typedef Superclass::PixelType PixelType
 
typedef itk::SmartPointer< SelfPointer
 
typedef NeighborhoodMajorityVotingImageFilter Self
 
typedef itk::MorphologyImageFilter< TInputImage, TOutputImage, TKernel > Superclass
 

Public Member Functions

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

Static Public Member Functions

static Pointer New ()
 
typedef TKernel::PixelType KernelPixelType
 
static const unsigned int InputImageDimension = TInputImage::ImageDimension
 
static const unsigned int OutputImageDimension = TOutputImage::ImageDimension
 
static const unsigned int KernelDimension = TKernel::NeighborhoodDimension
 
DefaultBoundaryConditionType m_MajorityVotingBoundaryCondition
 
PixelType m_LabelForNoDataPixels
 
PixelType m_LabelForUndecidedPixels
 
bool m_KeepOriginalLabelBool
 
bool m_OnlyIsolatedPixels
 
unsigned int m_IsolatedThreshold
 
 typedef (itk::Concept::Convertible< PixelType, typename TOutputImage::PixelType >) InputConvertibleToOutputCheck
 
 typedef (itk::Concept::SameDimension< InputImageDimension, OutputImageDimension >) SameDimensionCheck1
 
 typedef (itk::Concept::SameDimension< InputImageDimension, KernelDimension >) SameDimensionCheck2
 
 typedef (itk::Concept::GreaterThanComparable< PixelType >) InputGreaterThanComparableCheck
 
 typedef (itk::Concept::GreaterThanComparable< KernelPixelType >) KernelGreaterThanComparableCheck
 
virtual void SetLabelForNoDataPixels (const PixelType _arg)
 
virtual void SetLabelForUndecidedPixels (PixelType _arg)
 
virtual void SetKeepOriginalLabelBool (bool _arg)
 
virtual void SetOnlyIsolatedPixels (bool _arg)
 
virtual void SetIsolatedThreshold (unsigned int _arg)
 
 NeighborhoodMajorityVotingImageFilter ()
 
 ~NeighborhoodMajorityVotingImageFilter () override
 
PixelType Evaluate (const NeighborhoodIteratorType &nit, const KernelIteratorType kernelBegin, const KernelIteratorType kernelEnd) override
 
void GenerateOutputInformation () override
 
const HistoSummary ComputeNeighborhoodHistogramSummary (const NeighborhoodIteratorType &nit, const KernelIteratorType kernelBegin, const KernelIteratorType kernelEnd) const
 
 NeighborhoodMajorityVotingImageFilter (const Self &)=delete
 
void operator= (const Self &)=delete
 

Detailed Description

template<class TInputImage, class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
class otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >

Neighborhood Majority Voting of an image

Filters a labeled image using Majority Voting in a specified neighbordhood. Majority Voting takes the more representative value of all the pixels identified by the structuring element and then sets the center pixel to this label value.

If the maximum number of votes is not unique, i.e., if more than one label have a maximum number of votes, AND if the Boolean m_KeepOriginalLabelBool == false, then an "Undecided" label is assigned to that output pixel. Otherwise, if m_KeepOriginalLabelBool == true, this output pixel keeps its Original value.

NOT classified input pixels are assumed to belong to the m_LabelForNoDataPixels labeled class. Those pixels keep their Original m_LabelForNoDataPixels label in the output image.

The structuring element is assumed to be composed of binary values (zero or one). Only elements of the structuring element having values > 0 are candidates for affecting the center pixel.

For the each input image pixel,

See also
MorphologyImageFilter, GrayscaleFunctionDilateImageFilter, BinaryDilateImageFilter

Definition at line 67 of file otbNeighborhoodMajorityVotingImageFilter.h.

Member Typedef Documentation

◆ ConstPointer

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
typedef itk::SmartPointer<const Self> otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::ConstPointer

Definition at line 75 of file otbNeighborhoodMajorityVotingImageFilter.h.

◆ DefaultBoundaryConditionType

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
typedef Superclass::DefaultBoundaryConditionType otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::DefaultBoundaryConditionType

Default boundary condition type

Definition at line 98 of file otbNeighborhoodMajorityVotingImageFilter.h.

◆ KernelIteratorType

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
typedef Superclass::KernelIteratorType otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::KernelIteratorType

Kernel (structuring element) iterator.

Definition at line 88 of file otbNeighborhoodMajorityVotingImageFilter.h.

◆ KernelPixelType

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
typedef TKernel::PixelType otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::KernelPixelType

Type of the pixels in the Kernel.

Definition at line 108 of file otbNeighborhoodMajorityVotingImageFilter.h.

◆ KernelType

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
typedef Superclass::KernelType otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::KernelType

Kernel typedef.

Definition at line 94 of file otbNeighborhoodMajorityVotingImageFilter.h.

◆ NeighborhoodIteratorType

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
typedef Superclass::NeighborhoodIteratorType otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::NeighborhoodIteratorType

Neighborhood iterator type.

Definition at line 91 of file otbNeighborhoodMajorityVotingImageFilter.h.

◆ PixelType

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
typedef Superclass::PixelType otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::PixelType

Declaration of pixel type.

Definition at line 81 of file otbNeighborhoodMajorityVotingImageFilter.h.

◆ Pointer

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
typedef itk::SmartPointer<Self> otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::Pointer

Definition at line 74 of file otbNeighborhoodMajorityVotingImageFilter.h.

◆ Self

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
typedef NeighborhoodMajorityVotingImageFilter otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::Self

Standard class typedefs.

Definition at line 72 of file otbNeighborhoodMajorityVotingImageFilter.h.

◆ Superclass

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
typedef itk::MorphologyImageFilter<TInputImage, TOutputImage, TKernel> otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::Superclass

Definition at line 73 of file otbNeighborhoodMajorityVotingImageFilter.h.

Constructor & Destructor Documentation

◆ NeighborhoodMajorityVotingImageFilter() [1/2]

template<class TInputImage , class TOutputImage , class TKernel >
otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::NeighborhoodMajorityVotingImageFilter
protected

Constructor

Definition at line 40 of file otbNeighborhoodMajorityVotingImageFilter.hxx.

◆ ~NeighborhoodMajorityVotingImageFilter()

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::~NeighborhoodMajorityVotingImageFilter ( )
inlineoverrideprotected

Type of the pixels in the Kernel.

Definition at line 150 of file otbNeighborhoodMajorityVotingImageFilter.h.

◆ NeighborhoodMajorityVotingImageFilter() [2/2]

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::NeighborhoodMajorityVotingImageFilter ( const Self )
privatedelete

Type of the pixels in the Kernel.

Member Function Documentation

◆ ComputeNeighborhoodHistogramSummary()

template<class TInputImage , class TOutputImage , class TKernel >
const NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::HistoSummary otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::ComputeNeighborhoodHistogramSummary ( const NeighborhoodIteratorType nit,
const KernelIteratorType  kernelBegin,
const KernelIteratorType  kernelEnd 
) const
protected

◆ CreateAnother()

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
virtual::itk::LightObject::Pointer otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::CreateAnother ( void  ) const

◆ Evaluate()

template<class TInputImage , class TOutputImage , class TKernel >
NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::PixelType otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::Evaluate ( const NeighborhoodIteratorType nit,
const KernelIteratorType  kernelBegin,
const KernelIteratorType  kernelEnd 
)
overrideprotected

Evaluate image neighborhood with kernel to find the new value for the center pixel value

It will return the more representative label value of the labeled image pixels whose corresponding element in the structuring element is positive. This version of Evaluate is used for non-boundary pixels.

Definition at line 53 of file otbNeighborhoodMajorityVotingImageFilter.hxx.

References otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::HistoSummary::freqCenterLabel, otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::HistoSummary::majorityLabel, and otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::HistoSummary::majorityUnique.

◆ GenerateOutputInformation()

template<class TInputImage , class TOutputImage , class TKernel >
void otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::GenerateOutputInformation
overrideprotected

Type of the pixels in the Kernel.

Definition at line 135 of file otbNeighborhoodMajorityVotingImageFilter.hxx.

References otb::WriteNoDataFlags().

◆ GetNameOfClass()

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
virtual const char* otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::GetNameOfClass ( ) const
virtual

Runtime information support.

◆ New()

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
static Pointer otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::New ( )
static

Standard New method.

◆ operator=()

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
void otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::operator= ( const Self )
privatedelete

Type of the pixels in the Kernel.

◆ SetIsolatedThreshold()

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
virtual void otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::SetIsolatedThreshold ( unsigned int  _arg)
virtual

Type of the pixels in the Kernel.

◆ SetKeepOriginalLabelBool()

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
virtual void otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::SetKeepOriginalLabelBool ( bool  _arg)
virtual

Type of the pixels in the Kernel.

◆ SetLabelForNoDataPixels()

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
virtual void otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::SetLabelForNoDataPixels ( const PixelType  _arg)
inlinevirtual

End concept checking

Definition at line 123 of file otbNeighborhoodMajorityVotingImageFilter.h.

◆ SetLabelForUndecidedPixels()

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
virtual void otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::SetLabelForUndecidedPixels ( PixelType  _arg)
virtual

Type of the pixels in the Kernel.

◆ SetOnlyIsolatedPixels()

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
virtual void otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::SetOnlyIsolatedPixels ( bool  _arg)
virtual

Type of the pixels in the Kernel.

◆ typedef() [1/5]

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::typedef ( itk::Concept::Convertible< PixelType, typename TOutputImage::PixelType >  )

Begin concept checking This class requires InputConvertibleToOutputCheck in the form of (itk::Concept::Convertible<PixelType, typename TOutputImage::PixelType>)

◆ typedef() [2/5]

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::typedef ( itk::Concept::GreaterThanComparable< KernelPixelType )

This class requires KernelGreaterThanComparableCheck in the form of (itk::Concept::GreaterThanComparable<KernelPixelType>)

◆ typedef() [3/5]

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::typedef ( itk::Concept::GreaterThanComparable< PixelType )

This class requires InputGreaterThanComparableCheck in the form of (itk::Concept::GreaterThanComparable<PixelType>)

◆ typedef() [4/5]

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::typedef ( itk::Concept::SameDimension< InputImageDimension, KernelDimension )

This class requires SameDimensionCheck2 in the form of (itk::Concept::SameDimension<InputImageDimension, KernelDimension>)

◆ typedef() [5/5]

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::typedef ( itk::Concept::SameDimension< InputImageDimension, OutputImageDimension )

This class requires SameDimensionCheck1 in the form of (itk::Concept::SameDimension<InputImageDimension, OutputImageDimension>)

Member Data Documentation

◆ InputImageDimension

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
const unsigned int otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::InputImageDimension = TInputImage::ImageDimension
static

ImageDimension constants

Definition at line 101 of file otbNeighborhoodMajorityVotingImageFilter.h.

◆ KernelDimension

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
const unsigned int otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::KernelDimension = TKernel::NeighborhoodDimension
static

Type of the pixels in the Kernel.

Definition at line 103 of file otbNeighborhoodMajorityVotingImageFilter.h.

◆ m_IsolatedThreshold

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
unsigned int otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::m_IsolatedThreshold
private

Type of the pixels in the Kernel.

Definition at line 201 of file otbNeighborhoodMajorityVotingImageFilter.h.

◆ m_KeepOriginalLabelBool

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
bool otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::m_KeepOriginalLabelBool
private

Type of the pixels in the Kernel.

Definition at line 195 of file otbNeighborhoodMajorityVotingImageFilter.h.

◆ m_LabelForNoDataPixels

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
PixelType otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::m_LabelForNoDataPixels
private

Type of the pixels in the Kernel.

Definition at line 193 of file otbNeighborhoodMajorityVotingImageFilter.h.

◆ m_LabelForUndecidedPixels

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
PixelType otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::m_LabelForUndecidedPixels
private

Type of the pixels in the Kernel.

Definition at line 194 of file otbNeighborhoodMajorityVotingImageFilter.h.

◆ m_MajorityVotingBoundaryCondition

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
DefaultBoundaryConditionType otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::m_MajorityVotingBoundaryCondition
private

Type of the pixels in the Kernel.

Definition at line 191 of file otbNeighborhoodMajorityVotingImageFilter.h.

◆ m_OnlyIsolatedPixels

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
bool otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::m_OnlyIsolatedPixels
private

Type of the pixels in the Kernel.

Definition at line 198 of file otbNeighborhoodMajorityVotingImageFilter.h.

◆ OutputImageDimension

template<class TInputImage , class TOutputImage = TInputImage, class TKernel = typename itk::BinaryBallStructuringElement<typename TInputImage::PixelType, TInputImage::ImageDimension>>
const unsigned int otb::NeighborhoodMajorityVotingImageFilter< TInputImage, TOutputImage, TKernel >::OutputImageDimension = TOutputImage::ImageDimension
static

Type of the pixels in the Kernel.

Definition at line 102 of file otbNeighborhoodMajorityVotingImageFilter.h.


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