I am trying to learn about Opencv on embeded Linux. Currently I am working on NXP i.mx8m.
I used VS code in remote SSH. The first target is to display an image and destroy the window when pressed key "q", like usual.
import numpy as np
import cv2
img = cv2.imread('L5.jpeg')
cv2.imshow('Window name', img)
key =cv2.waitKey(0)
print(key)
if key== ord('q'):
print("pressed q")
cv2.destroyAllWindows()
The window of imshow GUI appears on the monitor which connected to I.mx8m, as wished.
BUT simply waitkey(0) doesn't respond. The window is there. The return value of cv2.waitKey(0) is always -1, no matter which key I press. I can only stop the program by Ctr+Z.
I have learned that , If I run the code on local system, it works only when the GUI window is in focus. But in a remote SSH, how can I put the HiGUI in focus?
I searched google many times, but still cannot find the solution. can anyone be so kind and help me?
I sense maybe I missed some configuration in SSH?
Thousand thanks!
regards Cliff