Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

it's a typical python nooooooob error. you're blindly pasting other ppls code.

you have to add CHECKS,

  • if the capture could be opened at all: if not cap.isOpened(): ...
  • if it (still) could read an image: `if not img is NONE: ...

VideoCapture will NEVER trow any exceptions on failure, so you HAVE to check manually

also, next time (can't help to say it -- please RESEARCH your problem, before asking anywhere, it'S the most prominent error happenig to python kids (they're all like you).

it's a typical python nooooooob error. you're blindly pasting other ppls code.

you have to add CHECKS,

  • if the capture could be opened at all: if not cap.isOpened(): ...
  • if it (still) could read an image: `if if not img is NONE: ...

VideoCapture will NEVER trow any exceptions on failure, so you HAVE to check manually

also, next time (can't help to say it -- please RESEARCH your problem, before asking anywhere, it'S it's the most prominent error happenig to python kids (they're all like you).

it's a typical python nooooooob error. you're blindly pasting other ppls code.

you have to add CHECKS,

  • if the capture could be opened at all: if not cap.isOpened(): ...
  • if it (still) could read an image: if not img is NONE: ...

VideoCapture will NEVER trow any exceptions on failure, so you HAVE to check manually

also, next time (can't help to say it -- please RESEARCH your problem, before asking anywhere, it's the most prominent error happenig to python kids (they're all like you).

it's a typical python nooooooob error. you're blindly pasting other ppls code.

you have to add CHECKS,

  • if the capture could be opened at all: if not cap.isOpened(): ...
  • if it (still) could read an image: if not img is NONE: ...

VideoCapture will NEVER trow throw any exceptions on failure, so you HAVE to check manually