How to use the pypylon.pylon.TimeoutHandling_Return 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 StudentCV / TableSoccerCV / ImageSource.py View on Github external
def get_newest_frame(self):


        if self.live == 1:
            if self.grab_status:

                with self.icam.RetrieveResult(200, py.TimeoutHandling_Return) as result:

                    image = cv2.cvtColor(result.Array, cv2.COLOR_RGB2HSV)

                    self.frame_count = self.frame_count + 1
                    self.__calc_frametime(time.time())
                    return image
            else:
                raise Exception('Camera not Grabbing')
        else:
            if self.cap.isOpened() or True:
                
                ret, frame = self.cap.read()
 
                self.frame_count = self.frame_count + 1
                self.__calc_frametime(time.time())
github NMGRL / pychron / pychron / image / basler_pylon_camera.py View on Github external
def read(self):
        ok, img = False, None
        if self._cam and not self._setting_config:
            res = self._cam.RetrieveResult(0, pylon.TimeoutHandling_Return)
            if res.IsValid():
                ok = True
                img = res.Array
            res.Release()

        return ok, img