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