old_contents: import cv2
  
  class Greyscale():
  
      def run(self, img_arr):
          img_arr = cv2.cvtColor(img_arr, cv2.COLOR_RGB2GRAY)
          return img_arr
      
      
      
  class Canny():
  
      def __init__(self, low_threshold=60, high_threshold=110):
          self.low_threshold = low_threshold
          self.high_threshold = high_threshold
          
          
      def run(self, img_arr):
          return cv2.Canny(img_arr, 
                           self.low_threshold, 
                           self.high_threshold)
  
      
  
  class GaussianBlur():
  
      def __init__(self, kernal_size=5):
          self.kernal_size = kernal_size
          
      def run(self, img_arr):
          return cv2.GaussianBlur(img_arr, 
                                  (self.kernel_size, self.kernel_size), 0)
          
          
          
  class Pipeline():
      def __init__(self, steps):
          self.steps = steps
      
      def run(self, val):
          for step in self.steps:
              f = step['f']
              args = step['args']
              kwargs = step['kwargs']
              
              val = f(val, *args, **kwargs)
          return val
      
new_contents: import cv2
  
  class ImgGreyscale():
  
      def run(self, img_arr):
          img_arr = cv2.cvtColor(img_arr, cv2.COLOR_RGB2GRAY)
          return img_arr
  
  
  
  class ImgCanny():
  
      def __init__(self, low_threshold=60, high_threshold=110):
          self.low_threshold = low_threshold
          self.high_threshold = high_threshold
          
          
      def run(self, img_arr):
          return cv2.Canny(img_arr, 
                           self.low_threshold, 
                           self.high_threshold)
  
      
  
  class ImgGaussianBlur():
  
      def __init__(self, kernal_size=5):
          self.kernal_size = kernal_size
          
      def run(self, img_arr):
          return cv2.GaussianBlur(img_arr, 
                                  (self.kernel_size, self.kernel_size), 0)
  
  
  
  class ImgCrop:
      """
      Crop an image to an area of interest. 
      """
      def __init__(self, top=0, bottom=0, left=0, right=0):
          self.top = top
          self.bottom = bottom
          self.left = left
          self.right = right
          
      def run(self, img_arr):
          width, height, _ = img_arr.shape
          img_arr = img_arr[self.top:height-self.bottom, 
                            self.left: width-self.right]
          return img_arr
          
          
          
  class Pipeline():
      def __init__(self, steps):
          self.steps = steps
      
      def run(self, val):
          for step in self.steps:
              f = step['f']
              args = step['args']
              kwargs = step['kwargs']
              
              val = f(val, *args, **kwargs)
          return val
      
subject: add ImgCrop part