text: '''
  In the project it will be useful to have a function to perform 
  a sliding window search on an image. This will
  just be the first iteration, where you don't actually need to do
  anything besides plot a rectangle at each window position.
  
  So, goal here is to write a function that takes in an image, 
  start and stop positions in both x and y (imagine a bounding box
  for the entire search region), window size (x and y dimensions),
  and overlap fraction (also for both x and y). Your function should
  return a list of bounding boxes for the search windows, which will
  then be passed to draw draw_boxes() function.
  '''
  import numpy as np
  import cv2
  import matplotlib.pyplot as plt
  import matplotlib.image as mpimg
  
  image = mpimg.imread('bbox-example-image.jpg')
  
  # Here is your draw_boxes function from the previous exercise
  def draw_boxes(img, bboxes, color=(0, 0, 255), thick=6):
      # Make a copy of the image
      imcopy = np.copy(img)
      # Iterate through the bounding boxes
      for bbox in bboxes:
          # Draw a rectangle given bbox coordinates
          cv2.rectangle(imcopy, bbox[0], bbox[1], color, thick)
      # Return the image copy with boxes drawn
      return imcopy
      
      
  # Define a function that takes an image,
  # start and stop positions in both x and y, 
  # window size (x and y dimensions),  
  # and overlap fraction (for both x and y)
  def slide_window(img, x_start_stop=[None, None], y_start_stop=[None, None], 
                      xy_window=(64, 64), xy_overlap=(0.5, 0.5)):
      # If x and/or y start/stop positions not defined, set to image size
      # Compute the span of the region to be searched    
      # Compute the number of pixels per step in x/y
      # Compute the number of windows in x/y
      # Initialize a list to append window positions to
      window_list = []
      # Loop through finding x and y window positions
      #     Note: you could vectorize this step, but in practice
      #     you'll be considering windows one by one with your
      #     classifier, so looping makes sense
          # Calculate each window position
          # Append window position to list
      # Return the list of windows
      return window_list
  
  windows = slide_window(image, x_start_stop=[None, None], y_start_stop=[None, None], 
                      xy_window=(128, 128), xy_overlap=(0.5, 0.5))
                         
  window_img = draw_boxes(image, windows, color=(0, 0, 255), thick=6)                    
  plt.imshow(window_img)