how to convert a img into a graph in a efficient way? RRS feed

  • Question

  • Hello,

    in order to segment a picture, i would like firstly to convert my img (no specific format bmp, gif, jpg...) into a graph where each node represent a pixel and each edge btw node A, and nodeB has a capacity function of GreyA and GreyB, grey level of each pixel after conversion from color to black and white.
    Do you know efficient ways to do that? Given the fact that my picture is big, i can't store my graph in a matrix? do you know any other smart ways to store it.


    Friday, October 23, 2009 1:16 PM


  • A matrix is just the mathematical description for the idea backing the array that identifies your picture bits.  If you can't store it in a "matrix" then you don't have enough memory on your computer. 

    If you don't have enough memory to support the image, you can divide the image into x parts and do the work in iterations.  There are plenty of algorithms for performing the grayscale conversion on raster graphics, pick one w/ an efficiency that matches your needs.  You can pickup a pre-built for the graph.
    Good coding involves knowing one's logical limits and expanding them as necessary.
    • Proposed as answer by Harry Zhu Thursday, October 29, 2009 2:49 AM
    • Marked as answer by Harry Zhu Friday, October 30, 2009 2:38 AM
    Friday, October 23, 2009 2:39 PM