How to extract edge from a watersheded image?

Zetian Yang zetian.yang at gmail.com
Wed Mar 27 19:37:54 EDT 2013


Thanks Walt,

I need a binary image in which the edges of every labeled region are set to
1.
I've found the `find_boundaries` function in the skimage.segmentation
module, but its outcome didn't fit my requirement.

Currently, I'm using the following algorithm to solve my question.

```
bound = np.zeros(data.shape)
labels = data.max()
for label in labels:
     label_data = data==label
     bound += label_data - scipy.ndimage.binary_erosion(label_data)
```

It seemed work, but I'm not sure its correctness and is there a more
efficient method?


On Thu, Mar 28, 2013 at 12:00 AM, Stéfan van der Walt <stefan at sun.ac.za>wrote:

> Hi Zetian
>
> On Wed, Mar 27, 2013 at 5:07 AM, Zetian Yang <zetian.yang at gmail.com>
> wrote:
> > I have been trying the watershed algorithm in the skimage package and it
> is
> > really fantastic. Recently I have a problem where the edge of one
> segmented
> > image is need. Is there a convenient way to extract edges of the
> watersheded
> > result?
>
> I'm glad you find the package useful!  Do you need the edges as
> coordinates, or do you need a bitmap of the edges?  We have marching
> squares for contour finding, edge detection, etc.
>
> Stéfan
>
> --
> You received this message because you are subscribed to the Google Groups
> "scikit-image" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to scikit-image+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20130328/5750e77a/attachment.html>


More information about the scikit-image mailing list