I have a short python script that will open a webcam and show a live feed on a local website. I am using the PyCharm IDE, which offers corrections and notifies you in case of a syntax error. When I pass the VideoCapture argument, it highlights it and says "unexpected argument."
self.video = cv2.VideoCapture ( 0 )
This is in the class, and the "unexpected argument" is called 0, which is passed to the OpenCV function. Is there any way to fix this?
By the way, it works fine as it is - when you run it, it works as it should. If you delete zero, the error will disappear, but it will no longer initialize the webcam.
source
share