class_docstr: Matrix Transform abstract class. (Affine and Homography).
  Does all the transforms around the image /  center.
  
  Parameters
  ----------
  interpolation : str
      Interpolation mode.
  padding : str or None
      Padding Mode.
  p : float
      Probability of transform's execution.
  ignore_state : bool
      Whether to ignore the pre-calculated transformation or not. If False,
      then it will lead to an incorrect behavior when the objects are of different sizes.
      Should be used only when it is assumed that the image, mask and keypoints are of
      the same size.
class_docstr_tok: ["Matrix","Transform","abstract","class",".","(","Affine","and","Homography",")",".","Does","all","the","transforms","around","the","image","\/","center",".","Parameters","--","--","--","--","--","interpolation",":","str","Interpolation","mode",".","padding",":","str","or","None","Padding","Mode",".","p",":","float","Probability","of","transform","'s","execution",".","ignore_state",":","bool","Whether","to","ignore","the","pre-calculated","transformation","or","not",".","If","False",",","then","it","will","lead","to","an","incorrect","behavior","when","the","objects","are","of","different","sizes",".","Should","be","used","only","when","it","is","assumed","that","the","image",",","mask","and","keypoints","are","of","the","same","size","."]
docstr: Method takes a matrix transform, and modifies its origin.
  
  Parameters
  ----------
  transform_matrix : numpy.ndarray
      Transform (3x3) matrix
  width : int
      Width of the coordinate frame
  height : int
      Height of the coordinate frame
  Returns
  -------
  out : numpy.ndarray
      Modified Transform matrix
code: def correct_for_frame_change(
      transform_matrix: np.ndarray, width: int, height: int
  ):
      """
      Method takes a matrix transform, and modifies its origin.
  
      Parameters
      ----------
      transform_matrix : numpy.ndarray
          Transform (3x3) matrix
      width : int
          Width of the coordinate frame
      height : int
          Height of the coordinate frame
      Returns
      -------
      out : numpy.ndarray
          Modified Transform matrix
  
      """
      origin = [(width - 1) // 2, (height - 1) // 2]
      # First, let's make sure that our transformation matrix is applied at the origin
      transform_matrix = MatrixTransform.move_transform_to_origin(
          transform_matrix, origin
      )
      # Now, if we think of scaling, rotation and translation, the image size gets increased
      # when we apply any geometric transform. Default behaviour in OpenCV is designed to crop the
      # image edges, however it is not desired when we want to deal with Keypoints (don't want them
      # to exceed teh image size).
  
      # If we imagine that the image edges are a rectangle, we can rotate it around the origin
      # to obtain the new coordinate frame
      h_new, w_new = MatrixTransform.recompute_coordinate_frame(
          transform_matrix, width, height
      )
      transform_matrix[0, -1] += w_new // 2 - origin[0]
      transform_matrix[1, -1] += h_new // 2 - origin[1]
  
      return transform_matrix, w_new, h_new
  
imports: import copy
  import random
  from abc import ABCMeta, abstractmethod
  import cv2
  import numpy
  from solt.utils import Serializable
  from solt.constants import ALLOWED_INTERPOLATIONS, ALLOWED_PADDINGS
  from ._data import DataContainer, Keypoints
  from solt.utils import img_shape_checker, validate_parameter
label_desc: Use image node_id 7 for calling the MatrixTransform obj's underlying member method code with example usage: obj.correct_for_frame_change(transform_matrix, width, height) and returns: transform_matrix,  w_new,  h_new