#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Posts
    17
    Rep Power
    0

    getting regions out of a sparse matrix


    I'm not sure if this is easy problem or not. But basically I have a collection of pixels that exist in clumps which are seperate from another. I would like to extract regions from this collection. And, for each region i would like to extract the contour pixels.

    Has this kind of problem been solved? I get the faint idea that this is actually an NP complete AI problem, with K-means and stuff required.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Posts
    17
    Rep Power
    0
    I'm basically trying to write a simple magic wand tool in python. Any ideas?
  4. #3
  5. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    13
    I think numpy is what you are looking for.

    grim
  6. #4
  7. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    This may be a little off topic but there is an Article on devshed that deals with recursion; of particular interest is the section on the flood-fill algorithm. Where This is used for filling I would imagine that selecting pixels in an image might work in the same way? Take a look anyway, you might find it interesting .

    http://www.devshed.com/c/a/Practices/Solving-Problems-with-Recursion/3/

    Take care,

    Mark.
    programming language development: www.netytan.com Hula

  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2004
    Posts
    17
    Rep Power
    0
    Originally Posted by netytan
    This may be a little off topic...

    http://www.devshed.com/c/a/Practices/Solving-Problems-with-Recursion/3/

    Take care,

    Mark.
    Wow i feel retarded. I've been programming off and on for several years and I came up with some ulgy non-recursive solution, when that one is so simple. thanks! Numpy looks cool as well but i'll get this implemented first and then swtich in numpy if needed.

IMN logo majestic logo threadwatch logo seochat tools logo