Skip to main content
. 2019 May 28;19(11):2439. doi: 10.3390/s19112439
Algorithm 2 Localized sequence matching and visual localization.
Inputs:
{D} {Cosine distance};
Ntrain,Ntest {training and testing images numbers};
Vmax,Vmin {maximum and minimum speed ratios};
Vstep {Vehicle speed step-size}
ds {Sequence length};
Outputs:
S {Path-line (sequence candidate) score};
for Tds to Ntest do
  MT[DTds+1,DTds+2,,DT]; // Local searching matrix.
  j ← 1; // Path number (sequence candidates number) initialization.
  for s ← 0 to (NtrainVmax×ds) do
   for VVmin: Vstep: Vmax do
    ST,j ← 0;
    for t(Tds+1) to T do
     k(t)s+V(t(Tds+1)); // k is a line index in the column vector Dt; s is the training image number where the path originated in.
     ST,jST,j+Dk(t)t; // Score S is calculated for each possible path.
    end for
    jj+1; Sequence candidate number updating.
   end for
  end for
  SST=minj{ST,j}minj(jm1){ST,j}; m1 is the index of minimum score.
  if SST<=Th
  Matching validation is positive;
  Vehicle position ← The matched training image position
  if SST>Th
  Matching validation is negative;
  Vehicle position ← NaN (no position results)
end for