Внешняя веб-камера не работает для Opencv и PythonPython

Программы на Python
Anonymous
Внешняя веб-камера не работает для Opencv и Python

Сообщение Anonymous »


I'm using Python cv2 module to use to run a program.

I'm able to access the inbuilt webcam but when I using the external webcam, it doesn't work.

I have used all codes like

VideoCapture(1) # or any other no.s like 0,1,2,3 etc etc. I have even disabled the inbuilt webcam using device manager.

but nothing works. I'm using pythonxy. I have tried in command prompt also. It still doesn't work.

I get the following error
runfile('C:/Users/Prashant/Documents/Python Scripts/Circledetection.py', wdir=r'C:/Users/Prashant/Documents/Python Scripts') OpenCV Error: Assertion failed (scn == 3 || scn == 4) in unknown function, file ..\..\..\modules\imgproc\src\color.cpp, line 3402 Traceback (most recent call last): File "", line 1, in File "C:\Python27\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 540, in runfile execfile(filename, namespace) File "C:/Users/Prashant/Documents/Python Scripts/Circledetection.py", line 27, in prev_gray = cv2.cvtColor(im,cv2.COLOR_BGR2GRAY) cv2.error: ..\..\..\modules\imgproc\src\color.cpp:3402: error: (-215) scn == 3 || scn == 4

Источник: https://stackoverflow.com/questions/212 ... and-python

Вернуться в «Python»