Hi,
I’m using the following code. The code read a video, convert each frame in gray scale, and then display the frame. So basically, the code make the video black and white and display it.
import numpy as np
import cv2
video_capture = cv2.VideoCapture("randomVideo.mp4")
while True:
ret, frame = video_capture.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.imshow('frame', gray)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# Release handle to the webcam
video_capture.release()
cv2.destroyAllWindows()
But I’m getting the following error:
(frame:1000): Gtk-WARNING **: cannot open display:
Can anyone please tell me how to resolve the issue? I understand that the docker image doesn’t contain the display driver or display mode. . But which driver I need to install?
Thank you!