[mmse2hmt] [Up] [mminfcanon] Sup-generating And Inf-generating

mmthreshad
Threshold (adaptive)

Synopsis

function y = mmthreshad ( f , f1 , f2 )

Input

f Image Gray-scale (uint8 or uint16) image
f1 Image Gray-scale (uint8 or uint16) image

lower value

f2 Image Gray-scale (uint8 or uint16) image

Default: NULL

upper value

Output

y Image Binary image

Description

mmthreshad creates the image y as the threshold of the image f by the images f1 and f2. A pixel in y has the value 1 when the value of the corresponding pixel in f is between the values of the corresponding pixels in f1 and f2.

Examples

a = mmreadgray('keyb.tif');
mmshow(a);
b = mmthreshad(a,uint8(10), uint8(50));
mmshow(b);
c = mmthreshad(a,238);
Warning: converting image from scalar to uint8
mmshow(c); 
a b
c

Equation

Algorithm

function y = mmthreshad_equ( f, f1, f2 )
  y = (f1 <= f) & (f <= f2);

See also

mmfreedom Control automatic data type conversion.
mmgray Convert a binary image into a gray-scale image.
mmbinary Convert a gray-scale image into a binary image
mmcmp Compare two images pixelwisely.
[mmse2hmt] [Up] [mminfcanon]