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 <jalop...@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+unsubscr...@googlegroups.com. > To post to this group, send email to scikit-image@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. > -- 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+unsubscr...@googlegroups.com. To post to this group, send an email to scikit-image@googlegroups.com. To view this discussion on the web, visit https://groups.google.com/d/msgid/scikit-image/CA%2BJHcKRP34E89W4-7O0YYOLtN%2BEgS9ybSC4p%3DKag0VzUCRzpNA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.