Skip to main content
. 2022 Dec 28;23(1):311. doi: 10.3390/s23010311
Algorithm 1: Key-Frame Extraction [29]
  1.   Read videos from the directory

  2.   Store all videos in an array name all_videos []

  3.   Specify a threshold T for keyframe selection

  4.   for i uptoall_videos in array

  5.   Read frame i as prev_frame also do (frameCount) in video (i)

  6.   Loop until

while (fc < frameCount)
  • 7.

      Read the next frame as curr_frame (i + 1)

  • 8.

      Compute absdiff (curr_frame, prev_frame)

  • 9.

      Compute the Average of absdiff

  • 10.

    If Averagediff > T (threshold)

  • 11.

    Select the current frame as a keyframe

  • 12.

    Update frames: prev_frame = curr_frame

  • 13.

    Update: