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","."]
code: def _apply_img_or_mask_perspective(
      self, img: np.ndarray, settings: dict
  ):
      h_new, w_new = self.state_dict["h_new"], self.state_dict["w_new"]
      interp, padding = self.parse_settings(settings)
      transf_m = self.state_dict["transform_matrix_corrected"]
      return cv2.warpPerspective(
          img,
          transf_m,
          (w_new, h_new),
          flags=interp,
          borderMode=padding,
      )
  
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 12 for calling the MatrixTransform obj's underlying member method code with example usage: obj._apply_img_or_mask_perspective(img, settings) and returns: cv2