python imageio例子

import imageio
img=imageio.imread('**.png')
print(img.shape)

reader=imageio.get_reader('**.mp4')
for i, im in enumerate(reader):
  print('Mean of frame %i is %1.1f' %(i,im.mean()))
#
import pylab
import imageio
filename = '/tmp/file.mp4'
vid = imageio.get_reader(filename,  'ffmpeg')
nums = [10, 287]
for num in nums:
    image = vid.get_data(num)
    fig = pylab.figure()
    fig.suptitle('image #{}'.format(num), fontsize=20)
    pylab.imshow(image)
pylab.show()

转载于:https://www.cnblogs.com/lifengfan/p/7407594.html

你可能感兴趣的:(python,人工智能)