def _convert_img_to_str(img):
    """
    Convert an image in numpy array format, shape (1, height, width, depth), to a string. Depth is 1 for grayscale, 3 for RGB.
    Returns:
        img_string
        height
        width
        depth
    """

    # height, width, and depth are all going to be features in the serialized example (just the same as the class label will be).
    height = img.shape[1]
    width = img.shape[2]
    depth = img.shape[3]

    img_string = img.tostring()

    return img_string, height, width, depth