opencv image to numpy array code example
Example 1: open image in numpy
image = PIL.Image.open(pathToImage)
frame = numpy.asarray(image)
Example 2: convert numpy array to cv2 image
PIL.Image.fromarray(img)
image = PIL.Image.open(pathToImage)
frame = numpy.asarray(image)
PIL.Image.fromarray(img)