code: def process_image(orig_im):
      # Load and scale down image.
      scale, im = downscale_image(orig_im)
  
      # Reduce noise.
      blur = reduce_noise_raw(im.copy())
  
      # Edged.
      edges = auto_canny(blur.copy())
  
      # Reduce noise and remove thin borders.
      debordered = reduce_noise_edges(edges.copy())
  
      # Dilate until there are a few components.
      dilation, rects, num_tries = find_components(debordered, 16)
  
      # Find the final crop.
      final_rect = find_final_crop(dilation, rects)
  
      # Crop the image and smooth.
      cropped = crop_image(orig_im, final_rect, scale)
      kernel = np.ones((5, 5), np.float32) / 25
      smooth2d = cv2.filter2D(cropped, -1, kernel=kernel)
  
      return (smooth2d, num_tries)
  
imports: import os
  import traceback
  import sys
  import cv2
  import numpy
  from PIL import Image
  from scipy.ndimage.filters import rank_filter
  import pytesseract
label_desc: Use image node_id 14 for calling a global function with example usage: process_image(orig_im) and returns: smooth2d,  num_tries