Water-shedding non-circular particles

Claiborne Morton claiborne.morton at gmail.com
Tue Mar 24 16:42:36 EDT 2015


Hey sorry for getting back to you so late. Here is the code I am using as 
well as the segmentation (attached). Im a little new to this, so do not 
know what you mean by "selecting the markers and elevation function". Do 
you see any reason why I am getting these errors?

   import skimage.morphology as morphology
   from skimage.segmentation import random_walker
   from skimage.morphology import watershed
   from skimage.feature import peak_local_max


   image = binary_filled
   # Now we want to separate the two objects in image
   # Generate the markers as local maxima of the distance 
   # to the background
   from scipy import ndimage
   distance = ndimage.distance_transform_edt(image)
   local_maxi = peak_local_max(distance, indices=False, 
footprint=np.ones((20, 20)), labels=image) 
   markers = morphology.label(local_maxi)
   labels_ws = watershed(-distance, markers, mask=image)

Thanks again!
Clay

On Thursday, March 19, 2015 at 6:24:10 PM UTC-4, Emmanuelle Gouillart wrote:
>
> Hi Clay, 
>
> how do you select the markers and the elevation function used in the 
> watershed algorithm? Could you include the code that results in the 
> segmentation you attached? 
>
> Cheers, 
> Emmanuelle 
>
> On Thu, Mar 19, 2015 at 06:07:57PM -0400, Claiborne Morton wrote: 
> > Hey guys, Im still having trouble finding ways to separate touching 
> particles 
> > if the are not both circular. Further when dealing with elliptical 
> shapes, a 
> > single particle tends to incorrectly get cut in half. Any ideas how I 
> could 
> > change parameters in the water-shedding function to correct for this? 
> Attached 
> > are a few problem cases so you can see examples. 
>
> > Thanks, 
> > Clay 
> > Inline image 1 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20150324/9e212f62/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Original Binary.png
Type: image/png
Size: 20220 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20150324/9e212f62/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Watershedding.png
Type: image/png
Size: 426579 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20150324/9e212f62/attachment-0001.png>


More information about the scikit-image mailing list