I want to be able to write out a color raster for each video from in python. However, when I pass a 3d array to video writer, it generates a bad output. What am I doing wrong?
Sampled code below....
h,w = raster.shape
cmap = hot()
writer = cv2.VideoWriter('output.avi', cv2.VideoWriter_fourcc('P','I','M','1'), 25, (h,w), True)
for i in range(len(images)):
x = np.transpose((dsp.normalize(images[i]**(0.5))*255).astype('uint8'))
x = (cmap(x)*255).astype('uint8')
for k in range(25):
writer.write(x)
del writer