I have a matrix m filled as below(condensed version). Can you please help me to create a image from it. Such that I want all 10 in the matrix to be in different color.
m = np.array([[ 1 0 .... -1 10], [ 10,0, ..... 0, 10] .... ]])
The dimension of this matrix is x rows and y columns.
To make it simple, I don't need a color image.
import cv2
import numpy as np
img = np.random.randint(222, size=(100, 100,3))
gen = np.array(img ,dtype=np.uint8)
cv2.imshow('i',img)
cv2.waitKey(0)
cv2.destroyWindow('i')
mmatrix is already an image, just define image type when creating array:np.array([[...]],dtype=np.uint8). Usecv2.imshow('image',m)to display it.cv2.imshow('i',gen)