TuttleOFX  1
terry::filter Namespace Reference

Namespaces

namespace  detail
namespace  floodFill
namespace  thinning

Data Structures

class  kernel_1d
 variable-size kernel More...
class  kernel_1d_fixed
 static-size kernel More...
struct  pixel_locator_gradientLocalMaxima_t

Enumerations

enum  convolve_boundary_option {
  convolve_option_output_ignore, convolve_option_output_zero, convolve_option_extend_padded, convolve_option_extend_zero,
  convolve_option_extend_constant, convolve_option_extend_mirror
}

Functions

template<template< typename > class Alloc, class SView , class TRGBView , class TGrayView , class DView >
void canny (const SView &srcView, const TRGBView &tmpSobelView, const TGrayView &tmpGrayView, const DView &cannyView, const point2< double > &sobelSize, const convolve_boundary_option sobelBoundaryOption, const double cannyThresLow, const double cannyThresUpper)
 Canny filtering.
template<bool autoEnabled, bool rows, typename PixelAccum , typename SrcView , typename Kernel , typename DstView >
GIL_FORCEINLINE void correlate_1d_imp (const SrcView &src, const Kernel &ker, const DstView &dst, const typename SrcView::point_t &dst_tl, const convolve_boundary_option option=convolve_option_extend_zero)
template<bool rows, typename PixelAccum , typename SrcView , typename Kernel , typename DstView >
GIL_FORCEINLINE void correlate_1d_auto (const SrcView &src, const Kernel &ker, const DstView &dst, const typename SrcView::point_t &dst_tl, const convolve_boundary_option option=convolve_option_extend_zero)
template<bool rows, typename PixelAccum , typename SrcView , typename Kernel , typename DstView >
GIL_FORCEINLINE void correlate_1d (const SrcView &src, const Kernel &ker, const DstView &dst, const typename SrcView::point_t &dst_tl, const convolve_boundary_option option=convolve_option_extend_zero)
template<bool autoEnabled, typename PixelAccum , typename SrcView , typename Kernel , typename DstView >
GIL_FORCEINLINE void correlate_rows_imp (const SrcView &src, const Kernel &ker, const DstView &dst, const typename SrcView::point_t &dst_tl, const convolve_boundary_option option=convolve_option_extend_zero)
template<typename PixelAccum , typename SrcView , typename Kernel , typename DstView >
GIL_FORCEINLINE void correlate_rows_auto (const SrcView &src, const Kernel &ker, const DstView &dst, const typename SrcView::point_t &dst_tl, const convolve_boundary_option option=convolve_option_extend_zero)
template<typename PixelAccum , typename SrcView , typename Kernel , typename DstView >
GIL_FORCEINLINE void correlate_rows (const SrcView &src, const Kernel &ker, const DstView &dst, const typename SrcView::point_t &dst_tl=typename SrcView::point_t(0, 0), const convolve_boundary_option option=convolve_option_extend_zero)
template<bool autoEnabled, typename PixelAccum , typename SrcView , typename Kernel , typename DstView >
GIL_FORCEINLINE void correlate_cols_imp (const SrcView &src, const Kernel &ker, const DstView &dst, const typename SrcView::point_t &dst_tl, const convolve_boundary_option option=convolve_option_extend_zero)
template<typename PixelAccum , typename SrcView , typename Kernel , typename DstView >
GIL_FORCEINLINE void correlate_cols_auto (const SrcView &src, const Kernel &ker, const DstView &dst, const typename SrcView::point_t &dst_tl, const convolve_boundary_option option=convolve_option_extend_zero)
template<typename PixelAccum , typename SrcView , typename Kernel , typename DstView >
GIL_FORCEINLINE void correlate_cols (const SrcView &src, const Kernel &ker, const DstView &dst, const typename SrcView::point_t &dst_tl=typename SrcView::point_t(0, 0), const convolve_boundary_option option=convolve_option_extend_zero)
template<bool autoEnabled, typename PixelAccum , template< typename > class Alloc, typename SrcView , typename KernelX , typename KernelY , typename DstView >
GIL_FORCEINLINE void correlate_rows_cols_imp (const SrcView &src, const KernelX &kernelX, const KernelY &kernelY, const DstView &dst, const typename SrcView::point_t &dst_tl, const convolve_boundary_option option=convolve_option_extend_zero)
template<typename PixelAccum , template< typename > class Alloc, typename SrcView , typename KernelX , typename KernelY , typename DstView >
GIL_FORCEINLINE void correlate_rows_cols_auto (const SrcView &src, const KernelX &kernelX, const KernelY &kernelY, const DstView &dst, const typename SrcView::point_t &dst_tl, const convolve_boundary_option option=convolve_option_extend_zero)
template<typename PixelAccum , template< typename > class Alloc, typename SrcView , typename KernelX , typename KernelY , typename DstView >
GIL_FORCEINLINE void correlate_rows_cols (const SrcView &src, const KernelX &kernelX, const KernelY &kernelY, const DstView &dst, const typename SrcView::point_t &dst_tl, const convolve_boundary_option option=convolve_option_extend_zero)
template<typename PixelAccum , typename SrcIterator , typename KernelIterator , typename Integer , typename DstIterator >
GIL_FORCEINLINE DstIterator correlate_pixels_n (SrcIterator src_begin, SrcIterator src_end, KernelIterator ker_begin, Integer ker_size, DstIterator dst_begin)
 1D un-guarded correlation with a variable-size kernel
