code: def imread(img_path, boThrowErrorIfExifRotationTagSet=True):
      if not os.path.exists(img_path):
          print("ERROR: image path does not exist.")
          error
  
      rotation = rotationFromExifTag(img_path)
      if boThrowErrorIfExifRotationTagSet and rotation != 0:
          print(
              "Error: exif roation tag set, image needs to be rotated by %d degrees."
              % rotation
          )
      img = cv2.imread(img_path)
      if img is None:
          print("ERROR: cannot load image " + img_path)
          error
      if rotation != 0:
          img = imrotate(
              img, -90
          ).copy()  # got this error occassionally without copy "TypeError: Layout of the output array img is incompatible with cv::Mat"
      return img
  
imports: from __future__ import print_function
  from builtins import str
  import sys, os, time
  import numpy
  from builtins import range
  import copy, textwrap
  from PIL import Image, ImageFont, ImageDraw
  from PIL.ExifTags import TAGS
  import cntk
  from cntk import input_variable, Axis
  from utils.nms_wrapper import apply_nms_to_single_image_results
  from utils.rpn.bbox_transform import regress_rois
  import cv2
label_desc: Use image node_id 5 for calling a global function with example usage: imread(img_path, boThrowErrorIfExifRotationTagSet) and returns: img