0

Hello everyone i have error when i want to execute the following code a, anyone can help me in this

while True:
    _, frame = cap.read()
    # frame = cv2.resize(frame, None, fx=0.8, fy=0.8)
    rows, cols, _ = frame.shape
    keyboard[:] = (26, 26, 26)
    frames += 1
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
XMAN
  • 3
  • 3

1 Answers1

0

It looks like the frame variable is None. Ie.

_, frame = cap.read() # <- This fails for some reason.

You need to provide some more info on cap before we can help with it.

laenkeio
  • 502
  • 2
  • 6
  • 1
    thanks for quick answe it was the problem thta i forget and give 1 for cap but i used the laptop camera so i chnaged to 0 and now it is working perfect :)))))))))))))))))))))))))))))))))))) – XMAN Apr 23 '19 at 09:29