OpenCV image processing not running

My basic code to run an image processing program using python opencv library doesn’t work. The code keeps running and times out. I even upgraded to the paid version assuming it was a CPU issue but that didn’t help either. Running replit on a chrome browser with camera permissions enabled on a macbook.

Repl link:

import cv2

#capture video from camera
cap = cv2.VideoCapture(1)

while True:
  #read the video frame by frame
  ret, frame =

  #display the captured frame
  cv2.imshow('Input', frame)

  #exit the loop if 'q' is pressed
  if cv2.waitKey(1) & 0xFF == ord('q'):

#release the video capture object

Hey @abhidesikan!

Your Repl cannot see your camera, it would need to be on your local machine for that.

1 Like