How to apply a prefixed boundary in Active Contour Method?

2 次查看(过去 30 天)
I have two codes fo image segmentation. One is Watershed Method, and the other is Active Contour Method. In the Active Contour Method code, I have to select a boundary using the roiplay function.
%% create a mask for the breast
B=roipoly(img);
However, in the Watershed Method code, a boundary is already created by the method, and the boundary is implemented in this way:
[B,L]=bwboundaries(tumor,'noholes');
for i=1:length(B)
[rows, columns, numberOfColorChannels] = size(img);
mask = poly2mask(B{i}(:,2),B{i}(:,1), rows, columns);
end
Where the proparties of tumor is alreay defined.
And the output figure is this:
I want to apply the same boundary to Active Contour Method, without using roiplay. My goal is to merge two codes, where I get the boundary from watershed method, and the boundary is applied into active contour. How can I do that?

回答(0 个)

产品


版本

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by