Active Contour run time warning
Ältere Kommentare anzeigen
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 Kommentare
Adam Danz
am 31 Dez. 2020
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
am 1 Jan. 2021
Adam Danz
am 1 Jan. 2021
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
am 2 Jan. 2021
Image Analyst
am 2 Jan. 2021
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
am 2 Jan. 2021
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
am 2 Jan. 2021
The mask is some initial shape for the activecontour() function. See my attached demo.

Adam Danz
am 2 Jan. 2021
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');
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Image Segmentation finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!