class_docstr: This is an auxiliary class that enables Video Stabilization for vidgear with minimalistic latency, and at the expense
  of little to no additional computational requirements.
  
  The basic idea behind it is to tracks and save the salient feature array for the given number of frames and then uses
  these anchor point to cancel out all perturbations relative to it for the incoming frames in the queue. This class relies
  heavily on **Threaded Queue mode** for error-free & ultra-fast frame handling.
docstr: An internal method that generate previous-to-current transformations [dx,dy,da].
code: def __generate_transformations(self):
      """
      An internal method that generate previous-to-current transformations [dx,dy,da].
      """
      frame_gray = cv2.cvtColor(
          self.__frame_queue[-1], cv2.COLOR_BGR2GRAY
      )  # retrieve current frame and convert to gray
      frame_gray = self.__clahe.apply(frame_gray)  # optimize it
  
      transformation = None
      try:
          # calculate optical flow using Lucas-Kanade differential method
          curr_kps, status, error = cv2.calcOpticalFlowPyrLK(
              self.__previous_gray,
              frame_gray,
              self.__previous_keypoints,
              None,
          )
  
          # select only valid key-points
          valid_curr_kps = curr_kps[status == 1]  # current
          valid_previous_keypoints = self.__previous_keypoints[
              status == 1
          ]  # previous
  
          # calculate optimal affine transformation between previous_2_current key-points
          if self.__cv2_version == 3:
              # backward compatibility with OpenCV3
              transformation = cv2.estimateRigidTransform(
                  valid_previous_keypoints, valid_curr_kps, False
              )
          else:
              transformation = cv2.estimateAffinePartial2D(
                  valid_previous_keypoints, valid_curr_kps
              )[0]
      except cv2.error as e:
          # catch any OpenCV assertion errors and warn user
          logger.warning(
              "Video-Frame is too dark to generate any transformations!"
          )
          transformation = None
  
      # check if transformation is not None
      if not (transformation is None):
          # previous_2_current translation in x direction
          dx = transformation[0, 2]
          # previous_2_current translation in y direction
          dy = transformation[1, 2]
          # previous_2_current rotation in angle
          da = np.arctan2(transformation[1, 0], transformation[0, 0])
      else:
          # otherwise zero it
          dx = dy = da = 0
  
      # save this transformation
      self.__transforms.append([dx, dy, da])
  
      # calculate path from cumulative transformations sum
      self.frame_transform = np.array(
          self.__transforms, dtype="float32"
      )
      self.__path = np.cumsum(self.frame_transform, axis=0)
      # create smoothed path from a copy of path
      self.__smoothed_path = np.copy(self.__path)
  
      # re-calculate and save GFTT key-points for current gray frame
      self.__previous_keypoints = cv2.goodFeaturesToTrack(
          frame_gray,
          maxCorners=200,
          qualityLevel=0.05,
          minDistance=30.0,
          blockSize=3,
          mask=None,
          useHarrisDetector=False,
          k=0.04,
      )
      # save this gray frame for further processing
      self.__previous_gray = frame_gray[:]
  
file_path: vidgear/vidgear/gears/stabilizer.py
imports: import cv2
  import numpy
  import logging
  from collections import deque
  from .helper import logger_handler, check_CV_version, retrieve_best_interpolation, logcurr_vidgear_ver
label_desc: Use image node_id 3 for calling the Stabilizer obj's underlying member method code with example usage: obj.__generate_transformations() without return types