[mmsubm] [Up] [mmunion] Operations

mmsymdif
Symmetric difference between two images

Synopsis

function y = mmsymdif ( f1 , f2 )

Input

f1 Image Gray-scale (uint8 or uint16) or binary image
f2 Image Gray-scale (uint8 or uint16) or binary image

Output

y Image

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); 
c d e

Equation

Algorithm

function g = mmsymdif_equ(f1, f2)
g = mmunion(mmsubm(f1,f2),mmsubm(f2,f1));

See also

mmfreedom Control automatic data type conversion.
[mmsubm] [Up] [mmunion]