problem with active contour - image segmentation
이전 댓글 표시
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');
답변 (1개)
Image Analyst
2017년 6월 4일
0 개 추천
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
Shon Otmazgin
2017년 6월 5일
편집: Shon Otmazgin
2017년 6월 5일
카테고리
도움말 센터 및 File Exchange에서 Active contours에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
