52 #ifndef __PCL_SeparableConvolution_h
53 #define __PCL_SeparableConvolution_h
58 #include <pcl/Diagnostics.h>
65 #define __PCL_SEPARABLE_CONVOLUTION_TINY_WEIGHT 1.0e-20
125 , m_weight( x.m_weight )
126 , m_highPass( x.m_highPass )
127 , m_rawHighPass( x.m_rawHighPass )
128 , m_rescaleHighPass( x.m_rescaleHighPass )
129 , m_convolveRows( x.m_convolveRows )
130 , m_convolveCols( x.m_convolveCols )
132 if ( !x.m_filter.IsNull() )
133 m_filter = x.m_filter->Clone();
155 (void)InterlacedTransformation::operator =( x );
156 (void)ParallelProcess::operator =( x );
157 if ( x.m_filter.IsNull() )
160 m_filter = x.m_filter->Clone();
161 m_weight = x.m_weight;
162 m_highPass = x.m_highPass;
163 m_rawHighPass = x.m_rawHighPass;
164 m_rescaleHighPass = x.m_rescaleHighPass;
165 m_convolveRows = x.m_convolveRows;
166 m_convolveCols = x.m_convolveCols;
185 PCL_PRECONDITION( !m_filter.IsNull() )
200 PCL_PRECONDITION( !m_filter.IsNull() )
201 return m_filter->Filter( phase );
210 template <
typename T>
213 PCL_PRECONDITION( !m_filter.IsNull() )
214 return m_filter->FilterAs( phase, (T*)0 );
222 m_filter = filter.
Clone();
223 CacheFilterProperties();
276 return m_rescaleHighPass;
286 m_rescaleHighPass = enable;
296 EnableHighPassRescaling( !disable );
311 return m_rawHighPass;
320 m_rawHighPass = enable;
329 EnableRawHighPass( !disable );
337 return m_convolveRows;
345 m_convolveRows = enable;
356 EnableRowConvolution( !disable );
364 return m_convolveCols;
372 m_convolveCols = enable;
383 EnableColumnConvolution( !disable );
393 PCL_PRECONDITION( !m_filter.IsNull() )
394 return m_filter->Size() + (m_filter->Size() - 1)*(InterlacingDistance() - 1);
411 if ( numThreads >= 32 )
413 if ( numThreads >= 28 )
415 if ( numThreads >= 24 )
417 if ( numThreads >= 16 )
419 if ( numThreads >= 8 )
421 if ( numThreads >= 4 )
423 if ( numThreads >= 2 )
439 bool m_highPass =
false;
444 bool m_rawHighPass =
false;
445 bool m_rescaleHighPass =
false;
446 bool m_convolveRows =
true;
447 bool m_convolveCols =
true;
460 void CacheFilterProperties()
462 PCL_PRECONDITION( !m_filter.
IsNull() )
463 PCL_PRECONDITION( !m_filter->IsEmpty() )
465 m_highPass = m_filter->IsHighPassFilter();
466 m_weight = m_filter->Weight();
467 if (
pcl::
Abs( m_weight ) < __PCL_SEPARABLE_CONVOLUTION_TINY_WEIGHT )
471 void ValidateFilter() const;
A smart pointer with exclusive object ownership and optional automatic object destruction.
Implements a generic, two-dimensional, shared or local image.
A process using multiple concurrent execution threads.
Discrete two-dimensional separable convolution in the spatial domain.
void Apply(pcl::Image &) const override
bool IsRowConvolutionEnabled() const
SeparableConvolution(SeparableConvolution &&)=default
void DisableHighPassRescaling(bool disable=true)
const SeparableFilter & Filter() const
SeparableConvolution(const SeparableConvolution &x)
int OverlappingDistance() const
SeparableConvolution()=default
bool IsColumnConvolutionEnabled() const
void Apply(pcl::UInt8Image &) const override
void Apply(pcl::UInt32Image &) const override
bool IsHighPassRescalingEnabled() const
void EnableHighPassRescaling(bool enable=true)
void DisableColumnConvolution(bool disable=true)
bool IsHighPassFilter() const
void DisableRawHighPass(bool disable=true)
void EnableRowConvolution(bool enable=true)
void EnableColumnConvolution(bool enable=true)
coefficient_vector Filter(int phase) const
void DisableRowConvolution(bool disable=true)
GenericVector< T > FilterAs(int phase, T *) const
SeparableConvolution(const SeparableFilter &filter)
double FilterWeight() const
~SeparableConvolution() override
SeparableFilter::coefficient coefficient
void EnableRawHighPass(bool enable=true)
void Apply(pcl::UInt16Image &) const override
bool IsRawHighPassEnabled() const
void SetFilter(const SeparableFilter &filter)
void Apply(pcl::DImage &) const override
Separable filter in two dimensions.
virtual SeparableFilter * Clone() const
GenericVector< coefficient > coefficient_vector
T Abs(const Complex< T > &c) noexcept
static constexpr int FasterThanNonseparableFilterSize(int numThreads)