function testIsodata

a = im2double(imread('eight.tif'));
t = isodata(a)
b = a < t;
subplot(1,2,1), bar(hist(a, 256));
subplot(1,2,1), line([t*256,t*256], [0,250]);
subplot(1,2,2), imshow(b);