Hi there.

I made a script that reads in a 8x8 floating point value 'matrix' or, in fact, a list of length 64, over serial.

This works perfectly fine: 10 fps, which is the max rate of the connected sensor.

Thats ok. What is not ok: i bilinearly interpolate the matrix in the linino part using python, until i have a 57x57 matrix.

On the linino, this results in a frame drop towards a dramatic 1-1.5 fps. Apperently it is too cpu-unfriendly in python for the linino to handle this properly, although in my humble opinion, the code is not particularly heavy.

Below is the piece of code used for the iteration proces, as illustration. It is part of a custom made Matrix class, in which i 'simulate' matrix properties. In fact, it is just a 1D list, but using the class allows me to do stuff such as set/getpixel(y,x)

The class itself is called Mat, and is initialized with Mat(ydimension,xdimension)

```
def interpolate(self,iterations):
tmpmat1=None
tmpmat2=None
#Function to interpolate a matrix
#First copy self to matrix that is being used in iteration
tmpmat1=self
for i in range(0,iterations):
#create a matrix in the size of a 1-time interpolated matrix (ynew=yold*2-1 xnew=xold*2-1)
tmpmat2=Mat(tmpmat1.rows*2-1,tmpmat1.columns*2-1)
#Fill with zeros
tmpmat2.setZero()
#Project the original points onto the interpolated size matrix
for y in range(1,tmpmat1.rows+1):
for x in range(1,tmpmat1.columns+1):
tmpmat2.setpx((y-1)*2+1,(x-1)*2+1,tmpmat1.getpx(y,x))
#Fill the gaps in the rows
for y in range(1,tmpmat2.rows+1,2):
for x in range(2,tmpmat2.columns,2):
tmpmat2.setpx(y,x,(tmpmat2.getpx(y,x-1)+tmpmat2.getpx(y,x+1))/2)
#Fill the gaps in the columns
for y in range(2,tmpmat2.rows,2):
for x in range(1,tmpmat2.columns+1):
tmpmat2.setpx(y,x,(tmpmat2.getpx(y-1,x)+tmpmat2.getpx(y+1,x))/2)
tmpmat1=tmpmat2 #
del tmpmat2 #needed?
return tmpmat1
```

I tried to use NumPy as i assume this library is much optimized for this kind of stuff, but unfortunately numpy is not available on the yun and i cant get it to work either (can be my fault).

Does anyone have a suggestion? I fear that the plain python is just a bit too slow for large iterations