Skip to main content
. 2020 Oct 8;14:51. doi: 10.3389/fnbot.2020.00051

Algorithm 1.

Spatiotemporal mixed particle filter.

 procedure ({{xk,lj,wk,lj}j=1Ns}l=14) = SMPF ({{xk-1,lj,wk,lj}j=1Ns}l=14, {ΔTr,k})
      Calculate {ETk.l}l=14 based on {ΔTr,k}
      for l ← 1:4 do
         for i ← (0, 0):(239, 179) do
            if number of events in the i-th pixel < 3 then
                ETi,k,l ← 0
            end if
         end for
      end for
      for l ← 1:4 do
         for j ← 1:Ns do
             Draw xk,lj~p(xk,l|xk-1,lj)=N(xk-1,lj,Iσ2)
             Get the particle's temporal evidence ETi,k,l according to xk,lj
         end for
      end for
      for l ← 1:4 do
         NreselectEquation (5)
         if Nreselect < Thl then
             Run reselection (replacement)
             Get the new particle set {xk,lj}j=1Ns and the new temporal evidence set {ETi,k,l}i=1Ns
             for j ← 1:Ns do
                wk-1,lj1/Ns
             end for
         end if
         Normalize {ETi,k,l}i=1Ns
         Calculate μTk,l and ΣTk,l of the temporal evidence matrix ETk,l
         for j ← 1:Ns do
            Get spatial evidence ESi,k,l according to xk,lj, ESi,k,l=N(xk,lj|μTk,l,ΣTk,l)
         end for
         Normalize {ESi,k,l}i=1Ns
         for j ← 1:Ns do
            Update the particle's weight wk,lj=wk-1,lj×(ETi,k,l+α×ESi,k,l)
         end for
         Normalize {wk,lj}j=1Ns
         NeffEquation (7)
         if Neff < Theff × Ns then
            Run resampling
            Get the new particle set {xk,lj}j=1Ns
            for j ← 1:Ns do
               wk,lj1/Ns
            end for
         end if
            Update the tracked position of the l-th LED marker, xLED,k,l=j=1Nswk,lj×xk,lj
         for j ← 1:Ns do
            wk-1,ljwk,lj
         end for
      end for
 end procedure