module documentation

Utilities for managing CV2 cameras.

Function find_all_cameras Find all accessible USB cameras on the device.
Function identify_cameras For a list of camera IDs return a dictionary of name -> ID.
Constant LOGGER Undocumented
Constant MAX_CAMERAS Undocumented
Variable enumerate_cameras Undocumented
Function _swap_cam_name_to_key Create dictionary where the name is the key.
def find_all_cameras() -> list[int]: (source)

Find all accessible USB cameras on the device.

def identify_cameras(camera_ids: list[int]) -> dict[str, int]: (source)

For a list of camera IDs return a dictionary of name -> ID.

Undocumented

Value
logging.getLogger(__name__)
MAX_CAMERAS: int = (source)

Undocumented

Value
12
enumerate_cameras: Callable[[int], list[CameraInfo]] | None = (source)

Undocumented

def _swap_cam_name_to_key(input_dict: dict[int, str]) -> dict[str, int]: (source)

Create dictionary where the name is the key.

This ensures that two cameras with the same name do not overwrite each other by adding a number to duplicates.

Parameters
input_dict:dict[int, str]Dictionary of camera number -> camera name
Returns
dict[str, int]Dictionary of camera name -> camera number