| [Top] [Up] [Prev] [Next] | [Up] [Basic Concepts] [Demonstrations] [Functions] | SDC Morphology Toolbox V1.1 15Jan02 |
y = mmneg( f ) f: Gray-scale (uint8 or uint16) or binary image (logical uint8). y: Gray-scale (uint8 or uint16) or binary image (logical uint8). mmneg returns an image y that is the negation (i.e., inverse or involution) of the image f. In the binary case, y is the complement of f.
f=uint8([255 255 0 10 20 10 0 255 255]);
y = mmneg(f)
y =
0 0 255 245 235 245 255 0 0
|
a = mmreadgray('gear.tif'); b = mmneg(a); mmshow(a); mmshow(b);
|
c = mmreadgray('astablet.tif'); d = mmneg(c); mmshow(c); mmshow(d);
|

function y = mmneg_equ(f)
if (mmisbinary(f))
k = 1;
elseif (isa(f,'uint8'))
k = 255;
else
k = 65535;
end
y = k - f; | [Top] [Up] [Prev] [Next] | [Up] [Basic Concepts] [Demonstrations] [Functions] |
|
| Copyright (c) 1998-2002 by SDC Information Systems | ||