Skip to main content
. 2019 Nov 27;19(23):5192. doi: 10.3390/s19235192
Algorithm 1 Optimal warping path algorithm
Input Accumulated cost matrix D
Output optimal warping path p*
  • 1:

    iN,jM,p1(i,j),l1

  • 2:

    whilei1 OR j1 do

  • 3:

        ll+1

  • 4:

        if i=1 then

  • 5:

            pl(i,j1)

  • 6:

            jj1

  • 7:

        else

  • 8:

            if j=1 then

  • 9:

               pl(i1,j)

  • 10:

               ii1

  • 11:

            else

  • 12:

               d*min{Di1,j1,Di1,j,Di,j1}

  • 13:

               if d*=Di1,j OR d*=Di1,j1 then

  • 14:

                   ii1

  • 15:

               end if

  • 16:

               if d*=Di,j1 OR d*=Di1,j1 then

  • 17:

                   jj1

  • 18:

               end if

  • 19:

               pl(i,j)

  • 20:

            end if

  • 21:

        end if

  • 22:

    end while

  • 23:

    p*=reverse(p)