Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I have a binarized image in Mathematica 9, and I would like to generate a list of coordinates for clusters of pixels connected through their Moore neighborhoods, e.g. $((c_{1,1},c_{1,2},...),(c_{2,1},c_{2,2},...),...)$ where some $c_{n,k}$ is the coordinate for the $k$th pixel in the $N$th set of pixels connected through their Moore neighborhoods.

Is there a simple way to proceed with Mathematica 9's image analysis tool set?

share|improve this question
    
Have you tried MorphologicalComponents@Dilation[image, 1]? –  belisarius Jun 25 '13 at 3:35
    
@belisarius MorphologicalComponents seems to work fairly well, but what exactly is this command doing? –  Bob Jun 25 '13 at 4:47
    
Have you read this? (... and all the answers to that question, BTW) –  belisarius Jun 25 '13 at 11:36
add comment

1 Answer 1

From Belisarius' comment:

MorphologicalComponents@Dilation[image, 1]

The documentation states:

MorphologicalComponents assigns sequential integers to different connected components.

and

MorphologicalComponents by default treats all eight pixels surrounding a given pixel as adjacent.

This is precisely the connectedness you were looking for.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.