offlinemot.fix_view.FixView

class offlinemot.fix_view.FixView(bg_rgb, config=<config.configs object>)[source]

A class to fix the frames postions in a video that experiance shaking or random movement.

…

Variables
  • ~FixView.sift (SIFT detector object) – The sift detector object that will perform the detection on frames

  • ~FixView.flann (FLANN based matcher object) – The FLANN matcher with parameters compitaple with matching SIFT keypoints

  • ~FixView.mask_bg (numpy array) – The boolean mask which determines the acceptable area to detect keypoints from in the input image.

  • ~FixView.kps_bg (list of KeyPoint objects) – The background keypoints that will be matched with each next frame.

  • ~FixView.des_bg (numpy array) – The background descriptors of the kypoints to perform matching later

  • ~FixView.min_matches (int) – Minumum Number of matches to perform transformation on fame

  • ~FixView.kernel (numpy array) – The kernel array to do dilation process on the foreground to form the mask

get_good_matches(list) → list[source]

Filter the matches objects according to the distance and distance ratio test.

fix_view(numpy array, numpy array) → numpy array[source]

Process the frame by detecting the 2D affine motion, and transform it if it is found with enough number of matches points

set_new_bg(numpy array, numpy array) → None[source]

Set a new background image, keypoints and descriptors according to the forground if provided