DLMorphology Class Reference

[DEPRECATED] Collection of morphological image operations. More...

#include <DLMorphology.h>

List of all members.

Static Public Member Functions

static DLImage dlDilate (const DLImage &image, int numberOfTimes)
static DLImage dlErode (const DLImage &image, int numberOfTimes)
static DLImage dlSharpen (const DLImage &image, int numberOfTimes)
static DLImage dlBlur (const DLImage &image, int numberOfTimes=1)
static DLImage dlMask (const DLImage &image, double *mask[], int length)

Protected Attributes

DL_BYTEkernel
 image kernel
int kernelWidth
 kernel width
int kernelHeight
 kernel height


Detailed Description

[DEPRECATED] Collection of morphological image operations.

The DLMorpohological class performs generic morphological operations on DLImage objects. Each operation is implemented as a static function, so no object of class DLMorphology actually needs to be instantiated. An example of usage is as follows:

 DLImage i("test.jpg");
 DLImage outim = DLMorphology::dlBlur(i,5); // apply Blur 5 times

Definition at line 19 of file DLMorphology.h.


Member Function Documentation

static DLImage DLMorphology::dlDilate ( const DLImage image,
int  numberOfTimes 
) [static]

Dilate an image.

This function operates only on binary (B&W) images. At each application of the dilate operation, a white pixel is made black if any of its neighbors in the four principal directions is black.

This function is in Stage Two of the documented Three Stage Deprecation Process.

Parameters:
image binary DLImage to dilate
numberOfTimes number of times to apply dilate operation
Returns:
dilated image
Deprecated:
DLDilate::dlDilate (const DLImage &, int)

static DLImage DLMorphology::dlErode ( const DLImage image,
int  numberOfTimes 
) [static]

Erode an image.

This function operates only on binary (B&W) images. At each application of the erode operation, a black pixel is made white if any of its neighbors in the four principal directions is white.

This function is in Stage Two of the documented Three Stage Deprecation Process.

Parameters:
image binary DLImage to erode
numberOfTimes number of times to apply erode operation
Returns:
eroded image
Deprecated:
DLErode::dlErode (const DLImage &, int)

static DLImage DLMorphology::dlSharpen ( const DLImage image,
int  numberOfTimes 
) [static]

Sharpen an image.

This function (currently) requires a color image as input. At each application of the sharpening operation, a 5x5 sharpening filter is convolved with the image:

\[ \left[ \begin{array}{rrrrr} 0 & 0 & -1 & 0 & 0 \\ 0 & -8 & -21 & -8 & 0 \\ -1 & -21 & 299 & -21 & -1 \\ 0 & -8 & -21 & -8 & 0 \\ 0 & 0 & -1 & 0 & 0 \end{array} \right] \]



This function is in Stage Two of the documented Three Stage Deprecation Process.

Parameters:
image DLImage to sharpen
numberOfTimes number of times to apply sharpening operation
Returns:
sharpened image
Deprecated:
DLSharpen::dlSharpen (const DLImage &, int)

static DLImage DLMorphology::dlBlur ( const DLImage image,
int  numberOfTimes = 1 
) [static]

Blur an image.

This function (currently) requires a color image as input. At each application of the blur operation, a 5x5 blur filter is convolved with the image:

\[ \left[ \begin{array}{rrrrr} 0 & 0 & 1 & 0 & 0 \\ 0 & 8 & 21 & 8 & 0 \\ 1 & 21 & 59 & 21 & 1 \\ 0 & 8 & 21 & 8 & 0 \\ 0 & 0 & 1 & 0 & 0 \end{array} \right] \]



This function is in Stage Two of the documented Three Stage Deprecation Process.

Parameters:
image DLImage to blur
numberOfTimes number of times to apply blur operation
Returns:
blurred image
Deprecated:
DLBlur::dlBlur (const DLImage &, int)

static DLImage DLMorphology::dlMask ( const DLImage image,
double *  mask[],
int  length 
) [static]

Mask an image.

Convolves the image with a square (N x N) filter. The filter should be provided as a row-major 2-dimensional double array. For example:

 DLImage i("test.jpg");
 // create masking filter: use array[][] format for ease of initialization
 double maskarray[3][3] = 
   { {1,  1,  1},
     {1, -8,  1},
     {1,  1,  1}  };

 // convert double[][] into double** for input to dlMask() 
 double ** mask = new double*[3];
 for (int qq=0; qq<3; qq++) {
   mask[qq] = &maskarray[qq][0];
 }

 // perform masking operation
 DLImage outim = DLMorphology::dlMask(i,mask,3);


This function is in Stage Two of the documented Three Stage Deprecation Process.
Parameters:
image DLImage to be masked
mask array containing masking filter
length length of filter (i.e. N)
Returns:
masked image
Deprecated:
DLMask::dlMask (const DLImage &, double *, int)


Member Data Documentation

DL_BYTE* DLMorphology::kernel [protected]

image kernel

Definition at line 199 of file DLMorphology.h.

int DLMorphology::kernelWidth [protected]

kernel width

Definition at line 202 of file DLMorphology.h.

int DLMorphology::kernelHeight [protected]

kernel height

Definition at line 205 of file DLMorphology.h.


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

DOCLIB is being developed under contract by a collaboration between:
The Laboratory for Language and Media Processing
Unviersity of Maryland, College Park
and
Booz | Allen | Hamilton

All Rights Reserved, 2003-2007