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

mmsymdif - Symmetric difference between two images.


Synopsis
y = mmsymdif( f1, f2 )
Input
f1: Gray-scale (uint8 or uint16) or binary image (logical uint8).
f2: Gray-scale (uint8 or uint16) or binary image (logical uint8).
 
Obs: f1, f2 must have the same data type.
Output
y: Gray-scale (uint8 or uint16) or binary image (logical uint8). i
Description
mmsymdif creates the image y by taken the union of the subtractions of f1 from f2 and f2 from f1. When f1 and f2 are binary images, y represents the set of points that are in f1 and not in f2 or that are in f2 and not in f1 .
Examples

Gray scale image:

a = uint8([1 2 3 4 5]);
b = uint8([5 4 3 2 1]);
mmsymdif(a,b)

ans =
     4     2     0     2     4
c = mmreadgray('tplayer1.tif');
d = mmreadgray('tplayer2.tif');
e = mmsymdif(c,d);
mmshow(c);
mmshow(d);
mmshow(e); 
image
(c)
image
(d)
image
(e)
Equation

equation

Algorithm
function g = mmsymdif_equ(f1, f2)
g = mmunion(mmsubm(f1,f2),mmsubm(f2,f1));
See Also
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