How to best select height when I am using watershed?

2 Ansichten (letzte 30 Tage)
Naim
Naim am 23 Jun. 2017
Bearbeitet: Naim am 23 Jun. 2017
I am building a program that isolates the largest blob in a 2D binary image, this blob always touches other objects so I want to watershed it to get it by itself. The blob can be anywhere from 1/10 the size of the image to 1/4 the size of the image. This is the standard code I'm using.
D = -bwdist(~uterusMask);
mask = imextendedmin(D, 5);
D2 = imimposemin(D, mask);
basins = watershed(D2);
ridges = basins == 0;
uterusMask = uterusMask & ~ridges;
I'm wondering how I could use the elements of the image to determine how big I want the h element in imextendedin. Could I use regionprops or is there a better way? Thanks in advance!

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by