Re: Finding Connected components



"thomas chirs" <thomas_chris_66.nospam@xxxxxxxxxxx> wrote in
message <fioruq$jur$1@xxxxxxxxxxxxxxxxxx>...
I am trying to find out connected components in a two
dimensional set of points. When I do a scatter plot, there
seems to be a few lines which can be seen visually. I need a
method to separate the points into individual sets that
constitute a line in the graph.

Thnx

Round off your data with some tolerance (xr = round(x) /
tol, same for y), then use labeling algorithm.

If you have image processing toolbox, look at
http://www.mathworks.com/access/helpdesk_r13/help/toolbox/images/morph17.html

I know the labeling algorithm called Rosenfield's, which has
two data scans with stack bookeeping. It is not easy the
implement it (plenty of little details and exception cases
to handle, and a little mistake could screw the whole
algorithm).

There is also two ways to define connected pixel, the first
one consider next diagonal pixels are connected, other not.
You have to select the one that is suitable for your problem.

Bruno



.