How to use the pypylon.factory.find_devices 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 coxlab / eyetracker / coxlab_eyetracker / camera / BaslerCameraDevice.py View on Github external
self.im_array = None
        self.image_center = array([0, 0])
        self.pupil_position = array([0., 0.])
        self.cr_position = array([0., 0.])

        self.nframes_done = 0

        self.acquire_continuously = 0
        self.acquisition_thread = None

        self.feature_finder = _feature_finder
        
        print "Finding valid cameras..."
        time.sleep(1)
        camera_list = pylon.factory.find_devices()
        print camera_list

        if(len(camera_list) <= 0):
            raise Exception("Couldn't find a valid camera")

        try:
            print "Trying..."
            self.camera = pylon.factory.create_device(camera_list[0])
            self.camera.open()
            print "Did it"
        except:
            print "No good"
            raise Exception("Couldn't instantiate camera")

        # self.camera.setAttribute("BinningX", 1)
        # self.camera.setAttribute("BinningY", 1)
github mabl / PyPylon / examples / list_cameras.py View on Github external
from __future__ import absolute_import, print_function, division

import pypylon
import matplotlib.pyplot as plt
import tqdm
import numpy as np

print('Build against pylon library version:', pypylon.pylon_version.version)

available_cameras = pypylon.factory.find_devices()
print('Available cameras are', available_cameras)

# Grep the first one and create a camera for it
cam = pypylon.factory.create_device(available_cameras[-1])

# We can still get information of the camera back
print('Camera info of camera object:', cam.device_info)

# Open camera and grep some images
cam.open()

# Hard code exposure time
# cam.properties['ExposureTime'] = 10000.0
cam.properties['PixelFormat'] = 'Mono12'
print(cam.properties['PixelSize'])
github NMGRL / pychron / pychron / image / pylon_camera.py View on Github external
def __init__(self, identifier, *args, **kw):
        # Grep the first one and create a camera for it
        try:
            available_cameras = pypylon.factory.find_devices()
            self.debug('Available cameras {}'.format(available_cameras))
            cam = pypylon.factory.create_device(available_cameras[identifier])
        except (IndexError, NameError):
            cam = None
        self._cam = cam
        self.pixel_depth = 255
        self._grabber = None
        self._setting_config = False
        super(PylonCamera, self).__init__(*args, **kw)