<< im2uint8 Image Types and Color Space Conversions imnorm >>

IPCV >> Image Types and Color Space Conversions > imgraythresh

imgraythresh

Calculate Otsu's Global threshold value

Syntax

level = imgraythresh (I)

Parameters

I :

Source Image

level :

Otsu's threshold value

Description

The function uses Otsu's method, which chooses the threshold to minimize the intraclass variance of the black and white pixels.

Examples

S = imread(fullpath(getIPCVpath() + "/images/three_objects.png"));
th = imgraythresh(S);
S2 = im2bw(S,th);
figure(); imshow(S2);

See also

Authors


Report an issue
<< im2uint8 Image Types and Color Space Conversions imnorm >>