I'm beginner learning opencv from the official documentation http://docs.opencv.org/trunk/doc/py_tutorials/py_gui/py_video_display/py_video_display.html#display-video
import numpy as np
import cv2
cap = cv2.VideoCapture(0)
while(True):
ret, frame = cap.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.imshow('frame',gray)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
cv2.destroyAllWindows()
It's giving me error "Segmentation fault (core dumped)"
Can anyone please tell me Why is that happening and how to resolve that issue?
Thanks in advance.
if(!cap.isOpened()) print 'error'immediately aftercap.open(). Also addif(ret==False) print 'frame missing'. - a-Jays