grabResult.GrabSucceeded()==True rarely
See original GitHub issueType of Issues
Enhancement/Error
Operating System
Windows 64
Python version
3.7.9
pypylon version
1.5.4
Basler camera
acA1300-30g
Description of Problem / Question / Details
My target is to grab a single photo when a button is pressed in a GUI. The method triggered now is the one reported below:
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()
numberOfImagesToGrab = 100
camera.StartGrabbingMax(numberOfImagesToGrab)
while camera.IsGrabbing():
grabResult = camera.RetrieveResult(5000, pylon.TimeoutHandling_ThrowException)
if grabResult.GrabSucceeded():
array = grabResult.Array
camera.Close()
return array
else:
pass
grabResult.Release()
camera.Close()
except Exception as Err:
array=NULL_ARRAY
logger.error('errors with pypylon\n'+Err)
return array
As you can see, I simply want to retreive the numpy array from camera as soon as the capture is successfull (no pixels above bit depth and capture without errors/common black stripes). I want implement the fastest way to do this simple one-shot grab.
Actually it happens that often numberOfImagesToGrab = 100
is not sufficient i.e. grabResult.GrabSucceeded()
is False for the most of the times… Increase the buffer rises too much computational times. On Pylon software suite the snapping process by button is quite perfect, I see promptly and always a good photo.
Thank you for everybody willing to help, and have nice Xmas holidays.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
@thiesmoeller - I have the correct settings as checked from the bandwidth manager. I have the Basler aca4600-7gc Ace GigE Camera. I have the same problem. The statement - if grabResult.GrabSucceeded() is false more often than not. Like 95% of the time. This Camera at my current settings is giving out 2 frames per second as seen in the pylon viewer, but I am getting like 1 frame every 10 seconds or something.
Hi @MCilento93 , grabbing must succeed every time with correct settings!
What you describe ( black stripes ) results from wrong bandwidth configuration. Please read the chapter on network parameters: https://docs.baslerweb.com/network-related-parameters-(gige-cameras) You can verify correct settings in the pylon viewer with the bandwidth manager: https://docs.baslerweb.com/bandwidth-manager#optimizing-bandwidth-consumption
Bandwidth manager will show you most issues, that might exists in your setup.