array = ImageData[image, "Real32"][[All, All, 2]] (*0.5*10 msec*)
T=ListCorrelate[array, 1 - #] & /@ masks (*25-30*about 250 msec*)
visibility[list_]:=(Max[list]-Min[list])/(Max[list]+Min[list])
m = Map[visibility,convol,{2}]; (*1.5*10 msec*)
{x,y}=Position[m,Max[m]]; (*0.1 msec*)
All this is fine, except that if I use ListConvolve[]
it takes 0.3-0.5 seconds300 milliseconds per frame, while if I use the convolution theorem with FFT it takes 0.15-0.20 seconds150 milliseconds on my 8-core machine, and to run in real-time it should take no more than 0.02 seconds20 milliseconds. As of now, the algorithm is an order of magnitude slower than I would like it to be.