I've written a little python program where in one function I iterate over a Numpy array of an image. Almost the whole runtime happens in one small portion where I access the individual pixels (they have RGB values). It looks something like this:
arr #800x800 pixel
for x in range(height):
for y in range(width):
temp = [0,0,0]
#prepare some stuff
tmp[0]+=arr.item(x, y, 0) # This takes
tmp[1]+=arr.item(x, y, 1) # almost all
tmp[2]+=arr.item(x, y, 2) # the runtime
#do some stuff with the values
Is there a faster way to access the pixel values?