Convert to numpy array

1,449 views
Skip to first unread message

Petit Nicolas

unread,
Apr 25, 2017, 7:20:05 AM4/25/17
to imageio
Dear all,

I am reading a video file as follow :

filename = 'myfile.mov'
vid = imageio.get_reader(filename,  'ffmpeg')

Then I access a frame :

image = vid.get_data(2)

The type of this frame is "imageio.core.util.Image". How could I convert it to a regular numpy array for further processing ?

Thanks a bunch !

almar...@gmail.com

unread,
Apr 25, 2017, 7:30:00 AM4/25/17
to Petit Nicolas, imageio

It is a subclass of a numpy array, that serves to allow attaching a “meta” attribute to the data. You can use it as any other numpy array. Otherwise, you can do np.asarray(im).

--
You received this message because you are subscribed to the Google Groups "imageio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to imageio+u...@googlegroups.com.
To post to this group, send email to ima...@googlegroups.com.
Visit this group at https://groups.google.com/group/imageio.
For more options, visit https://groups.google.com/d/optout.

 

Reply all
Reply to author
Forward
0 new messages