slice = abs(x[:, 18:])
image_bytes = cv2.imencode('.jpg', slice)[1].tobytes()
nparr = np.frombuffer(image_bytes,np.uint8)
img = cv2.imdecode(nparr, cv2.IMREAD_COLOR)
print(img)
cv2.imshow('image',img)
cv2.waitKey(0)
This is the entire test, there is nothing else besides the original image. What I’m doing is slicing it to get chunks of the image. This is why I’m wondering if I need to do something else after slicing, since imshow prints the slice in black and white correctly if I print it before processing it