# Image

# Numpy to Image

  1. PIL
array = np.random.uniform(size=(h, w, 3)) * 255
image = Image.fromarray(array)  # w, h, 3
  1. cv2

numpy array represented as image

array = np.random.uniform(size=(h, w, 3)) * 255
array = array[..., [2, 1, 0]]  # rgb to bgr
Last Updated: 12/1/2022, 9:47:42 PM