Skip to main content
. 2021 Nov 29;21(23):7969. doi: 10.3390/s21237969
Algorithm 1: Velocity from Optical Flow.
  • Require: Video V1, V2, and V3 from right, left, and back cameras with regions of interest R1, R2, and R3.

  • Ensure:θ˙ (angular velocity), s˙ (linear velocity).

  •  Procedure:
    •    1.
      Let t=1 and acquire the first frame I1i of Vi in gray scale, i=1,2,3;
    •    2.
      For each subsequent frame It+1i of input video, i=1,2,3:
      •   (a)
        Acquire frame It+1i in gray scale.
      •   (b)
        Detect sub-pixel accurate corners in Ri for frame Iti to obtain feature set QIi.
      •   (c)
        Calculate optical flow for Iti, QIi, and It+1i to obtain corresponding sparse feature set PIi using Lucas-Kanade.
      •   (d)
        Remove keypoints without correspondences from PIi and QIi.
      •   (e)
        Project PIi and QIi from the image plane to the ground plane to obtain PGi and QGi using the camera calibration information (P matrix) determined according to the method described in Section 3.1.
      •   (f)
        Combine point set PGi and QGi, i=1,2,3, separately to obtain ground point sets PG and QG.
      •   (g)
        Remove outliers from PG and QG using RANSAC to obtain consistent ground plane point sets PG and QG.
      •   (h)
        Compute rotation matrix R and translation vector t using PG and QG.
      •   (i)
        Compute the rotational velocity θ˙ and linear velocity s˙ using R and t.
  • return θ˙ and s˙.