In article <J6********@bath.ac.uk>, stonny <ee***@bath.ac.ukwrote:
>I have a binary array representing an edge points image. The useful edge
points are generally 8 connected. There are some noise which are 8
connected in a group smaller than 10. So I want to remove all the
isolated noise group which contains less than 10 edge points from the
array.
>Can any one give some code to cope it ?
It sounds as if you need an algorithm, rather than assistance
with the meaning of the C language. You should contact an
algorithm newsgroup.
[Off topic]
When you repost there, you should probably clarify what it
means for an edge point to be "8 connected".
It also appears to me that your third sentance does not properly
follow from the first and second. Consider a noise group in
which the points are all only 2 connected, but the grouping includes
at least 10 points. According to your third sentance this is not
a candidate for removal, even though not even one member of the
group is 8 connected, because your third sentance talks only
about the size of the group and not about the properties of the group
members (other than that they are connected to each other.)
I would also ask what you would wish to have happen to the points
which are not at least 8 connected and yet are connected through
a chain (possibly an immediate adjacency) to a grouping that has
sufficiently many 8 connected points.
For example, if I take a 3 x 4 sub-array of edge points, fill that
in, and then surround it by a wall 1 deep of edge points, then
the result is a 4 x 5 sub-array in which 3 x 4 = 12 10 are 8
connected, but the outer wall is not 8 connected. What should happen
to that outer wall?
One can likely come up with topologies in which the overall group
is big enough to survive and yet the removal of a single "less useful"
point (one that is not 8 connected itself), by affecting the connection
counts of up to 7 of the 8-connected points, drops the number of 8
connected points in the group to less than the viable population of 10.
This group could have started with 16 8-connected points, along with
a cast of supporting points of less than 8 connectivity each (but which
are important in establishing the 8 connectivty of the important
points), and yet the loss of a single supporting point could result
in your criteria deeming the whole grouping to be noise. Is that really
want you would want to have happen?
--
All is vanity. -- Ecclesiastes