Img=imread('t11.jpg');%ThesamecellimageinthepaperisusedhereImg=double(Img(:,:,1));sigma=1.5;%scaleparameterinGaussiankernelforsmoothing.G=fspecial('gaussian',15,sigma);Img_smooth=conv2(Img,G,'same');%smoothimagebyGaussiinconvolution[Ix,Iy]=gradient(Img_smooth);f=Ix.^2+Iy.^2;g=1./(1+f);%edgeindicatorfunction.epsilon=1.5;%thepapramaterinthedefinitionofsmoothedDiracfunctiontimestep=5;%timestep,trytimestep=10,20,...,50,...mu=0.2/timestep;%coefficientoftheinternal(penalizing)energytermP(\phi)%Note:theproducttimestep*mumustbelessthan0.25forstability!lambda=5;%coefficientoftheweightedlengthtermLg(\phi)alf=1.5;%coefficientoftheweightedareatermAg(\phi);%Note:Chooseapositive(negative)alfiftheinitialcontourisoutside(inside)theobject.[nrow,ncol]=size(Img);figure;imagesc(Img,[0,255]);colormap(gray);holdon;text(6,6,'Leftclicktogetpoints,rightclicktogetendpoint','FontSize',[12],'Color','r');%Clickmousetospecifyinitialcontour/regionBW=roipoly;%getaregionRinsideapolygon,BWisabinaryimagewith1and0insideoroutsidethepolygon;c0=4;%theconstantvalueusedtodefinebinarylevelsetfunction;initialLSF=c0*2*(0.5-BW);%initiallevelsetfunction:-c0insideR,c0outsideR;u=initialLSF;[c,h]=contour(u,[00],'r');u=initialLSF;figure;imagesc(Img,[0,255]);colormap(gray);holdon;[c,h]=contour(u,[00],'r');title('Initialcontour');%startlevelsetevolutionforn=1:300u=EVOLUTION(u,g,lambda,mu,alf,epsilon,timestep,1);ifmod(n,20)==0pause(0.001);imagesc(Img,[0,255]);colormap(gray);holdon;[c,h]=contour(u,[00],'r');iterNum=[num2str(n),'iterations'];title(iterNum);holdoff;endendclose('figure1')close('figure2')axes(handles.fgh);imagesc(Img,[0,255]);colormap(gray);holdon;[c,h]=contour(u,[00],'r');totalIterNum=[num2str(n),'iterations'];