problem with active contour - image segmentation
Show older comments
Hello, I'm trying to use active contour to create segmentation. my flow is as follow:
- load slide(image) - is a matrix where 1 represent the boundaries of the object otherwise 0.
- creating a mask for the object.
- "put" the mask on the slide and set all the areas outside the mask to 0 - we can call it cleanup.
- enable active contour on 3 result.
I have problem with number 4. as you can see in the picture below, the active contour dosent calculate the boundaries of the object. it calculate the inner area for some reason. my goal is to create boundaries to the object from 3 using active contour. Anyone have idea/hint how to fix it ?

%open the next slide
nextSlide = segMat(:,:,ii);
subplot(2,2,1)
imshow(nextSlide)
title('Original slide')
% create the mask
mask = imdilate(slide ,strel('disk' , 10));
subplot(2,2,2)
imshow(mask)
title('The mask');
%outside the mask countor set 0.
nextSlide(mask == 0 ) = 0;
subplot(2,2,3)
imshow(nextSlide)
title('clenup outside the mask');
% Active contur
bw = activecontour(nextSlide,mask,300,'edge');
subplot(2,2,4)
imshow(bw)
title('Active countour to clean slide using mask');
Answers (1)
Image Analyst
on 4 Jun 2017
0 votes
I don't know why you're using activecontour() on the mask. Why not simply use the mask as it is? If you, for some reason, want the boundaries of it use bwperim() (to get an image), or bwboundaries() (to get a list of x,y coordinates).
1 Comment
Shon Otmazgin
on 5 Jun 2017
Edited: Shon Otmazgin
on 5 Jun 2017
Categories
Find more on Active contours in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!