Skip to main content
. 2025 Sep 6;25(17):5567. doi: 10.3390/s25175567
Algorithm 1 Motion vectors estimation, updating, and refinement.
  • Require: Low-light Surveillance Video IRm×n×t, Block Size Bs=8, Padding Pixel Pp=16, Overlap Pixel Op=4, Search Window Size Sws=6, Vector Updating Number num=0, Rationality Matrix R, Reasonable Degree β=0.96, and Small Search Window Size SSws=2.

  • Ensure: The Final Vector V and Rationality Matrix R.
    • 1:
        Initialization: M=mBs, N=nBs, Zero Matrix VRM×N×(t1), and RRM×N×(t1)
    • 2:
        for each k[2,t] do
    • 3:
            for each a[1,M] do
    • 4:
                for each b[1,N] do
    • 5:
                   Get the areas Aab, SAab, and SSAab.
    • 6:
                   Solve Equation (2) to get the vector (Δx,Δy).
    • 7:
                   Repeat: Compute ALab, PLab using Equation (3).
    • 8:
                   Update Rab, Vab using Equations (4) and (5).
    • 9:
                   num=num+1, and R(a,b,k1)=Rab.
    • 10:
                  While: a=1Mb=1NRabMNβ or num=15.
    • 11:
                 Get the updated vector (Δx,Δy).
    • 12:
                 Solve Equation (8) to get the best vector.
    • 13:
                 V(a,b,k1)=(Δx+VCX,Δy+VCY).
    • 14:
                 Update Rab using Equation (5) for each vector.
    • 15:
                 R(a,b,k1)=Rab.
    • 16:
              end for
    • 17:
          end for
    • 18:
      end for
    • 19:
      return The final vector V and rationality matrix R;