code: def crop_image(img, center, scale, res, base=384):
      h = base * scale
  
      t = (
          Translation(
              [
                  res[0] * (-center[0] / h + 0.5),
                  res[1] * (-center[1] / h + 0.5),
              ]
          )
          .compose_after(Scale((res[0] / h, res[1] / h)))
          .pseudoinverse()
      )
  
      # Upper left point
      ul = np.floor(t.apply([0, 0]))
      # Bottom right point
      br = np.ceil(t.apply(res).astype(np.int))
  
      # crop and rescale
  
      cimg, trans = img.warp_to_shape(
          br - ul,
          Translation(-(br - ul) / 2 + (br + ul) / 2),
          return_transform=True,
      )
      c_scale = np.min(cimg.shape) / np.mean(res)
      new_img = cimg.rescale(1 / c_scale).resize(res)
      return new_img, trans, c_scale
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
  import menpo.io
  from menpo.image import Image
  from menpo.shape import PointCloud
  import cv2
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import array_ops
  from tensorflow.contrib.framework.python.ops import variables
  from tensorflow.python.training import optimizer
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import variables
  from menpo.transform import Translation, Scale
  from menpo.shape import PointCloud
label_desc: Use image node_id 16 for calling a global function with example usage: crop_image(img, center, scale, res, base) and returns: new_img,  trans,  c_scale