Mathematical Morphology Program in c/c++

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • stonny

    #1

    Mathematical Morphology Program in c/c++

    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 ?

    Thanks

    Stonny
  • CBFalconer

    #2
    Re: Mathematical Morphology Program in c/c++

    stonny wrote:
    >
    .... snip ...
    >
    Can any one give some code to cope it ?
    [1] c:\c\junk>cat junk.c
    #include <stdio.h>

    int main(void)
    {
    int c, sum;

    c = 1; sum = 0;
    while (c < 9) {
    sum += c/c++;
    putchar(sum + '0'); putchar(' ');
    }
    puts("Establish ing the meaning of c/c++");
    return 0;
    }

    [1] c:\c\junk>cc junk.c
    junk.c: In function `main':
    junk.c:9: warning: operation on `c' may be undefined

    [1] c:\c\junk>.\a
    1 2 3 4 5 6 7 8 Establishing the meaning of c/c++

    With that out of the way, maybe someone can translate the rest of
    your subject line.

    --
    Some informative links:
    <news:news.anno unce.newusers
    <http://www.geocities.c om/nnqweb/>
    <http://www.catb.org/~esr/faqs/smart-questions.html>
    <http://www.caliburn.nl/topposting.html >
    <http://www.netmeister. org/news/learn2quote.htm l>
    <http://cfaj.freeshell. org/google/>

    Comment

    • Walter Roberson

      #3
      Re: Mathematical Morphology Program in c/c++

      In article <J67D61.J45@bat h.ac.uk>, stonny <eepdz@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

      Comment

      • Elijah Cardon

        #4
        Re: Mathematical Morphology Program in c/c++


        "Walter Roberson" <roberson@ibd.n rc-cnrc.gc.cawrote in message
        news:efbotq$i57 $1@canopus.cc.u manitoba.ca...
        In article <J67D61.J45@bat h.ac.uk>, stonny <eepdz@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?
        This sounds like something I SHOULD know, but don't. I've heard you make
        references to algorithm newsgroups before, but it just so happens I had a
        complexity issue queued up tonight before I went on-line. The ng's that
        came up on searching didn't seem to have any life in them. Did you have a
        particular one in mind? EC


        Comment

        • CBFalconer

          #5
          Re: Mathematical Morphology Program in c/c++

          Elijah Cardon wrote:
          >
          .... snip ...
          This sounds like something I SHOULD know, but don't. I've heard
          you make references to algorithm newsgroups before, but it just so
          happens I had a complexity issue queued up tonight before I went
          on-line. The ng's that came up on searching didn't seem to have
          any life in them. Did you have a particular one in mind? EC
          comp.programmin g would be suitable. Cross-posted and follow-ups
          set. Don't forget to snip material that is not germane to your
          reply.

          --
          Some informative links:
          <news:news.anno unce.newusers
          <http://www.geocities.c om/nnqweb/>
          <http://www.catb.org/~esr/faqs/smart-questions.html>
          <http://www.caliburn.nl/topposting.html >
          <http://www.netmeister. org/news/learn2quote.htm l>
          <http://cfaj.freeshell. org/google/>


          Comment

          Working...