the following code calculates local contrasts over the whole picture. And my version is really slow. I tried multithreading with 'pool' from the 'multiprocessing'-module, but it only speeded up 10%.
Can you help me speed it up more?
#pic: gray value picture (large 2d-array)
#xvar,yvar: scalar values, e.g. 200
contrast=[np.std(pic[stepx-xvar:xvar+stepx:,stepy-yvar:yvar+stepy:])*2 \
for ystep in np.arange(yvar,np.int(pic.shape[1]-yvar),1)] \
for stepx in np.arange(xvar,np.int(pic.shape[0]-xvar),1)]