I am writing some kind of iterative image processing algorithm in a script (I do not want to use iPython) and I would like to render the image that I generate after each iteration. This is very easy to do in Matlab without blocking the main thread, but I'm trying my best to do it in Python.
In pylab, the show () function is blocked, and I need to close the window to continue executing my script. I saw that some people use the ion () function, but this has no effect in my case, for example:
pylab.ion() img = pylab.imread('image.png') pylab.imshow(img) pylab.show()
still blocked. I also saw people saying that โusing a draw instead of a plotโ can solve this problem. However, I do not use the plot, but imshow / show, is there something I am missing here?
On the other hand, PIL also has some display functions, but it seems to create a temporary image and then display it using imagemagick, so I assume that there is no way to display the image and update it in the same window using this method.
I am using Ubuntu 10.10.
Does anyone know how to do this simply, or do I need to start using something like Qt in order to have a minimal GUI that I can easily update?
source share