# processing kinect depth frame is very slow

I am processing depth frame from Kinect try to find the ground floor, I am using simple method of computing for each pixel whether they belong to the equation of ground surface or not, I already computed `a,b,c,d`

parameters of the equation of the ground, and I would like to process each pixel to be able to accept it as a ground pixel or now. Here is a snippet of my code for processing each frame:

```
for i in xrange(rows):
for j in xrange(cols):
x0 = frame[i, j]*math.cos((j-midx)*ax)*math.sin((i-midy)*ay)
y0 = frame[i, j]*math.sin((j-midx)*ax)*math.sin((i-midy)*ay)
z0 = frame[i, j]*math.cos((i-midy)*ay)
if abs(self.a*x0+self.b*y0+self.c*z0-self.d) < 0.0002:
frame[i,j] = 10
```

for some reason each frame take more than 10 seconds to finish. This seems extremely slow. I am not sure why. Any help would be appreciate it.

EDIT:
Here are my computer info:

Processor: Intel® Core™2 Duo CPU T6400 @ 2.00GHz × 2

Ram: 3GB