So far I am using the Region Based Active Contour Segmentation by
Chan Vese from the Paper "Active Contours Without Edges" to segment picture like this
This picture is very idealized (noiseless) and simple edge detection algorithms will fail for my OCT-images to be specific.
But when I am initializing multiple level set functions at different locations, the level sets always get attracted to the same high-contrast edges.
And here is part of my code
lambda_in = lambda; lambda_out = lambda;
%Initialize with large box around perimeter of image.
Phi(1:m,1:n) = -1; Phi(2:m-1,2:n-1)=1;
for t = 0:dt:T
%Approximate derivatives
Phi_x = (Phi(:,[2:n,n]) - Phi(:,[1,1:n-1]))/2;
Phi_y = (Phi([2:m,m],:) - Phi([1,1:m-1],:))/2;
Phi_xx = Phi(:,[2:n,n]) - 2*Phi + Phi(:,[1,1:n-1]);
Phi_yy = Phi([2:m,m],:) - 2*Phi + Phi([1,1:m-1],:);
Phi_xy = ( Phi([2:m,m],[2:n,n]) + Phi([1,1:m-1],[1,1:n-1]) - Phi([1,1:m-1],[2:n,n]) - Phi([2:m,m],[1,1:n-1]) ) / 4;
%Total variational term = Num/Den "Curvature of the contour"
Num = Phi_xx.*Phi_y.^2 - 2*Phi_x.*Phi_y.*Phi_xy + Phi_yy.*Phi_x.^2;
Den = (Phi_x.^2 + Phi_y.^2).^(3/2) + a;
%Compute average value.
c_in = sum([Phi>0].*f)/(a+sum([Phi>0])); %inside the contour
c_out = sum([Phi<0].*f)/(a+sum([Phi<0])); %outside the contour
%Add to previous iteration of u.
force = dt*epsilon./(pi*(epsilon^2+Phi.^2)).*( Num./Den - lambda_in*(f-c_in).^2 + lambda_out*(f-c_out).^2);
Phi = Phi + force;
%Plotting ...
end
Prior knowledge is that the layer never overlay and mostly are stacked vertically.
So I am asking for a term that penalizes the spacing between different level set functions so that the level set functions do not get attracted by the same edges.
Has anyone done this? Anyhow are the level set functions applicable for this case?