Opening web camera in Google Colab
I am trying to open a web camera in Google Colab. I've executed the following command:
cap = cv2.VideoCapture(0)
but this is not working: the web camera is not opening.
Is it possible to open a connection to my web camera on Google Colab?
-
Go to Google Colaboratory
-
Create a new notebook
-
Click snippet panel
-
Click Camera Capture. Click insert
-
Run script: Shift + Enter
Since Colab is running in your browser, you'll want to use web APIs to access local hardware like a camera.
Here's an example showing how to capture an image from your local webcam in Colab: https://colab.research.google.com/notebooks/snippets/advanced_outputs.ipynb#scrollTo=2viqYx97hPMi