In [38]:
import numpy as np
from scipy import misc
import matplotlib.pyplot as plt
In [7]:
frame1 = misc.imread('frame1.png')
frame3 = misc.imread('frame3.png')
In [22]:
plt.imshow(frame1)
plt.show()
In [37]:
frame2 = np.full(frame1.shape, 255, dtype=np.uint8)
In [48]:
plt.imshow(frame2)
plt.show()
misc.imsave("frame2.pgm",frame2)
In [65]:
arr = np.stack((frame1[:,:,0], frame2[:,:,0], frame3[:,:,0], frame3[:,:,0]))
arr = np.expand_dims(arr, axis=3)
arr = np.expand_dims(arr, axis=4)
print arr.shape
frame1.shapevigra.writeHDF5(arr, 'Raw.h5', 'exported_data')
Out[65]: