immorphology.q

Summary
immorphology.q
Functions
morph_filterGeneric prototype for ANY morphological filter in this module
imerodeMathematical erosion computes for every pixel (i,j) the minimum over all pixels in the window centered at (i,j), according to the given mask.
imdilateMathematical dilation computes for every pixel (i,j) the maximum over all pixels in the window centered at (i,j), according to the given mask.
imopenThe morphological opening on an image is defined as an erosion followed by a dilation.
imcloseThe morphological closing on an image is defined as an dilation followed by a erosion.

Functions

morph_filter

Generic prototype for ANY morphological filter in this module

function y = morph_filter[T](x : cube[T], mask : mat[T], ctr : ivec2,
                         init : T, morph_op : [__device__ (T, T) -> T])

Parameters

xthe input image
maskthe morphology mask (should be binary!)
ctrthe center of the mask
morph_opthe operation (e.g. minimum or maximum)
initthe value to be used when the mask is empty

Remarks

  • Gray scale morphology is performed.  However, when the input is binary, binary morphology is correctly obtained.
  • For color images, the filter processes each channel individually.

imerode

Mathematical erosion computes for every pixel (i,j) the minimum over all pixels in the window centered at (i,j), according to the given mask.

y = imerode(x : cube, mask : mat, ctr : ivec2)

Parameters

xthe input image
maskthe mask to use
ctrthe coordinates of the center of the mask (typically floor(size(mask)/2))

imdilate

Mathematical dilation computes for every pixel (i,j) the maximum over all pixels in the window centered at (i,j), according to the given mask.

y = imdilate(x : cube, mask : mat, ctr : ivec2)

Parameters

xthe input image
maskthe mask to use
ctrthe coordinates of the center of the mask (typically floor(size(mask)/2))

imopen

The morphological opening on an image is defined as an erosion followed by a dilation.  Opening can remove small bright intensities and connect small dark regions.

function y = imopen(x : cube, mask : mat, ctr : ivec2)

Parameters

xthe input image
maskthe mask to use
ctrthe coordinates of the center of the mask (typically floor(size(mask)/2))

imclose

The morphological closing on an image is defined as an dilation followed by a erosion.  Opening can remove small dark intensities and connect small bright regions.

function y = imclose(x : cube, mask : mat, ctr : ivec2)

Parameters

xthe input image
maskthe mask to use
ctrthe coordinates of the center of the mask (typically floor(size(mask)/2))
Close