how to convert image to numpy array code example
Example 1: open image in numpy
image = PIL.Image.open(pathToImage)
frame = numpy.asarray(image)
Example 2: pil image from numpy
from PIL import Image
PIL_image = Image.fromarray(numpy_image.astype('uint8'), 'RGB')
Example 3: from image to numpy array
import cv2
im = cv2.imread("abc.tiff",mode='RGB')
print type(im)