handy icon indicating copy to clipboard operation
handy copied to clipboard

test.py not been able to start with webcam

Open tarunkalra opened this issue 5 years ago • 4 comments

screenshot from 2019-02-15 16-04-24

Open CV was installed and I was able to access the webcam with my other small code but this file seems to not be opening as of now.

screenshot from 2019-02-15 16-07-59 This shows webcam is perfectly working with other code but no with this one. Help me with this one. Thanks

tarunkalra avatar Feb 15 '19 10:02 tarunkalra

Have you found a solution? I have exactly the same problem.

DilaraAlbayrak avatar Mar 22 '19 08:03 DilaraAlbayrak

What i think is that cap = cv2.VideoCapture(0) and cv2.VideoCapture(0) in hist = handy.capture_histogram(source=0) Triggers the same camera at the same time. Hence this camera. I don't know for the rest, but for me , my camera crashes and i need to wait for sometime to get my camera be okay .

ayushmankumar7 avatar Apr 23 '19 15:04 ayushmankumar7

Exactly. All you have to do is invert the lines:

hist = handy.capture_histogram(source=0) # will release the camera after execution
cap = cv2.VideoCapture(0)

libasoles avatar Jun 09 '19 03:06 libasoles

thanks brother @libasoles you saved my time !!

b31ngd3v avatar Aug 28 '20 17:08 b31ngd3v