I'm working in medical image segmentation and I want to combine fuzzy connectedness algorithm with the graph cut, the idea is to segment the image with fuzzy connectedness the background and the foreground will be used as sink and source for the graph cut algorithm, this is my code to obtain the seeds coordinates for the graph cut segmentation
FC=afc(S,K); %// Absolute FC
u=FC>thresh;
v=FC<thresh;
s=regionprops(u, 'PixelIdxList'); %// listes de pixels de l´objet
t=regionprops(v, 'PixelIdxList'); %// listes de pixels de l´arrière plan
[a,b]=size(s);
[w,c,z]= size(t)
for i=1:a
for j=1:b
[y,x] = ind2sub(size(u), s(i,j).PixelIdxList);
end
end
for k=1:w
for d=1:c
[y1,x1] = ind2sub(size(v), t(k,d).PixelIdxList);
end
end
For the graph cut, I used an algorithm from the File Exchange
For example, I can define
Cs=-log([y x])
Ct=-log([y1 x1])
but the problem is how to combine the information from the cost functions like this part of the code source
u = double((Cs-Ct) >= 0);
ps = min(Cs, Ct);
pt = ps
it will exceed the matrix size