[Top] [Up] [Prev] [Next] [Up] [Basic Concepts] [Demonstrations] [Functions] SDC Morphology Toolbox V1.1 15Jan02

mmgradm - Morphological gradient.


Synopsis
y = mmgradm( f, Bdil, Bero )
Input
f: Gray-scale (uint8 or uint16) or binary image (logical uint8).
Bdil: Structuring element. for the dilation. Default: Elementary cross (mmsecross).
Bero: Structuring element. for the erosion. Default: Elementary cross (mmsecross).
Output
y: Gray-scale (uint8 or uint16) or binary image (logical uint8). (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 = mmbinary(mmreadgray('small_bw.tif'));
Warning: Converting image from binary uint8 to uint8.
b = mmgradm(a);
mmshow(a);
mmshow(b);
image
(a)
image
(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);
image
(a,c)
image
(a,d)

Gray-scale

a = mmreadgray('bloodcells.tif');
b = mmgradm(a);
mmshow(a);
mmshow(b);
image
(a)
image
(b)
Equation

equation

Algorithm
function y=mmgradm_equ( f, bdil, bero)
  y = mmsubm(mmdil(f,bdil),mmero(f,bero)); 
See Also
mmdil - Dilate an image by a structuring element.
mmero - Erode an image by a structuring element.
mmfreedom - Control automatic data type conversion.

[Top] [Up] [Prev] [Next] [Up] [Basic Concepts] [Demonstrations] [Functions] Valid XHTML 1.0!
Copyright (c) 1998-2002 by SDC Information Systems