Hi,
there are lots of ways to segment an image. you can
threshold it globally using the graythresh function
like this:
g=graythresh(img); % this will gfive you the global
%threshold
newimage=im2bw(img,g);
% this will convert ur grauscale image (img) into a
%binary image.
Alternatively, u could supply your own value of
threshold in place of g.
Hope this helps.
E.S