#include <DLMorphology.h>
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_BYTE * | kernel |
image kernel | |
int | kernelWidth |
kernel width | |
int | kernelHeight |
kernel height |
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.
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.
image | binary DLImage to dilate | |
numberOfTimes | number of times to apply dilate operation |
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.
image | binary DLImage to erode | |
numberOfTimes | number of times to apply erode operation |
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:
This function is in Stage Two of the documented Three Stage Deprecation Process.
image | DLImage to sharpen | |
numberOfTimes | number of times to apply sharpening operation |
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:
This function is in Stage Two of the documented Three Stage Deprecation Process.
image | DLImage to blur | |
numberOfTimes | number of times to apply blur operation |
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);
image | DLImage to be masked | |
mask | array containing masking filter | |
length | length of filter (i.e. N) |
DL_BYTE* DLMorphology::kernel [protected] |
int DLMorphology::kernelWidth [protected] |
int DLMorphology::kernelHeight [protected] |