52 #ifndef __PCL_KernelFilter_h
53 #define __PCL_KernelFilter_h
58 #include <pcl/Diagnostics.h>
70 #define __PCL_DEFAULT_FILTER_SEPARABILITY_TOLERANCE 1.0e-06F
120 : coefficients( PCL_VALID_KERNEL_SIZE( n ), PCL_VALID_KERNEL_SIZE( n ) )
123 PCL_PRECONDITION( n == 0 || n >= 3 )
124 PCL_PRECONDITION( n == 0 || (n & 1) )
131 template <
typename T>
133 : coefficients( x, PCL_VALID_KERNEL_SIZE( n ), PCL_VALID_KERNEL_SIZE( n ) )
136 PCL_PRECONDITION( n == 0 || n >= 3 )
137 PCL_PRECONDITION( n == 0 || (n & 1) )
147 if ( !F.IsEmpty() && (F.Rows() != F.Cols() || (F.Rows() & 1) == 0) )
148 throw Error(
"KernelFilter: Invalid coefficient matrix in constructor." );
157 template <
typename T>
159 : coefficients( k, PCL_VALID_KERNEL_SIZE( n ), PCL_VALID_KERNEL_SIZE( n ) )
162 PCL_PRECONDITION( n == 0 || n >= 3 )
163 PCL_PRECONDITION( n == 0 || (n & 1) )
229 return !AsSeparableFilter().IsEmpty();
252 if ( !F.IsEmpty() && (F.Rows() != F.Cols() || (F.Rows() & 1) == 0) )
253 throw Error(
"KernelFilter: Invalid coefficient matrix assignment." );
277 return Name() == f.
Name() && SameCoefficients( f );
293 filterName = newName.Trimmed();
301 return coefficients.Rows();
311 PCL_PRECONDITION( n == 0 || n >= 3 )
312 PCL_PRECONDITION( n == 0 || (n & 1) )
317 n = PCL_VALID_KERNEL_SIZE( n );
329 return coefficients.IsEmpty();
335 operator bool()
const
345 return coefficients.Rows()*coefficients.Cols();
367 return coefficients.Begin();
382 return coefficients.End();
385 #ifndef __PCL_NO_STL_COMPATIBLE_ITERATORS
410 return coefficients[row];
419 return coefficients.Sum();
427 return coefficients.Modulus();
512 return coefficients.SameElements( f.coefficients );
525 #ifndef __PCL_NO_MATRIX_IMAGE_RENDERING
546 coefficients.ToImage( image );
564 coefficients.ToImage( v );
571 coefficient_matrix coefficients;
573 bool flipped =
false;
A simple exception with an associated error message.
Implements a generic, two-dimensional, shared or local image.
Acts like a union for all types of images in PCL, with optional class-wide ownership of transported i...
Kernel filter in two dimensions.
virtual void Rename(const String &newName)
const coefficient * End() const
void ToImage(ImageVariant &v) const
virtual bool IsSeparable() const
const coefficient * Begin() const
int NumberOfCoefficients() const
KernelFilter Flipped() const
virtual KernelFilter * Clone() const
KernelFilter(const T *k, int n, const String &name=String())
virtual void Resize(int n)
KernelFilter(KernelFilter &&)=default
KernelFilter(const KernelFilter &)=default
void ToImage(GenericImage< P > &image) const
KernelFilter(int n, const String &name=String())
bool IsHighPassFilter() const
bool SameCoefficients(const KernelFilter &f) const
const coefficient * operator[](int row) const
KernelFilter Normalized() const
KernelFilter(int n, const T &x, const String &name=String())
coefficient_matrix Coefficients() const
const coefficient * end() const
KernelFilter(const String &name=String())
KernelFilter(const coefficient_matrix &F, const String &name=String())
virtual SeparableFilter AsSeparableFilter(float tolerance=__PCL_DEFAULT_FILTER_SEPARABILITY_TOLERANCE) const
const coefficient * begin() const
Separable filter in two dimensions.
bool operator==(const Array< T, A > &x1, const Array< T, A > &x2) noexcept
double Modulus(const T *__restrict__ i, const T *__restrict__ j) noexcept
String Name(int colorSpace)