Follow this link to skip to the main content

claraty::Gradient_Op<> Class Template Reference

#include <gradient_op.h>

Inheritance diagram for claraty::Gradient_Op<>:

Inheritance graph
[legend]
Collaboration diagram for claraty::Gradient_Op<>:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Grad_Dir_t { GRAD_XDIR = 0, GRAD_YDIR }
enum  Grad_Kernel_t { GRAD_STEP = 0, GRAD_GAUSSIAN }
enum  Conv_Shape_t
enum  Border_Mode_t

Public Member Functions

void set_kernel (Matrix< T > kernel)
void set_border_mode (Border_Mode_t border_mode, double border_constant=0)
void set_border_constant (T border_constant)
void set_conv_shape (Conv_Shape_t conv_tpye)
void set_asymm (bool a)
Matrix< T > get_kernel ()
Border_Mode_t get_border_mode ()
get_border_constant ()
Conv_Shape_t get_conv_shape ()
template<class TS, class TD>
void filter (const Image< TS > &src_image, Image< TD > &dest_image)
void set_kernel_size (int kernel_size)
void set_kernel_type (Grad_Kernel_t kernel_type)
void set_direction (Grad_Dir_t direction)
int get_kernel_size ()
Grad_Kernel_t get_kernel_type ()
Grad_Dir_t get_direction ()

Private Attributes

Grad_Kernel_t _kernel_type
int _kernel_size
Grad_Dir_t _direction

Detailed Description

template<TEMPLATE_ARGS>
class claraty::Gradient_Op<>

Definition at line 51 of file gradient_op.h.


Member Enumeration Documentation

template<TEMPLATE_ARGS >
enum claraty::Gradient_Op::Grad_Dir_t

The direction of the gradient

Enumerator:
GRAD_XDIR 
GRAD_YDIR 

Definition at line 58 of file gradient_op.h.

00058                   {
00059     GRAD_XDIR=0,
00060     GRAD_YDIR
00061   };

template<TEMPLATE_ARGS >
enum claraty::Gradient_Op::Grad_Kernel_t

The gradient kernel type

Enumerator:
GRAD_STEP 
GRAD_GAUSSIAN 

Definition at line 66 of file gradient_op.h.

00066                      {
00067     GRAD_STEP=0,
00068     GRAD_GAUSSIAN
00069   };

The shape or type of convolution being done.

Definition at line 81 of file convolve_op.h.

00081                     {
00082     CONV_SAME=0,
00083     CONV_VALID,
00084     CONV_FULL
00085   };

The border mode used for CONV_SAME and CONV_FULL convolutions.

Definition at line 90 of file convolve_op.h.

00090                      {
00091     CONV_CONSTANT=0,
00092     CONV_REPLICATE,
00093     CONV_REFLECT,
00094     CONV_WRAP
00095   };


Constructor & Destructor Documentation

template<TEMPLATE_ARGS >
claraty::Gradient_Op<>::Gradient_Op ( typename Gradient_Op< T >::Grad_Dir_t  direction,
int  kernel_size = 3,
typename Gradient_Op< T >::Grad_Kernel_t  kernel_type = GRAD_STEP,
double  sigma = 1.0,
typename Gradient_Op< T >::Conv_Shape_t  conv_shape = Convolve_Op< T >::CONV_SAME,
typename Gradient_Op< T >::Border_Mode_t  border_mode = Convolve_Op< T >::CONV_REPLICATE,
border_constant = 0 
)

template<TEMPLATE_ARGS >
claraty::Gradient_Op<>::Gradient_Op ( typename Gradient_Op< T >::Grad_Dir_t  direction,
int  kernel_size = 3,
typename Gradient_Op< T >::Grad_Kernel_t  kernel_type = GRAD_STEP,
double  sigma = 1.0,
typename Gradient_Op< T >::Conv_Shape_t  conv_shape = Convolve_Op< T >::CONV_SAME,
typename Gradient_Op< T >::Border_Mode_t  border_mode = Convolve_Op< T >::CONV_REPLICATE,
border_constant = 0 
)


Member Function Documentation

template<TEMPLATE_ARGS >
template<class TS, class TD>
void claraty::Gradient_Op<>::filter ( const Image< TS > &  src_image,
Image< TD > &  dest_image 
)

Convolves the kernel with the src_image to produce the dest_image. If the dest_image is not the correct size, it is resized. All operations are done w/ the kernel's pixel type and converted to the destination image type when done. Currently, this only does the CONV_VALID convolution type and consequently ignores the border type.

Parameters:
src_image the image to convolve with
dest_image the output of the convolution

