How to use the pypylon.pylon.InstantCamera function in pypylon

To help you get started, we’ve selected a few pypylon examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github basler / pypylon / samples / utilityimageformatconverter1.py View on Github external
def grab_image():
    try:
        camera = pylon.InstantCamera(
            pylon.TlFactory.GetInstance().CreateFirstDevice())

        camera.Open()
        result = camera.GrabOne(100)
        camera.Close()
        return result
    except genicam.GenericException as e:
        print("Could not grab an image: ", e.GetDescription())
github portugueslab / stytra / stytra / hardware / video / cameras / basler.py View on Github external
def __init__(self, cam_idx=0, **kwargs):
        super().__init__(**kwargs)
        self.camera = pylon.InstantCamera(
            pylon.TlFactory.GetInstance().CreateFirstDevice()
        )
github NMGRL / pychron / pychron / image / basler_pylon_camera.py View on Github external
def __init__(self, identifier, *args, **kw):

        # available_cameras = pypylon.factory.find_devices()
        factory = pylon.TlFactory.GetInstance()
        available_cameras = factory.EnumerateDevices()
        self.debug('Available cameras {}'.format(available_cameras))
        try:
            try:
                dev = available_cameras[int(identifier)]
            except ValueError:
                dev = next((c for c in available_cameras if c.user_defined_name == identifier), None)
            cam = pylon.InstantCamera(factory.CreateDevice(dev))
            # cam = pypylon.factory.create_device(dev)
        except (IndexError, NameError):
            cam = None
        self._cam = cam

        self.pixel_depth = 255
        self._grabber = None
        self._setting_config = False
        super(BaslerPylonCamera, self).__init__(*args, **kw)