neighbors contour length

Juan Nunez-Iglesias jni.soma at gmail.com
Sat Oct 1 22:47:44 EDT 2016


Hi Jaime,

Sorry, it seems your message got lost in our flooded inboxes...

What does your source image look like? If the objects are segmented into
different labels, that is, you have an image where all the pixels of object
1 have value 1, all those of object 2 have value 2, etc., then you can
build a *region adjacency graph*, or RAG, with the right values to get what
you need. This function in scikit-image master gets you the contour lengths
between different objects, from which it should be easy to get the
information you want:

https://github.com/scikit-image/scikit-image/blob/master/skimage/future/graph/rag.py#L359

By looking at the source code you might get even simpler code for your
problem, because you just need the `count_matrix` sparse matrix. It should
be super-fast to generate and compute the values you need.

Juan.

On Thu, Sep 15, 2016 at 7:29 AM, Jaime Lopez Carvajal <jalopcar at gmail.com>
wrote:

> Hi,
>
> I would like to know if someone could help or suggest any idea how to do
> this:
>
> First, I am trying to know how many neighbors (objects) one particular
> object have using its contour.
> Second, I need to extract the length of each shared contour with every
> neighbor,
> Third, calculate their respective percentage.
>
> The last step is the easiest, but I dont know how to get the first and
> second steps.
>
> Example using attached image:
>
> Object of interest: red object
> Neighbors: three neighbors with three shared contours (yellow, green and
> blue).
> Total length contour = lengh(yellow) + lengh(yellow) + lengh(yellow)
>
> Any suggestion how can I get this?
>
> Thanks in advance, Jaime
>
> --
> 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.
> To post to this group, send email to scikit-image at googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/
> msgid/scikit-image/191cefe6-7274-45f7-b266-41bb92d64428%40googlegroups.com
> <https://groups.google.com/d/msgid/scikit-image/191cefe6-7274-45f7-b266-41bb92d64428%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20161002/176d2be3/attachment.html>


More information about the scikit-image mailing list