dlr::computerVision::Kernel< ELEMENT_TYPE > Class Template Reference

This class template represents a 2D convolution kernel. More...

#include <kernel.h>

List of all members.

Public Types

typedef ELEMENT_TYPE ElementType

Public Member Functions

 Kernel ()
 Default constructor initializes to zero size.
 Kernel (const Kernel< ELEMENT_TYPE > &source)
 The copy constructor does a deep copy.
 Kernel (const Array2D< ElementType > &source)
 This constructor allows us to implicitly make a Kernel instance from an Array2D.
 Kernel (size_t rows, size_t columns, ElementType *const dataPtr)
 Construct a kernel around external data.
 Kernel (const Array1D< ElementType > &rowArray, const Array1D< ElementType > &columnArray)
 This constructor allows us to implicitly make a separable Kernel instance from a pair of Array1D instances.
virtual ~Kernel ()
 Destroys the Kernel instance and deletes the internal data store.
Array2D< ElementType > getArray2D () const
 Return a copy of the kernel data in an Array2D object.
Array1D< ElementType > getColumnComponent () const
 This method is only valid for separable kernels; it returns the separable kernel component which is parallel to the columns of the image.
size_t getColumns () const
 This member function returns the number of columns in the kernel.
Array1D< ElementType > getRowComponent () const
 This method is only valid for separable kernels; it returns the separable kernel component which is parallel to the rows of the image.
size_t getRows () const
 This member function returns the number of rows in the kernel.
bool isSeparable () const
 This method returns true if the kernel is separable, false otherwise.
void setArray2D (const Array2D< ElementType > &dataArray)
 This method allows the user to set the contents of the kernel.
void setSeparableComponents (const Array1D< ElementType > &rowArray, const Array1D< ElementType > &columnArray)
 This method allows the user to set the contents of a separable kernel.


Detailed Description

template<class ELEMENT_TYPE>
class dlr::computerVision::Kernel< ELEMENT_TYPE >

This class template represents a 2D convolution kernel.

The template parameter indicates the type of the element in the kernel.

Definition at line 29 of file kernel.h.


Constructor & Destructor Documentation

template<class ELEMENT_TYPE >
dlr::computerVision::Kernel< ELEMENT_TYPE >::Kernel (  )  [inline]

Default constructor initializes to zero size.

Definition at line 220 of file kernel.h.

template<class ELEMENT_TYPE >
dlr::computerVision::Kernel< ELEMENT_TYPE >::Kernel ( const Kernel< ELEMENT_TYPE > &  source  )  [inline]

The copy constructor does a deep copy.

Parameters:
source The Kernel instance to be copied.

Definition at line 233 of file kernel.h.

template<class ELEMENT_TYPE >
dlr::computerVision::Kernel< ELEMENT_TYPE >::Kernel ( const Array2D< ElementType > &  source  )  [inline]

This constructor allows us to implicitly make a Kernel instance from an Array2D.

As with the copy constructor, the newly created kernel has its own copy of the data in the copied array.

Parameters:
source The Array2D instance to be copied.

Definition at line 247 of file kernel.h.

template<class ELEMENT_TYPE >
dlr::computerVision::Kernel< ELEMENT_TYPE >::Kernel ( size_t  rows,
size_t  columns,
ElementType *const   dataPtr 
) [inline]

Construct a kernel around external data.

Kernels constructed in this way will copy the data from the input pointer.

Parameters:
rows Number of rows in the kernel after successful construction.
columns Number of columns in the kernel after successful construction.
dataPtr A C-style array of ElementType from which the newly constructed Kernel should copy its data.

Definition at line 260 of file kernel.h.

template<class ELEMENT_TYPE >
dlr::computerVision::Kernel< ELEMENT_TYPE >::Kernel ( const Array1D< ElementType > &  rowArray,
const Array1D< ElementType > &  columnArray 
) [inline]

This constructor allows us to implicitly make a separable Kernel instance from a pair of Array1D instances.

As with the copy constructor, the newly created kernel has its own copy of the data from the copied arrays.

Parameters:
rowArray This argument specifies the portion of the kernel which will be applied along image rows.
columnArray This argument specifies the portion of the kernel which will be applied along image columns.

