playing video in Centos using opencv python -
i following tutorial opencv play video on centos .
see code below , doesn't throw errors not show videos being played. if use image display program works fine tells me x11 forwarding part working fine .
[root@hadoop1 basic-motion-detection]# more demo1.py import numpy np import cv2 cap = cv2.videocapture('/home/admin/example_02.mp4') while(cap.isopened()): ret, frame = cap.read() gray = cv2.cvtcolor(frame, cv2.color_bgr2gray) cv2.startwindowthread() cv2.namedwindow("preview") cv2.imshow('preview',gray) if cv2.waitkey(1) & 0xff == ord('q'): break cap.release() cv2.destroyallwindows()
Comments
Post a Comment