Learn practical skills, build real-world projects, and advance your career

computer-vision

Use the "Run" button to execute the code.

!pip install jovian --upgrade --quiet
import jovian
# Execute this to save new versions of the notebook
jovian.commit(project="computer-vision")
[jovian] Attempting to save notebook..
# video
import cv2

cap = cv2.VideoCapture(0);
print(cap.isOpened())
while(cap.isOpened()):
    ret, frame = cap.read()

    print(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
    print(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))  
    
 
    gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
    cv2.imshow('frame', gray)
    
    
      
    if cv2.waitKey(1) & 0xff == ord('q'):
        break
       
        
        
cap.release()
cv2.destroyAllWindows()

--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) <ipython-input-1-edb967c1ac76> in <module> 1 # video ----> 2 import cv2 3 4 cap = cv2.VideoCapture(0); 5 print(cap.isOpened()) ModuleNotFoundError: No module named 'cv2'