template<std::size_t Size, typename PixelAccum , typename SrcIterator , typename KernelIterator , typename DstIterator >
GIL_FORCEINLINE DstIterator correlate_pixels_k (SrcIterator src_begin, SrcIterator src_end, KernelIterator ker_begin, DstIterator dst_begin)
 1D un-guarded correlation with a fixed-size kernel
template<std::size_t Size, class _InputIterator1 , class _InputIterator2 , class _Tp , class _BinaryOperation1 , class _BinaryOperation2 >
GIL_FORCEINLINE _Tp inner_product_k (_InputIterator1 __first1, _InputIterator2 __first2, _Tp __init, _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2)
 static version of std::inner_product
template<typename Kernel >
Kernel reverse_kernel (const Kernel &kernel)
 reverse a kernel
template<template< class > class Allocator, class SView , class DView >
void applyFloodFill (const SView &srcView, DView &dstView, const double lowerThres, const double upperThres)
template<typename Scalar >
Scalar gaussianValueAt (const Scalar x, const Scalar amplitude, const Scalar yscale=1, const Scalar xcenter=0)
 gaussian function

\[ G(x) = \frac{1}{\sqrt{2\pi \sigma^2}} e^{-\frac{x^2}{2 \sigma^2}} \]

or simplified...

\[ G(x) = a e^{- { \frac{(x-b)^2 }{ 2 c^2} } } \]


template<typename Scalar >
terry::filter::kernel_1d< Scalar > buildGaussian1DKernel (const Scalar size, const bool normalize=true, const double epsilon=kConvolutionEpsilon)
 create the gaussian kernel * found the kernel size * fill kernel values
template<typename Scalar >
Scalar gaussianDerivativeValueAt (const Scalar x, const Scalar amplitude, const Scalar yscale=1, const Scalar xcenter=0)
 gaussian derivative function

\[ G(x) = - x/a e^{- { \frac{(x-b)^2 }{ 2 c^2} } } \]


template<typename Scalar >
terry::filter::kernel_1d< Scalar > buildGaussianDerivative1DKernel (const Scalar size, const bool normalize=true, const double epsilon=kConvolutionEpsilon)
 create the gaussian derivative kernel * found the kernel size * fill kernel values
template<class SView , class DView >
void applyLocalMaxima (const SView &srcView, DView &dstView)
template<typename View , typename Progress >
bool modifyVectors (const View &xVecView, const View &yVecView, const double angle, const double intensity, Progress &p)
 change intensity and rotate vectors.
