Convert bitmap to DoubleArray (or other matrix)

Domanda Convert bitmap to DoubleArray (or other matrix)

  • Samstag, 16. Juli 2011 14:46
     
     

    Hello, I wanted to try using Sho for some image processing, after loading an image using System.Drawing.Image I tried to slice the green channel and discovered that it was a bitmap, not an array. I tried creating an array using DoubleArray.From but that didn't work and I don't see it in the Book of Sho. Can anyone give me a clue on how to get these values into a multi-dimensional array where I can manipulate them?

    Thanks!

    -Dan

Alle Antworten

  • Sonntag, 17. Juli 2011 14:37
     
     

    Ok, after digging around and writing my own from scratch I found that there is an "arrayFromImage" function (that's not documented in the help system or in the Book of Sho). But it doesn't appear to handle color images correctly (e.g., for an RGB image it doesn't create a multi-dimensional array). Also since it sort of implicitly converted my image to greyscale imageview() is showing it with a false colormap that is kind of annoying, can't figure out how to get it to just show me greyscale.

    -Dan