Open GuilhermeCarvalho1144 opened 4 years ago
You are using the hardware trigger. Is it sitting idle? This will cause a timeout.
500000
Does this code can be used for grab a simple photo? I mean leaving the main while loop as soon as you get a succeded image?
import numpy as np
NULL_ARRAY=np.ndarray(shape=(0,0))
def grab_basler_photo():
array=NULL_ARRAY
try:
from pypylon import pylon
camera = pylon.InstantCamera(pylon.TlFactory.GetInstance().CreateFirstDevice())
camera.Open()
# Grabing Continusely (video) with minimal delay
camera.StartGrabbing(pylon.GrabStrategy_LatestImageOnly)
converter = pylon.ImageFormatConverter()
converter.OutputPixelFormat = pylon.PixelType_BGR8packed
converter.OutputBitAlignment = pylon.OutputBitAlignment_MsbAligned
while camera.IsGrabbing():
grabResult = camera.RetrieveResult(5000, pylon.TimeoutHandling_ThrowException)
if grabResult.GrabSucceeded():
image = converter.Convert(grabResult)
array = image.GetArray()
camera.StopGrabbing()
camera.Close()
return array
else:
pass
grabResult.Release()
camera.StopGrabbing()
camera.Close()
except Exception as Err:
array=NULL_ARRAY
logger.error('errors with pypylon\n'+Err)
return array
I'm getting this error whem the camera is rolling for a while:
The code I'm using is the following:
The camera I'm using is the Basler Racer raL4096-24gm.