template<typename GView , typename View , typename Point , typename Scalar , typename Progress >
bool correlateMotionVectors (GView &xGradientView, GView &yGradientView, View &img, const Point &topleft, const terry::filter::kernel_1d< Scalar > &kernel, const convolve_boundary_option boundary_option, Progress &p)
template<template< typename > class Alloc, typename GView , typename View , typename Point , typename Scalar , typename Progress >
bool correlateMotionVectors (GView &xGradientView, GView &yGradientView, View &img, const Point &topleft, const terry::filter::kernel_1d< Scalar > &kernel, const terry::filter::kernel_1d< Scalar > &kernelSecondary, const convolve_boundary_option boundary_option, Progress &p)
template<typename Sampler , typename SrcView , typename VecView , typename DstView , typename Progress >
bool motionvectors_resample_pixels (const SrcView &srcView, const Rect< std::ssize_t > &srcRod, const VecView &xVecView, const VecView &yVecView, const Rect< std::ssize_t > &vecRod, const DstView &dstView, const Rect< std::ssize_t > &dstRod, const Rect< std::ssize_t > &procWindowRoW, const sampler::EParamFilterOutOfImage outOfImageProcess, Progress &p, Sampler sampler=Sampler())
 Moves the pixels based on the variation of the mask (the derivative: [-1 0 1] kernel)
template<template< typename > class Alloc, class SView , class DView >
void sobel (const SView &srcView, const DView &dstViewX, const DView &dstViewY, const point2< double > &size, const convolve_boundary_option boundary_option)
 Sobel filtering.
template<class SView , class DView >
void applyThinning (const SView &srcView, DView &tmpView, DView &dstView)

Variables

static const double kConvolutionEpsilon = 0.1
 arbitrary value...

Enumeration Type Documentation

Boundary options for 1D correlations/convolutions

Enumerator:
convolve_option_output_ignore 
convolve_option_output_zero 

do nothing to the output

convolve_option_extend_padded 

set the output to zero

convolve_option_extend_zero 

assume the source boundaries to be padded already

convolve_option_extend_constant 

assume the source boundaries to be zero

convolve_option_extend_mirror 

assume the source boundaries to be the boundary value

assume the source boundaries to be the mirror of source

Definition at line 32 of file convolve.hpp.


Function Documentation

template<template< class > class Allocator, class SView , class DView >
void terry::filter::applyFloodFill ( const SView &  srcView,
DView &  dstView,
const double  lowerThres,
const double  upperThres 
)
template<class SView , class DView >
void terry::filter::applyLocalMaxima ( const SView &  srcView,
DView &  dstView 
)

Definition at line 178 of file localMaxima.hpp.

References tuttle::plugin::merge::fill_pixels(), and terry::algorithm::transform_pixels_locator().

Referenced by BOOST_AUTO_TEST_CASE(), and canny().

Here is the call graph for this function:

template<class SView , class DView >
void terry::filter::applyThinning ( const SView &  srcView,
DView &  tmpView,
DView &  dstView 
)
template<typename Scalar >
terry::filter::kernel_1d<Scalar> terry::filter::buildGaussian1DKernel ( const Scalar  size,
const bool  normalize = true,
const double  epsilon = kConvolutionEpsilon 
)

create the gaussian kernel * found the kernel size * fill kernel values

Definition at line 49 of file gaussianKernel.hpp.

References copy(), terry::algorithm::for_each(), and terry::normalize().

Here is the call graph for this function:

template<typename Scalar >
terry::filter::kernel_1d<Scalar> terry::filter::buildGaussianDerivative1DKernel ( const Scalar  size,
const bool  normalize = true,
const double  epsilon = kConvolutionEpsilon 
)

create the gaussian derivative kernel * found the kernel size * fill kernel values

Definition at line 120 of file gaussianKernel.hpp.

References copy(), terry::algorithm::for_each(), and terry::normalize().

Here is the call graph for this function:

template<template< typename > class Alloc, class SView , class TRGBView , class TGrayView , class DView >
void terry::filter::canny ( const SView &  srcView,
const TRGBView &  tmpSobelView,
const TGrayView &  tmpGrayView,
const DView &  cannyView,
const point2< double > &  sobelSize,
const convolve_boundary_option  sobelBoundaryOption,
const double  cannyThresLow,
const double  cannyThresUpper 
)

Canny filtering.

Definition at line 26 of file canny.hpp.

References applyLocalMaxima(), applyThinning(), and terry::algorithm::transform_pixels().

Here is the call graph for this function:

template<bool rows, typename PixelAccum , typename SrcView , typename Kernel , typename DstView >
GIL_FORCEINLINE void terry::filter::correlate_1d ( const SrcView &  src,
const Kernel &  ker,
const DstView &  dst,
const typename SrcView::point_t &  dst_tl,
const convolve_boundary_option  option = convolve_option_extend_zero 
)

correlate a 1D variable-size kernel along the rows of an image

Definition at line 429 of file convolve.hpp.

template<bool rows, typename PixelAccum , typename SrcView , typename Kernel , typename DstView >
GIL_FORCEINLINE void terry::filter::correlate_1d_auto ( const SrcView &  src,
const Kernel &  ker,
const DstView &  dst,
const typename SrcView::point_t &  dst_tl,
const convolve_boundary_option  option = convolve_option_extend_zero 
)

correlate a 1D variable-size kernel along the rows of an image

Definition at line 419 of file convolve.hpp.

template<bool autoEnabled, bool rows, typename PixelAccum , typename SrcView , typename Kernel , typename DstView >
GIL_FORCEINLINE void terry::filter::correlate_1d_imp ( const SrcView &  src,
const Kernel &  ker,
const DstView &  dst,
const typename SrcView::point_t &  dst_tl,
const convolve_boundary_option  option = convolve_option_extend_zero 
)

correlate a 1D variable-size kernel along the rows of an image

Definition at line 409 of file convolve.hpp.

template<typename PixelAccum , typename SrcView , typename Kernel , typename DstView >
GIL_FORCEINLINE void terry::filter::correlate_cols ( const SrcView &  src,
const Kernel &  ker,
const DstView &  dst,
const typename SrcView::point_t &  dst_tl = typename SrcView::point_t(0,0),
const convolve_boundary_option  option = convolve_option_extend_zero 
)

correlate a 1D variable-size kernel along the columns of an image

Definition at line 489 of file convolve.hpp.

template<typename PixelAccum , typename SrcView , typename Kernel , typename DstView >
GIL_FORCEINLINE void terry::filter::correlate_cols_auto ( const SrcView &  src,
const Kernel &  ker,
const DstView &  dst,
const typename SrcView::point_t &  dst_tl,
const convolve_boundary_option  option = convolve_option_extend_zero 
)

correlate a 1D variable-size kernel along the columns of an image

Definition at line 479 of file convolve.hpp.

template<bool autoEnabled, typename PixelAccum , typename SrcView , typename Kernel , typename DstView >
GIL_FORCEINLINE void terry::filter::correlate_cols_imp ( const SrcView &  src,
const Kernel &  ker,
const DstView &  dst,
const typename SrcView::point_t &  dst_tl,
const convolve_boundary_option  option = convolve_option_extend_zero 
)

correlate a 1D variable-size kernel along the columns of an image

Definition at line 469 of file convolve.hpp.

template<std::size_t Size, typename PixelAccum , typename SrcIterator , typename KernelIterator , typename DstIterator >
GIL_FORCEINLINE DstIterator terry::filter::correlate_pixels_k ( SrcIterator  src_begin,
SrcIterator  src_end,
KernelIterator  ker_begin,
DstIterator  dst_begin 
)

1D un-guarded correlation with a fixed-size kernel

Definition at line 47 of file correlate.hpp.

template<typename PixelAccum , typename SrcIterator , typename KernelIterator , typename Integer , typename DstIterator >
GIL_FORCEINLINE DstIterator terry::filter::correlate_pixels_n ( SrcIterator  src_begin,
SrcIterator  src_end,
KernelIterator  ker_begin,
Integer  ker_size,
DstIterator  dst_begin 
)

1D un-guarded correlation with a variable-size kernel

Definition at line 18 of file correlate.hpp.

template<typename PixelAccum , typename SrcView , typename Kernel , typename DstView >
GIL_FORCEINLINE void terry::filter::correlate_rows ( const SrcView &  src,
const Kernel &  ker,
const DstView &  dst,
const typename SrcView::point_t &  dst_tl = typename SrcView::point_t(0,0),
const convolve_boundary_option  option = convolve_option_extend_zero 
)

correlate a 1D variable-size kernel along the rows of an image

Definition at line 459 of file convolve.hpp.

template<typename PixelAccum , typename SrcView , typename Kernel , typename DstView >
GIL_FORCEINLINE void terry::filter::correlate_rows_auto ( const SrcView &  src,
const Kernel &  ker,
const DstView &  dst,
const typename SrcView::point_t &  dst_tl,
const convolve_boundary_option  option = convolve_option_extend_zero 
)

correlate a 1D variable-size kernel along the rows of an image

Definition at line 449 of file convolve.hpp.

template<typename PixelAccum , template< typename > class Alloc, typename SrcView , typename KernelX , typename KernelY , typename DstView >
GIL_FORCEINLINE void terry::filter::correlate_rows_cols ( const SrcView &  src,
const KernelX &  kernelX,
const KernelY &  kernelY,
const DstView &  dst,
const typename SrcView::point_t &  dst_tl,
const convolve_boundary_option  option = convolve_option_extend_zero 
)

correlate a 2D separable variable-size kernel (kernelX and kernelY)

Definition at line 578 of file convolve.hpp.

template<typename PixelAccum , template< typename > class Alloc, typename SrcView , typename KernelX , typename KernelY , typename DstView >
GIL_FORCEINLINE void terry::filter::correlate_rows_cols_auto ( const SrcView &  src,
const KernelX &  kernelX,
const KernelY &  kernelY,
const DstView &  dst,
const typename SrcView::point_t &  dst_tl,
const convolve_boundary_option  option = convolve_option_extend_zero 
)

correlate a 2D separable variable-size kernel (kernelX and kernelY)

Definition at line 564 of file convolve.hpp.

template<bool autoEnabled, typename PixelAccum , template< typename > class Alloc, typename SrcView , typename KernelX , typename KernelY , typename DstView >
GIL_FORCEINLINE void terry::filter::correlate_rows_cols_imp ( const SrcView &  src,
const KernelX &  kernelX,
const KernelY &  kernelY,
const DstView &  dst,
const typename SrcView::point_t &  dst_tl,
const convolve_boundary_option  option = convolve_option_extend_zero 
)

correlate a 2D separable variable-size kernel (kernelX and kernelY)

Definition at line 499 of file convolve.hpp.

References tuttle::min(), and boost::gil::view().

Here is the call graph for this function:

template<bool autoEnabled, typename PixelAccum , typename SrcView , typename Kernel , typename DstView >
GIL_FORCEINLINE void terry::filter::correlate_rows_imp ( const SrcView &  src,
const Kernel &  ker,
const DstView &  dst,
const typename SrcView::point_t &  dst_tl,
const convolve_boundary_option  option = convolve_option_extend_zero 
)

correlate a 1D variable-size kernel along the rows of an image

Definition at line 439 of file convolve.hpp.

template<typename GView , typename View , typename Point , typename Scalar , typename Progress >
bool terry::filter::correlateMotionVectors ( GView &  xGradientView,
GView &  yGradientView,
View &  img,
const Point &  topleft,
const terry::filter::kernel_1d< Scalar > &  kernel,
const convolve_boundary_option  boundary_option,
Progress &  p 
)

Definition at line 84 of file motionVectors.hpp.

References tuttle::plugin::viewer::img.

template<template< typename > class Alloc, typename GView , typename View , typename Point , typename Scalar , typename Progress >
bool terry::filter::correlateMotionVectors ( GView &  xGradientView,
GView &  yGradientView,
View &  img,
const Point &  topleft,
const terry::filter::kernel_1d< Scalar > &  kernel,
const terry::filter::kernel_1d< Scalar > &  kernelSecondary,
const convolve_boundary_option  boundary_option,
Progress &  p 
)

Definition at line 106 of file motionVectors.hpp.

References tuttle::plugin::viewer::img.

template<typename Scalar >
Scalar terry::filter::gaussianDerivativeValueAt ( const Scalar  x,
const Scalar  amplitude,
const Scalar  yscale = 1,
const Scalar  xcenter = 0 
)

gaussian derivative function

\[ G(x) = - x/a e^{- { \frac{(x-b)^2 }{ 2 c^2} } } \]

Returns:
y <- gauss(x)

Definition at line 107 of file gaussianKernel.hpp.

template<typename Scalar >
Scalar terry::filter::gaussianValueAt ( const Scalar  x,
const Scalar  amplitude,
const Scalar  yscale = 1,
const Scalar  xcenter = 0 
)

gaussian function

\[ G(x) = \frac{1}{\sqrt{2\pi \sigma^2}} e^{-\frac{x^2}{2 \sigma^2}} \]

or simplified...

\[ G(x) = a e^{- { \frac{(x-b)^2 }{ 2 c^2} } } \]

Returns:
y <- gauss(x)

Definition at line 36 of file gaussianKernel.hpp.

template<std::size_t Size, class _InputIterator1 , class _InputIterator2 , class _Tp , class _BinaryOperation1 , class _BinaryOperation2 >
GIL_FORCEINLINE _Tp terry::filter::inner_product_k ( _InputIterator1  __first1,
_InputIterator2  __first2,
_Tp  __init,
_BinaryOperation1  __binary_op1,
_BinaryOperation2  __binary_op2 
)

static version of std::inner_product

Definition at line 75 of file inner_product.hpp.

template<typename View , typename Progress >
bool terry::filter::modifyVectors ( const View &  xVecView,
const View &  yVecView,
const double  angle,
const double  intensity,
Progress &  p 
)

change intensity and rotate vectors.

Parameters:
[in/out]xVecView image of x vectors
[in/out]yVecView image of y vectors
[in]anglerotation to apply on vectors (radian)
[in]intensityscale vectors values
[in]pinform progress

Definition at line 31 of file motionVectors.hpp.

References tuttle::plugin::viewer::motion().

Referenced by tuttle::plugin::pushPixel::PushPixelProcess< View >::multiThreadProcessImages().

Here is the call graph for this function:

template<typename Sampler , typename SrcView , typename VecView , typename DstView , typename Progress >
bool terry::filter::motionvectors_resample_pixels ( const SrcView &  srcView,
const Rect< std::ssize_t > &  srcRod,
const VecView &  xVecView,
const VecView &  yVecView,
const Rect< std::ssize_t > &  vecRod,
const DstView &  dstView,
const Rect< std::ssize_t > &  dstRod,
const Rect< std::ssize_t > &  procWindowRoW,
const sampler::EParamFilterOutOfImage  outOfImageProcess,
Progress &  p,
Sampler  sampler = Sampler() 
)

Moves the pixels based on the variation of the mask (the derivative: [-1 0 1] kernel)

Definition at line 132 of file motionVectors.hpp.

References boost::gil::color_convert(), tuttle::plugin::viewer::motion(), terry::sampler::sample(), terry::Rect< T >::size(), terry::Rect< T >::x1, terry::Rect< T >::x2, terry::Rect< T >::y1, and terry::Rect< T >::y2.

Here is the call graph for this function:

template<typename Kernel >
Kernel terry::filter::reverse_kernel ( const Kernel &  kernel) [inline]

reverse a kernel

Definition at line 105 of file kernel.hpp.

Referenced by tuttle::plugin::sobel::SobelPlugin::getProcessParams().

template<template< typename > class Alloc, class SView , class DView >
void terry::filter::sobel ( const SView &  srcView,
const DView &  dstViewX,
const DView &  dstViewY,
const point2< double > &  size,
const convolve_boundary_option  boundary_option 
)

Sobel filtering.

Definition at line 16 of file sobel.hpp.

Referenced by main().


Variable Documentation

const double terry::filter::kConvolutionEpsilon = 0.1 [static]

arbitrary value...

Definition at line 21 of file gaussianKernel.hpp.