You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an ArrayView<RGB8, Ix2> where RGB8 if from the rgb crate. This represents an RGB image with a width and height. I have my images in this format because it makes it easier to convert to a OpenCV Mat type for image processing. However, in some situations I need the data transmuted into a ArrayView<u8, Ix3> where the new axis is of length 3 for the red, green, blue color channels.
The array memory should already be in the correct format, so ideally I shouldn't have to iterate through every element and "expand" it manually into a third axis. Is there a way to do this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have an
ArrayView<RGB8, Ix2>
whereRGB8
if from thergb
crate. This represents an RGB image with a width and height. I have my images in this format because it makes it easier to convert to a OpenCV Mat type for image processing. However, in some situations I need the data transmuted into aArrayView<u8, Ix3>
where the new axis is of length 3 for the red, green, blue color channels.The array memory should already be in the correct format, so ideally I shouldn't have to iterate through every element and "expand" it manually into a third axis. Is there a way to do this?
Beta Was this translation helpful? Give feedback.
All reactions