Reimplemented from claraty::Convolve_Op< TEMPLATE_REFS >.

Definition at line 243 of file gradient_op.h.

00244                                                                {
00245 
00246   Convolve_Op<TEMPLATE_REFS>::filter(src_image, dest_image);
00247 }

template<TEMPLATE_ARGS >
void claraty::Gradient_Op<>::set_kernel_size ( int  kernel_size  ) 

template<TEMPLATE_ARGS >
void claraty::Gradient_Op<>::set_kernel_type ( Grad_Kernel_t  kernel_type  ) 

template<TEMPLATE_ARGS >
void claraty::Gradient_Op<>::set_direction ( Grad_Dir_t  direction  ) 

template<TEMPLATE_ARGS >
int claraty::Gradient_Op<>::get_kernel_size (  ) 

Definition at line 225 of file gradient_op.h.

References claraty::Gradient_Op<>::_kernel_size.

00225                   {
00226   return _kernel_size;
00227 }

template<TEMPLATE_ARGS >
Gradient_Op< TEMPLATE_REFS >::Grad_Kernel_t claraty::Gradient_Op<>::get_kernel_type (  ) 

Definition at line 230 of file gradient_op.h.

References claraty::Gradient_Op<>::_kernel_type.

00230                                                                                              {
00231   return _kernel_type;
00232 }

template<TEMPLATE_ARGS >
Gradient_Op< TEMPLATE_REFS >::Grad_Dir_t claraty::Gradient_Op<>::get_direction (  ) 

Definition at line 235 of file gradient_op.h.

References claraty::Gradient_Op<>::_direction.

00235                                                                                         {
00236   return _direction;
00237 }

void claraty::Convolve_Op< TEMPLATE_REFS >::set_kernel ( Matrix< T >  kernel  )  [inherited]

Definition at line 682 of file convolve_op.h.

References claraty::Convolve_Op<>::_kernel.

00682                                                             {
00683 
00684   _kernel = kernel;
00685 }

void claraty::Convolve_Op< TEMPLATE_REFS >::set_border_mode ( Border_Mode_t  border_mode,
double  border_constant = 0 
) [inherited]

Definition at line 699 of file convolve_op.h.

References claraty::Convolve_Op<>::_border_constant, and claraty::Convolve_Op<>::_border_mode.

00700                                                              {
00701   _border_mode = border_mode;
00702   _border_constant = border_constant;
00703 }

void claraty::Convolve_Op< TEMPLATE_REFS >::set_border_constant ( border_constant  )  [inherited]

Definition at line 710 of file convolve_op.h.

References claraty::Convolve_Op<>::_border_constant.

00710                                                                       {
00711   _border_constant = border_constant;
00712 }

void claraty::Convolve_Op< TEMPLATE_REFS >::set_conv_shape ( Conv_Shape_t  conv_type  )  [inherited]

Definition at line 725 of file convolve_op.h.

References claraty::Convolve_Op<>::_conv_shape.

00725                                                                       {
00726 
00727   //  cout << "setting shape: " << conv_type << endl;
00728   _conv_shape = conv_type;
00729 }

void claraty::Convolve_Op<>::set_asymm ( bool  a  )  [inline, inherited]

Definition at line 117 of file convolve_op.h.

References claraty::Convolve_Op<>::asymm.

00117 { asymm = a; }

Matrix< T > claraty::Convolve_Op< TEMPLATE_REFS >::get_kernel (  )  [inherited]

Definition at line 736 of file convolve_op.h.

References claraty::Convolve_Op<>::_kernel.

00736                                                  {
00737   
00738   return _kernel;
00739 }

Border_Mode_t claraty::Convolve_Op<>::get_border_mode (  )  [inherited]

T claraty::Convolve_Op<>::get_border_constant (  )  [inherited]

Conv_Shape_t claraty::Convolve_Op<>::get_conv_shape (  )  [inherited]


Member Data Documentation

template<TEMPLATE_ARGS >
Grad_Kernel_t claraty::Gradient_Op<>::_kernel_type [private]

Definition at line 104 of file gradient_op.h.

Referenced by claraty::Gradient_Op<>::get_kernel_type().

template<TEMPLATE_ARGS >
int claraty::Gradient_Op<>::_kernel_size [private]

Definition at line 105 of file gradient_op.h.

Referenced by claraty::Gradient_Op<>::get_kernel_size().

template<TEMPLATE_ARGS >
Grad_Dir_t claraty::Gradient_Op<>::_direction [private]

Definition at line 106 of file gradient_op.h.

Referenced by claraty::Gradient_Op<>::get_direction().


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