I'm thinking I need to use numpy or some other library to fill these arrays fast enough but I don't know much about it. Right now this operation takes about 1 second on a quad-core Intel PC, but I need it to be as fast as possible. Any help is greatly appreciated. Thanks!
import cv
class TestClass:
def __init__(self):
w = 960
h = 540
self.offx = cv.CreateMat(h, w, cv.CV_32FC1)
self.offy = cv.CreateMat(h, w, cv.CV_32FC1)
for y in range(h):
for x in range(w):
self.offx[y,x] = x
self.offy[y,x] = y