Ask Your Question

JeffElse's profile - activity

2019-11-22 01:07:26 -0600 received badge  Notable Question (source)
2018-03-11 16:19:28 -0600 received badge  Popular Question (source)
2013-07-26 04:17:20 -0600 commented answer How to check if webcam is busy

How do I know if all libraries are correct? If camera is not busy, it works. So I suppose, libraries are correct. Does it work for you?

2013-07-25 15:16:27 -0600 commented answer How to check if webcam is busy

not sure if I'm doing it right, python still crashes before cc = VideoCapture()

    cam = VideoCapture()
    success = False
    if not cam.isOpened():
        success = cam.open(0)

    if success: 
        ok, img = cam.read()
2013-07-04 13:59:23 -0600 commented answer How to check if webcam is busy

it also crashes before cam = VideoCapture(0)

2013-07-04 13:13:25 -0600 commented answer How to check if webcam is busy

it fails on release(). I can see the print output before it

if cam.isOpened(): print "release" cam.release()

2013-07-04 08:29:46 -0600 commented answer How to check if webcam is busy

Thx. I've tried that, but it still crashes.

2013-07-04 05:00:43 -0600 asked a question How to check if webcam is busy

Hello,

is there a way to check if webcam is busy before taking an image? Python.exe would crash if camera is in use and following code is running

Python code:

from cv2 import *
while True:
    #need to check here if camera is busy
    cam = VideoCapture(0)
    s, img = cam.read()
    if s:    # frame captured without any errors
        imwrite("filename.jpg",img) #save image