ctu_bosch_sr450.basler_camera ============================= .. py:module:: ctu_bosch_sr450.basler_camera Classes ------- .. autoapisummary:: ctu_bosch_sr450.basler_camera.BaslerCamera Module Contents --------------- .. py:class:: BaslerCamera A class to interface with a Basler camera. This class provides a simple interface to connect to, configure, and capture images from a Basler camera. .. py:attribute:: camera :type: pypylon.pylon.InstantCamera | None :value: None .. py:attribute:: converter :type: pypylon.pylon.ImageFormatConverter | None :value: None .. py:attribute:: connected :type: bool :value: False .. py:attribute:: opened :type: bool :value: False .. py:method:: __del__() Destructor to ensure the camera is closed upon object deletion. .. py:method:: connect_by_name(name) Connects to a camera by its user-defined name. :param name: The user-defined name of the camera to connect to. :type name: str :raises RuntimeException: If no camera with the specified name is found. :raises TypeError: If the camera name is not provided. .. py:method:: connect_by_ip(ip_addr) Connects to a camera by its IP address. :param ip_addr: The IP address of the camera to connect to. :type ip_addr: str :raises RuntimeException: If no camera with the specified IP address is found. :raises TypeError: If the camera IP address is not provided. .. py:method:: open() Opens the connection to the camera. This method must be called after a successful connection has been made. .. py:method:: set_parameters(exposure_time = 0.0, gain = 0.0, gamma = 1.0) Sets the camera parameters. :param exposure_time: The exposure time in microseconds. If 0, auto-exposure is used. Defaults to 0.0. :type exposure_time: float, optional :param gain: The camera gain. If 0, auto-gain is used. Defaults to 0.0. :type gain: float, optional :param gamma: The gamma correction value. Defaults to 1.0. :type gamma: float, optional .. py:method:: grab_image(timeout = 10000) Grabs a single image from the camera. :returns: The captured image as a numpy array, or None if the grab fails. .. py:method:: close() Closes the connection to the camera.