Definition at line 274 of file kernel.h.

template<class ELEMENT_TYPE >
dlr::computerVision::Kernel< ELEMENT_TYPE >::~Kernel (  )  [inline, virtual]

Destroys the Kernel instance and deletes the internal data store.

Definition at line 291 of file kernel.h.


Member Function Documentation

template<class ELEMENT_TYPE >
Array2D< ELEMENT_TYPE > dlr::computerVision::Kernel< ELEMENT_TYPE >::getArray2D (  )  const [inline]

Return a copy of the kernel data in an Array2D object.

Returns:
The return value is an Array2D instance. It does not reference the same physical memory as the kernel.

Definition at line 301 of file kernel.h.

Referenced by dlr::computerVision::filter2D().

template<class ELEMENT_TYPE >
Array1D< ELEMENT_TYPE > dlr::computerVision::Kernel< ELEMENT_TYPE >::getColumnComponent (  )  const [inline]

This method is only valid for separable kernels; it returns the separable kernel component which is parallel to the columns of the image.

Returns:
The return value is an Array1D instance representing an N-row by 1-column kernel component.

Definition at line 329 of file kernel.h.

Referenced by dlr::computerVision::filter2D().

template<class ELEMENT_TYPE >
size_t dlr::computerVision::Kernel< ELEMENT_TYPE >::getColumns (  )  const [inline]

This member function returns the number of columns in the kernel.

Returns:
The return value is the width, in columns, of the kernel.

Definition at line 341 of file kernel.h.

References dlr::computerVision::Kernel< ELEMENT_TYPE >::isSeparable().

template<class ELEMENT_TYPE >
Array1D< ELEMENT_TYPE > dlr::computerVision::Kernel< ELEMENT_TYPE >::getRowComponent (  )  const [inline]

This method is only valid for separable kernels; it returns the separable kernel component which is parallel to the rows of the image.

Returns:
The return value is an Array1D instance representing a 1-row by M-column kernel component.

Definition at line 356 of file kernel.h.

Referenced by dlr::computerVision::filter2D().

template<class ELEMENT_TYPE >
size_t dlr::computerVision::Kernel< ELEMENT_TYPE >::getRows (  )  const [inline]

This member function returns the number of rows in the kernel.

Returns:
The return value is the height, in rows, of the kernel.

Definition at line 368 of file kernel.h.

References dlr::computerVision::Kernel< ELEMENT_TYPE >::isSeparable().

template<class ELEMENT_TYPE>
bool dlr::computerVision::Kernel< ELEMENT_TYPE >::isSeparable (  )  const [inline]

This method returns true if the kernel is separable, false otherwise.

Returns:
The return value indicates whether or no the kernel is separable.

Definition at line 163 of file kernel.h.

Referenced by dlr::computerVision::filter2D(), dlr::computerVision::Kernel< ELEMENT_TYPE >::getColumns(), and dlr::computerVision::Kernel< ELEMENT_TYPE >::getRows().

template<class ELEMENT_TYPE >
void dlr::computerVision::Kernel< ELEMENT_TYPE >::setArray2D ( const Array2D< ElementType > &  dataArray  )  [inline]

This method allows the user to set the contents of the kernel.

This does a deep copy of the input array.

Parameters:
dataArray This argument specifies the kernel data to be copied.

Definition at line 381 of file kernel.h.

template<class ELEMENT_TYPE >
void dlr::computerVision::Kernel< ELEMENT_TYPE >::setSeparableComponents ( const Array1D< ElementType > &  rowArray,
const Array1D< ElementType > &  columnArray 
) [inline]

This method allows the user to set the contents of a separable kernel.

Calling this method forces the kernel instance to become separable. This method does a deep copy of the input arrays.

Parameters:
rowArray This argument specifies the separable kernel component which is parallel to the rows of the image. It represents a 1-row by M-column kernel component.
columnArray This argument specifies the separable kernel component which is parallel to the columns of the image. It represents an N-row by 1-column kernel component.

Definition at line 395 of file kernel.h.


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

Generated on Wed Nov 25 12:15:09 2009 for dlrComputerVision Utility Library by  doxygen 1.5.8