I have installed openCV 3.1.0 with python3.5 every thing seemed to work fine during installation however when I am trying to execute even the following simple program, it doesn't work. OpenCV doesn't detect the camera.
I checked, and the webcam has the id 0, I also tried other values (1,2,-1) but none of them seems to work, it always shows false. I have gone through similar questions on stack overflow, but none of the solutions seems to work. I have also tried re-installing openCV multiple times, it doesn't help either.
Please help.
You should change default camera to video to test. e.g.
If the result is 'OK',then modify "cap = cv2.VideoCapture(r'E:/test.mp4')" to "cap = cv2.VideoCapture(0)",if the result is 'error',I think there is something wrong with your camera.