Issue
I have a numpy matrix where each row is a picture. I can reshape the rows and display the images with matplotlib.pyplot. The problem is: I don't want to display the Images separately, I want to display them after each other like a video.
How is that possible in python?
Solution
Well, I don't know if it is the best way but I've used matplotlib.pyplot to solve my problem. Import it as "plt" and do the following:
matrix=numpy.genfromtxt(path,delimiter=',') # Read the numpy matrix with images in the rows
c=matrix[0]
c=c.reshape(120, 165) # this is the size of my pictures
im=plt.imshow(c)
for row in matrix:
row=row.reshape(120, 165) # this is the size of my pictures
im.set_data(row)
plt.pause(0.02)
plt.show()
Answered By - jcdmb
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.