Hi,
I’m was wondering what the best method was for getting a flat array of floats from a CVImage/Mat.
I tried the approach below but it wasn’t successful.
Any pointers (no pun intended, but if they’re fast…)?
Before we try to do it your way, does the ToValues (OpenCV.Conversion) node do what you need?
It will give you a Spread<Spread<Spread< T >>>> (Channels, Rows, Cols) that you can later flatten.
Begun to get that working but I’m already worried about the speed.
I haven’t properly converted the bytes to floats at this point, which may add a little extra overhead.

Visualizing an Image in an IOBox seems like a bad idea performance-wise, also you probably want to cache the ToValues+Flattens or is it a constantly changing image?
If performance is your concern, then go for a Ptr, use Image GetData combined with ImageData Pointer
That’ll be something like this then:
I’ll have a look at the final pointer-to-data step and get back to you.
Thanks @ravazquez !!