General UNIHIKER

Basic imshow test freezes

userHead Matha.Goram 2024-08-23 08:35:26 988 Views0 Replies

Here is my Jupyter code:

 

import cv2
import numpy as np

# designate screen dimensions for UNIHIKER display
height = 320
width = 240

# Create a red image using NumPy
red_image = np.zeros((height, width, 3), dtype=np.uint8)
red_image[:, :, 0] = 0  # Blue channel (set to 0 for red)
red_image[:, :, 1] = 0  # Green channel (set to 0 for red)
red_image[:, :, 2] = 255  # Red channel (set to 255 for red)

# Display the image
cv2.imshow("Red UNIHIKER screen", red_image)
cv2.waitKey(0)
cv2.destroyAllWindows()

 

The code is stuck at the first cell (i.e. import statements). Am I missing any prerequisites to run this test? Thanks.

 

Regards.