Open doors example in repo not working
When I try the following code from the open doors example I get
error: OpenCV(4.8.0) :-1: error: (-5:Bad argument) in function 'VideoCapture'
> Overload resolution failed:
> - Can't convert object to 'str' for 'filename'
> - VideoCapture() missing required argument 'apiPreference' (pos 2)
> - Argument 'index' is required to be an integer
> - VideoCapture() missing required argument 'apiPreference' (pos 2)I’ve got no idea what that means.
# Below are some sample images for you to try out.
img_paths = [
fetch_from_uri("https://drive.google.com/uc?id=1hA1npgptlvdRvLGewMNRqPjfclHHOiZ9"),
fetch_from_uri("https://drive.google.com/uc?id=1vv48yWe0_SwcgX8AgfYg9lxqQ8aNxz0I"),
fetch_from_uri("https://drive.google.com/uc?id=14RKAe-PioJwMf6DZP0Nk03YESJ0h7jb3"),
fetch_from_uri("https://drive.google.com/uc?id=1Q1Y6oM2_63gj35z6h8Qu3j7CVr-bfLtt"),
]
# In order to find the URL for your camera, this is a good start https://www.ispyconnect.com/cameras
# camera_url = "rtsp://172.25.101.151/ch0_0.h264" #@param {type:"string"}
camera_url = img_paths[0] # Use sample images
# camera_url = 0 # Connect to local webcam
import cv2
from matplotlib import pyplot as plt
# Open connection to camera
vcap = cv2.VideoCapture(camera_url)
# Capture frame-by-frame
ret, frame = vcap.read()
# Convert color space to RGB
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
# Show the captured image
plt.imshow(frame)
plt.title(camera_url)
plt.show()