I want to get the number of available cameras.
I tried to count cameras like this:
for(int device = 0; device<10; device++) { VideoCapture ca
Python 3.6:
import cv2 # Get the number of cameras available def count_cameras(): max_tested = 100 for i in range(max_tested): temp_camera = cv2.VideoCapture(i) if temp_camera.isOpened(): temp_camera.release() continue return i print(count_cameras())