Active Contour run time warning
이전 댓글 표시
Why I get a warning while using active contour in MATLAB?
Warning: Iterations terminated prematurely because no part of the contour lies within the image domain. If the range of pixel values in the input image is small (such as 0-1)
댓글 수: 8
Adam Danz
2020년 12월 31일
The warning tells you why it's appearing. We cannot explain why this is happening without more info such as the image, inputs to activecontour, etc.
Tamoor Aziz
2021년 1월 1일
Adam Danz
2021년 1월 1일
What is "Image"? I see that there's an attachment named Image.png and I assume the variable Image stores the image data of that file but how are you reading it in?
Since you're applying logical() I assume the image data are binary.
Tamoor Aziz
2021년 1월 2일
Image Analyst
2021년 1월 2일
Exactly? Do you mean that there is an exact solution? Where exactly is the border of that blurry smooth shape? Can you indicate it in a red curve? It looks like a judgment call to me. What about simply thresholding and calling bwboundary()?
boundary = bwboundaries(grayImage < someGrayLevel);
Adam Danz
2021년 1월 2일
Now I have the same question for "BoundingBox". What is it? I understand it was created using mask.png and that it's probably a binary matrix but we can't be sure without having the line of code you used to read in that file and create 'BoundingBox'.
Image Analyst
2021년 1월 2일
The mask is some initial shape for the activecontour() function. See my attached demo.

Adam Danz
2021년 1월 2일
I'd like the OP to share how BoundinBox was created to eliminate that step as a possible cause of the problem and to ensure that we're identically replicating the problem. That would only be 2-3 lines from your demo,
grayImage = imread(fullFileName);
mask = grayImage > thresholdValue;
And for the composite mask,
mask = bwconvhull(mask, 'Union');
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Image Segmentation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!