Skip to main content
added 3 characters in body
Source Link
Ziofil
  • 2.5k
  • 17
  • 30
    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.

    array = ImageData[image, "Real32"][[All, All, 2]] (*0.5 msec*)
    T=ListCorrelate[array, 1 - #] & /@ masks            (*25-30 msec*)
    visibility[list_]:=(Max[list]-Min[list])/(Max[list]+Min[list])
    m = Map[visibility,convol,{2}];                   (*1.5 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 seconds per frame, while if I use the convolution theorem with FFT it takes 0.15-0.20 seconds on my 8-core machine, and to run in real-time it should take no more than 0.02 seconds. As of now, the algorithm is an order of magnitude slower than I would like it to be.

    array = ImageData[image, "Real32"][[All, All, 2]] (*10 msec*)
    T=ListCorrelate[array, 1 - #] & /@ masks          (*about 250 msec*)
    visibility[list_]:=(Max[list]-Min[list])/(Max[list]+Min[list])
    m = Map[visibility,convol,{2}];                   (*10 msec*)
    {x,y}=Position[m,Max[m]];                         (*0.1 msec*)

All this is fine, except that if I use ListConvolve[] it takes 300 milliseconds per frame, while if I use the convolution theorem with FFT it takes 150 milliseconds on my 8-core machine, and to run in real-time it should take no more than 20 milliseconds. As of now, the algorithm is an order of magnitude slower than I would like it to be.

Tweeted twitter.com/#!/StackMma/status/324566915303497729
added 328 characters in body
Source Link
Ziofil
  • 2.5k
  • 17
  • 30
added 148 characters in body
Source Link
Ziofil
  • 2.5k
  • 17
  • 30

I tried CUDAImageConvolve[], but it gives error messages for a too large kernel... Unfortunately a kernel is too large already around 60 x 60.

I tried CUDAImageConvolve[], but it gives error messages for a too large kernel... Unfortunately a kernel is too large already around 60 x 60.

added 259 characters in body
Source Link
Ziofil
  • 2.5k
  • 17
  • 30
Loading
edited tags
Link
Loading
Source Link
Ziofil
  • 2.5k
  • 17
  • 30
Loading