Thank you Tony,
Modifying the threshold value from 30 to a lower value, gives a
consistent result.
Jean-Patrick
sk.morphology.watershed(bassin_hi,markers,mask=top>30)
On 30 déc, 17:22, Tony Yu
On Fri, Dec 30, 2011 at 8:01 AM, Tony Yu
wrote: On Fri, Dec 30, 2011 at 5:39 AM, jip
wrote: Dear Emmanuelle,
Sorry for the delay. I have rewritten a clearer script https://docs.google.com/open?id=0B-YDFMbEy1grODU1Y2U0OTgtMzk1MS00Mzkx...I hope. First, it takes a 12bits imagehttps://docs.google.com/open?id=0B-YDFMbEy1grNWJlYTkwYzYtMjk0ZS00NGVl...(cy3 in the archive), isolates a region andremoves the backgroundhttps://docs.google.com/open?id=0B-YDFMbEy1grNDZjOWZjZjAtMGVmMS00ZTM2... . Regional maxima are found to get markers for watershed. Three kind of maps are also prepared. Each map, with the markers image, is submitted to the watershed algorithm.Segmentation is performed with watershed as indicated herehttp://scikits-image.org/docs/dev/auto_examples/plot_watershed.html#e..., as follow: segmentation=watershed(map,markers,mask) map:grayscale image markers:label image mask:binary image
There's a small typo here: watershed should be called as:
watershed(map, makers, mask=mask)
More specifically, in your code, you have:
sk.morphology.watershed(bassin_hi,markers,top>30)
but it should be called as:
sk.morphology.watershed(bassin_hi,markers,mask=top>30)
Without specifying `mask=`, you're setting the connectivity parameter in watershed. Even with this correction, something seems to be off since watershed seems to return blank images. Without the masks, it gives what I would expect. I'm not sure what's going on the masked output.
-Tony
Actually, I think this masked output is correct: All the markers seem to land in the masked-out regions.
mask = top > 30 print np.any(marker * mask)
False
-Tony
participants (1)
-
jip