52 #ifndef __PCL_SeparableFilter_h
53 #define __PCL_SeparableFilter_h
58 #include <pcl/Diagnostics.h>
112 : m_filterName( name )
125 : m_rowFilter( PCL_VALID_KERNEL_SIZE( n ) )
126 , m_colFilter( PCL_VALID_KERNEL_SIZE( n ) )
127 , m_filterName( name )
129 PCL_PRECONDITION( n == 0 || n >= 3 )
130 PCL_PRECONDITION( n == 0 || (n & 1) )
140 template <
typename T>
142 : m_rowFilter( x, PCL_VALID_KERNEL_SIZE( n ) )
143 , m_colFilter( x, PCL_VALID_KERNEL_SIZE( n ) )
144 , m_filterName( name )
146 PCL_PRECONDITION( n == 0 || n >= 3 )
147 PCL_PRECONDITION( n == 0 || (n & 1) )
158 , m_filterName( name )
171 template <
typename T>
173 : m_rowFilter( h, PCL_VALID_KERNEL_SIZE( n ) )
174 , m_colFilter( v, PCL_VALID_KERNEL_SIZE( n ) )
175 , m_filterName( name )
177 PCL_PRECONDITION( n == 0 || n >= 3 )
178 PCL_PRECONDITION( n == 0 || (n & 1) )
238 return Name() == f.
Name() && SameCoefficients( f );
254 m_filterName = newName.Trimmed();
263 return m_rowFilter.Length();
273 PCL_PRECONDITION( n == 0 || n >= 3 )
274 PCL_PRECONDITION( n == 0 || (n & 1) )
286 return m_rowFilter.IsEmpty();
310 return ColumnFilter();
317 template <
typename T>
327 template <
typename T>
336 template <
typename T>
339 return ColumnFilterAs( (T*)0 );
349 return phase ? m_colFilter : m_rowFilter;
358 template <
typename T>
361 return phase ? ColumnFilterAs( (T*)0 ) : RowFilterAs( (T*)0 );
370 return m_rowFilter.Sum() * m_colFilter.Sum();
389 for ( s = *i < 0; ++i < m_rowFilter.End(); )
390 if ( *i != 0 && (*i < 0) != s )
394 for ( s = (s < 0) ? *i++ < 0 : s; i < m_colFilter.End(); ++i )
395 if ( *i != 0 && (*i < 0) != s )
406 return m_colFilter == f.m_colFilter && m_rowFilter == f.m_rowFilter;
424 coefficient_vector m_rowFilter;
425 coefficient_vector m_colFilter;
bool IsEmpty() const noexcept
const coefficient * const_iterator
int Length() const noexcept
Separable filter in two dimensions.
virtual ~SeparableFilter()
virtual SeparableFilter * Clone() const
virtual void Resize(int n)
SeparableFilter(int n, const String &name=String())
coefficient_vector RowFilter() const
SeparableFilter(const coefficient_vector &h, const coefficient_vector &v, const String &name=String())
coefficient_vector ColFilter() const
SeparableFilter(const SeparableFilter &)=default
SeparableFilter(SeparableFilter &&)=default
coefficient_vector ColumnFilter() const
virtual void Rename(const String &newName)
SeparableFilter(int n, const T &x, const String &name=String())
GenericVector< T > ColFilterAs(T *) const
bool SameCoefficients(const SeparableFilter &f) const
coefficient_vector Filter(int phase) const
GenericVector< T > RowFilterAs(T *) const
bool IsHighPassFilter() const
SeparableFilter(const String &name=String())
GenericVector< T > FilterAs(int phase, T *) const
SeparableFilter(const T *h, const T *v, int n, const String &name=String())
GenericVector< T > ColumnFilterAs(T *) const
bool operator==(const Array< T, A > &x1, const Array< T, A > &x2) noexcept
String Name(int colorSpace)