Question

I am required to display a two dimensional numpy.array of int16 at 20fps or so. Using Matplotlib's imshow chokes on anything above 10fps. There obviously are some issues with scaling and interpolation. I should add that the dimensions of the array are not known, but will probably be around thirty by four hundred.

These are data from a sensor that are supposed to have a real-time display, so the data has to be re-sampled on the fly.

Was it helpful?

Solution

The fastest way to display 30x400 data points is to:

Use OpenGL color arrays

If you can quickly transform your data to what OpenGL understands as color array, you could create a vertex array describing quads, one for each sensor, then update your color array and draw this orthographically on screen.

Use OpenGL textures

If you can quickly transform your datapoints to an opengl texture you can draw one quad with fixed UV coordinates that is bound to this texture.

Use pygame

Pygame has support for conversion of Numpy/Numarray to surfaces, Pygame can then transform such surfaces which involves resampling, after resampling you can blit it on screen.

Misc

pyglet makes dealing with opengl very easy

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top