NOTE: It is possible to install opend cv using
pip install opencv-python==3.3.0.9
But the camera will not be detected using this installation. opencv should be installed from source (which will take a long time). Therefore, it is not recommended to use opencv if you just want to access the camera
import cv2
cap = cv2.VideoCapture(0)
ret, frame = cap.read() #Captures frames in BGR format (Depends on webcam)
cap.release()
ret
frame
import matplotlib.pyplot as plt
%matplotlib inline
frame.shape
plt.imshow(frame) #BGR format
rgb_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
plt.imshow(rgb_frame)