LevelSet

Estimates and extracts the contour in an image based on modelling the evolving contour as a signed function.

 

function call:

[out_img1,out_img2,out_img3]=vsg('LevelSet',in_img1,x,y);

 

Arguments:

in_img1 – a greyscale or RGB image wich is to be segmented.

x – an integer specifying the x location of the seed point for the level-set operation

y – an integer specifying the y location of the seed point for the level-set operation

 

Description :

out_img1 – a greyscale or RGB image. This image contains the input image with the level-set marked on it.

out_img2 – a binary image. This image contains the edge of the level-set region.

out_img3 – a greyscale image. This image contains the phi image, i.e. the distance of each pixel from the edge of the level-set region.

 

Example:

img = openimage('tumor.gif'); %color image

figure,subplot(3,2,1);image(img),title('Input Image');hold on

x = 104;

y = 63;

[out_img1]=vsg('FillCircle',img,[x y],3,[255 0 0]);

subplot(3,2,2),image(uint8(out_img1)),title('Circle Image');

[out_img2 out_img3 out_img4]=vsg('LevelSet',img,x,y);

subplot(3,2,3); image(uint8(out_img3)),colormap(gray),title('Phi Image');

subplot(3,2,4); image((out_img4)),colormap(gray),title('Edge Image');

subplot(3,2,5); image((uint8(out_img2))),colormap(gray),title('Level Set');



Notes:

1. For RGB images, the function operates on all colour planes together and returns a single levelset for the image.

Home       Functions       Back