[mmcloseth] [Up] [mmopenrecth] Residues

mmgradm
Morphological gradient.

Synopsis

function y = mmgradm ( f , Bdil , Bero )

Input

f Image Gray-scale (uint8 or uint16) or binary image
Bdil Structuring Element

Default: 3x3 elementary cross

for the dilation.

Bero Structuring Element

Default: 3x3 elementary cross

for the erosion.

Output

y Image Gray-scale (uint8 or uint16) or binary image

(same type of f).

Description

mmgradm creates the image y by the subtraction of the erosion of the image f by Bero of the dilation of f by Bdil.

Examples

Binary image:
a = mmreadgray('small_bw.tif');
b = mmgradm(a);
mmshow(a);
mmshow(b);
a b
Binary image, internal and external gradient:
c=mmgradm(a,mmsecross(0),mmsecross);
d=mmgradm(a,mmsecross,mmsecross(0));
mmshow(a,c);
mmshow(a,d);
a,c a,d
Gray-scale
a = mmreadgray('bloodcells.tif');
b = mmgradm(a);
mmshow(a);
mmshow(b);
a b
Binary image, internal and external gradient:
Gray-scale

Equation

Algorithm

function y=mmgradm_equ( f, bdil, bero)
  y = mmsubm(mmdil(f,bdil),mmero(f,bero)); 

See also

mmfreedom Control automatic data type conversion.
mmdil Dilate an image by a structuring element.
mmero Erode an image by a structuring element.
[mmcloseth] [Up] [mmopenrecth]