class_docstr: Class for image processing. Methods for detecting lines in an image and clustering them. Helper methods for
  drawing.
docstr: Apply a found page rotation or skew to the detected lines in order to fix their rotation / skew.
  You can pass the output of find_rotation_or_skew into this method.
docstr_tok: ["Apply","a","found","page","rotation","or","skew","to","the","detected","lines","in","order","to","fix","their","rotation","\/","skew",".","You","can","pass","the","output","of","find_rotation_or_skew","into","this","method","."]
code: def apply_found_rotation_or_skew(
      self, rot_or_skew_type, rot_or_skew_radians
  ):
      """
      Apply a found page rotation or skew to the detected lines in order to fix their rotation / skew.
      You can pass the output of find_rotation_or_skew into this method.
      """
      if rot_or_skew_type is None or rot_or_skew_radians is None:
          return self.lines_hough
  
      if rot_or_skew_type == ROTATION:
          filter_line_dir = None
      else:  # skew
          filter_line_dir = (
              DIRECTION_HORIZONTAL
              if rot_or_skew_type == SKEW_Y
              else DIRECTION_VERTICAL
          )
  
      lines_hough_deskewed = []
      for rho, theta, theta_norm, line_dir in self.lines_hough:
          if filter_line_dir is None or (
              filter_line_dir is not None
              and line_dir == filter_line_dir
          ):
              theta += rot_or_skew_radians
              theta_norm = normalize_angle(theta)
  
          lines_hough_deskewed.append(
              (rho, theta, theta_norm, line_dir)
          )
  
      self.lines_hough = lines_hough_deskewed
  
      return self.lines_hough
  
imports: from logging import warning
  from math import degrees
  import numpy
  import cv2
  from pdftabextract.common import ROTATION, SKEW_X, SKEW_Y, DIRECTION_HORIZONTAL, DIRECTION_VERTICAL
  from pdftabextract.geom import normalize_angle, project_polarcoord_lines
  from pdftabextract.clustering import zip_clusters_and_values, find_clusters_1d_break_dist, calc_cluster_centers_1d
label_desc: Use image node_id 5 for calling the ImageProc obj's underlying member method code with example usage: obj.apply_found_rotation_or_skew(rot_or_skew_type, rot_or_skew_radians) and returns: self, self