import cv2
import numpy as np
big_list = []
great_list=[]
n = 28
for i in range(n):
big_list.append([255,255,255])
for i in range(28):
great_list.append(big_list)
array=np.array(great_list)
h, w, c = array.shape
array1=np.array(great_list)
h, w, c = array.shape
array2=np.array(great_list)
h, w, c = array.shape
b=0
for i in range(h):
for j in range(w):
for k in range(c):
array[i,j,k]=255-5*b
b+=1
for k in range(c):
for i in range(h):
for j in range(w):
if array1[i,j,k]<150:
array1[i,j,k]=0
for k in range(c):
for i in range(h):
for j in range(w):
if array2[i,j,k]>200:
array2[i,j,k]=255
How can ı show these 3 arrays as images in opencv
python?
I just create array? Should I use the imshow
method?
I tried to show its as image, but I get this error:
cv2.error: OpenCV(4.4.0) C:/Users/appveyor/AppData/Local/Temp/1/pip-req-build-zsozjuva/opencv/modules/highgui/src/precomp.hpp:137: error: (-215:Assertion failed) src_depth != CV_16F && src_depth != CV_32S in function 'convertToShow'