Home > Util > segment1.m

segment1

PURPOSE ^

SEGMENT1 segments an image x by thresholding and connexity test

SYNOPSIS ^

function [zk,mk,vk,nk]=segment1(x,s);

DESCRIPTION ^

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);

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 27-Feb-2004 16:43:21 by m2html © 2003