baidut
3/3/2016 - 12:00 PM

activecontour seedpoint regionGrowing

activecontour seedpoint regionGrowing


seedpointR = 240;
seedpointC = 630;

%W = graydiffweight(I, seedpointC, seedpointR,'GrayDifferenceCutoff',25);
tol = 20;

imshow(S2);
hold on;
poly = regionGrowing(S2, [], 0.11); % click somewhere inside the lungs
plot(poly(:,1), poly(:,2), 'LineWidth', 4)


% didn't support grayconnected 
% BW = grayconnected(I,seedpointR,seedpointC,tol);


mask = zeros(size(I));

[nRow, nCol] = size(I);
mask(nRow/2:end-25,25:end-25) = 1;
  
figure, imshow(mask);
title('Initial Contour Location');

bw = activecontour(I,mask,300);
  
implot(Rgb, S2, bw);