Opening web camera in Google Colab

Shobhit Srivastava picture Shobhit Srivastava · Jan 27, 2019 · Viewed 41.9k times · Source

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?

Answer

Vighnesh Bhat Chanila picture Vighnesh Bhat Chanila · May 8, 2020
  1. Go to Google Colaboratory

  2. Create a new notebook

  3. Click snippet panel

  4. Click Camera Capture. Click insert

  5. Run script: Shift + Enter

enter image description here