SEGMENT1 segments an image x by thresholding and connexity test [zk,mk,vk,nk]=segment1(x,s); s is a vector containing the thresholds (between 0 and 1 and increasing) zk is the segmented image mk,vk and nk are respectively means, variances and number of elements in each segment. Author: Ali Mohammad-Djafari Date: 13/03/2003 Test: x=shepp(256,256,1,1);s=[.2;.6];[zk,mk,vk,nk]=segment1(x,s); figure(1),imagesc(x);axis('square'); figure(2),imagesc(zk);axis('square'); figure(3),hist(x(:)); figure(4),hist(zk(:)); figure(5),imagesc(zk==1);imagesc(zk==2);imagesc(zk==3);