Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

prapi::Kernel Class Reference

#include <Kernel.h>

List of all members.


Detailed Description

Static methods for creating kernels for various purposes.

Kernels are used by many algorithms that work in a neighborhood defined by some type of a kernel. Also, binary morphology operations need structuring elements that can be created by this class.


Static Public Methods

template<class T> util::Matrix< T > createCircular (int radius, T value=T(1))
 Create a circular kernel of values.

template<class T> util::Matrix< T > createSquare (int size, T value=T(1))
 Create a size-by-size square matrix with all elements set to the given value.


Member Function Documentation

template<class T>
util::Matrix< T > prapi::Kernel::createCircular int    radius,
  value = T(1)
[static]
 

Create a circular kernel of values.

The size of the resulting matrix is (2*radius+1)-by-(2*radius+1). All items in the matrix whose spatial distance to the center is greater than radius are set to zero, and the others to the given value.

 Matrix<int> mat(Kernel::createCircular(2,1));
 mat = 0 0 1 0 0
       0 1 1 1 0
       1 1 1 1 1
       0 1 1 1 0
       0 0 1 0 0
 

template<class T>
util::Matrix< T > prapi::Kernel::createSquare int    size,
  value = T(1)
[static]
 

Create a size-by-size square matrix with all elements set to the given value.

For example:

 Matrix<int> mat(Kernel::createSquare(4,3));
 mat = 3 3 3 3
       3 3 3 3
       3 3 3 3
       3 3 3 3
 


The documentation for this class was generated from the following file:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.