VideoCapture from camera works only in debug (Python)

asked 2019-10-24 01:28:54 -0600

updated 2019-10-24 01:50:16 -0600

I've started my project on Win7 Python3.6 OpenCV 4.1.1.26. The problem is: read() method of capture instance returns zeroes image array and True as retval. But! If i start Videocapture in debug mode - It's works fine! I can see grabbed images!

First of all, I was in doubt of my code. But I've checked example from opencv-python-tutroals. It's same behavior.

I use PyCharm community 2019.2. But checked out from console too:

  • python controller.py - blank screen
  • python -m pdb conftoller.py - works fine.

Does anyone faced with same issue? How to fix it?

edit retag flag offensive close merge delete

Comments

tutroals

please use opencv's own tutorials, as the tutroals are outdated and no more maintained.

berak gravatar imageberak ( 2019-10-24 01:32:33 -0600 )edit

Well, I don't see any difference. Ok, I did not find minimal example like in my link in link that you provided.

FatalException gravatar imageFatalException ( 2019-10-24 01:48:54 -0600 )edit

Does this help python -m pdb controller.py?

supra56 gravatar imagesupra56 ( 2019-10-24 08:13:48 -0600 )edit

Yea, exactly!

FatalException gravatar imageFatalException ( 2019-10-25 00:24:22 -0600 )edit