Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members   Related Pages   Examples  

Kernel Class Template Reference

#include <Kernel.h>

Inheritance diagram for Kernel::

Image ByteKernel FloatKernel IntKernel List of all members.

Public Methods

 Kernel (char *name="")
 Kernel (int w, int h, char *name="")
void readKernel (char *name)
void writeKernel ()
void showKernel ()
void readKernelCoeffs (char *name)
void writeKernelCoeffs (char *name, char *comment)
int getKernelType ()

Detailed Description

template<class T> class Kernel

Implements data structures and functions for manipulating all types of convolution kernels. A convolution kernel is regarded as a particular type of image.

Definition at line 51 of file Kernel.h.


Constructor & Destructor Documentation

template<class T>
Kernel<T>::Kernel<T> ( char * name = "" ) [inline]
 

Creates a kernel with the specified name without allocating space for the kernel data.

Definition at line 59 of file Kernel.h.

template<class T>
Kernel<T>::Kernel<T> ( int w,
int h,
char * name = "" ) [inline]
 

Creates a kernel of size wxh with the specified name and allocates space for storing the kernel data.

Definition at line 66 of file Kernel.h.


Member Function Documentation

template<class T>
int Kernel<T>::getKernelType ( ) [inline]
 

Returns the kernel type. Currently defined types are:

  • CROSS_3x3 = 100,
  • DISK_3x3 = 101,
  • KERNEL_BYTE_UNKNOWN = 102
  • LAPLACIAN_1 = 200,
  • LAPLACIAN_2 = 201,
  • SOBEL_H = 202,
  • SOBEL_V = 203,
  • PREWITT_H = 204,
  • PREWITT_V = 205,
  • KIRSCH_1 = 206,
  • KIRSCH_2 = 207,
  • KIRSCH_3 = 208,
  • KIRSCH_4 = 209,
  • KIRSCH_5 = 210,
  • KIRSCH_6 = 211,
  • KIRSCH_7 = 212,
  • KIRSCH_8 = 213,
  • KERNEL_INT_UNKNOWN = 214,
  • RECTANGULAR_PULSE = 300,
  • TRIANGULAR_PULSE = 301,
  • GAUSS = 302,
  • DOG = 303,
  • GABOR = 304,
  • LOG = 305,
  • KERNEL_FLOAT_UNKNOWN = 306.

Definition at line 139 of file Kernel.h.

template<class T>
void Kernel<T>::readKernel<T> ( char * name ) [inline]
 

Reads the kernel data from file name and stores it in the data structure pointed out by pixels. The file name should be an image file.

Examples:
test_morphop.cpp.

Definition at line 73 of file Kernel.h.

template<class T>
void Kernel< T >::readKernelCoeffs ( char * name )
 

Reads kernel coefficients from the file specified by name. The format of the file should be:

  #Comment
  height width
  coeff(0,0)       coeff(0,1)       ... coeff(0,width-1)
  ... 
  coeff(height-1,0) coeff(height-1,1) ... coeff(height-1,width-1)
  
Examples:
test_kernel.cpp.

Definition at line 12 of file Kernel.cpp.

template<class T>
void Kernel<T>::showKernel<T> ( ) [inline]
 

Opens a window and renders in it the current kernel.

Examples:
test_kernel.cpp.

Definition at line 82 of file Kernel.h.

template<class T>
void Kernel<T>::writeKernel<T> ( ) [inline]
 

Writes the current kernel as an image to the file given by img_name.

Examples:
test_kernel.cpp.

Definition at line 78 of file Kernel.h.

template<class T>
void Kernel< T >::writeKernelCoeffs ( char * name,
char * comment )
 

Writes kernel coefficients to the file specified by name; extra information can be stored inside the file as a comment. The format of the file is:

  #Comment
  height width
  coeff(0,0)       coeff(0,1)       ... coeff(0,width-1)
  ... 
  coeff(height-1,0) coeff(height-1,1) ... coeff(height-1,width-1)
  
Examples:
test_kernel.cpp.

Definition at line 50 of file Kernel.cpp.


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