Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to count how many cameras you have with python

import cv2

def camera_amount():
    '''Returns int value of available camera devices connected to the host device'''
    camera = 0
    while True:
        if (cv2.VideoCapture(camera).grab()) is True:
            camera = camera + 1
        else:
            cv2.destroyAllWindows()
            return(int(camera))
Comment

PREVIOUS NEXT
Code Example
Python :: how to remove the last letter of a string python 
Python :: cassandra python 
Python :: matplotlib vertical line 
Python :: python dictionary sort 
Python :: pytube sample script 
Python :: types of dict comprehension 
Python :: measure time 
Python :: keyboardinterrupt python 
Python :: dataframe color cells 
Python :: get multiple inputs in python 
Python :: round off to two decimal places python 
Python :: python sns lable axes 
Python :: ValueError: With n_samples=0, test_size=0.2 and train_size=None, the resulting train set will be empty. Adjust any of the aforementioned parameters. 
Python :: python dictionary default 
Python :: pygame get keypress code 
Python :: how to update sklearn 
Python :: creating empty set and append python 
Python :: install aws sdk python 
Python :: find all subsequences of a list python 
Python :: how to show a frequency distribution based on date in python 
Python :: custom position for axis matplotlib 
Python :: python offline translate pypi 
Python :: python plot two lines with different y axis 
Python :: How to create role discord.py 
Python :: Python NumPy broadcast_to() Function Example 
Python :: pandas nan values in column 
Python :: font in tkinter 
Python :: python install minio 
Python :: plotting roc curve 
Python :: pip uninstalled itself 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =