class_docstr: Class for image processing. Methods for detecting lines in an image and clustering them. Helper methods for
  drawing.
docstr: Split input image of this ImageProc object into two at <pos> for direction <direction>. Good for splitting
  double pages after <find_pages_separator_line>.
docstr_tok: ["Split","input","image","of","this","ImageProc","object","into","two","at","<","pos",">","for","direction","<","direction",">",".","Good","for","splitting","double","pages","after","<","find_pages_separator_line",">","."]
code: def split_image(self, pos, direction=DIRECTION_VERTICAL):
      """
      Split input image of this ImageProc object into two at <pos> for direction <direction>. Good for splitting
      double pages after <find_pages_separator_line>.
      """
  
      if direction not in (DIRECTION_HORIZONTAL, DIRECTION_VERTICAL):
          raise ValueError(
              "invalid value for 'direction': '%s'" % direction
          )
  
      img_dim = (
          self.img_w if direction == DIRECTION_VERTICAL else self.img_h
      )
  
      pos = int(round(pos))
  
      if not 0 <= pos <= img_dim:
          raise ValueError(
              "invalid value for 'pos' (must be in [0, %f], i.e. in image space): %d"
              % (img_dim, pos)
          )
  
      img_w = int(round(self.img_w))
      img_h = int(round(self.img_h))
  
      if direction == DIRECTION_VERTICAL:  # split left and right page
          ya1 = yb1 = 0
          ya2 = yb2 = img_h
          xa1 = 0
          xa2 = pos
          xb1 = pos
          xb2 = img_w
      else:
          xa1 = xb1 = 0
          xa2 = xb2 = img_w
          ya1 = 0
          ya2 = pos
          yb1 = pos
          yb2 = img_h
  
      assert 0 <= xa1 <= img_w
      assert 0 <= xa2 <= img_w
      assert 0 <= xb1 <= img_w
      assert 0 <= xb2 <= img_w
      assert 0 <= ya1 <= img_h
      assert 0 <= ya2 <= img_h
      assert 0 <= yb1 <= img_h
      assert 0 <= yb2 <= img_h
  
      # split and return copies
      img_a = self.input_img[ya1:ya2, xa1:xa2].copy()
      img_b = self.input_img[yb1:yb2, xb1:xb2].copy()
  
      return img_a, img_b
  
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 4 for calling the ImageProc obj's underlying member method code with example usage: obj.split_image(pos, direction) and returns: img_a,  img_b