Open comelaine opened 3 years ago
1. a = grabResult.GetArray() #this is where i think i have a delay have a look at grabResult by print(dir(grabResult)) and see it shape. try to reduce it. if it has something like 1920,1080,3 try to convert it to mono to get 1920,1080. 2. frames.append(a.copy()) try not to use append if you can. it is a slow python method. better use function that operates frame at place or lambda. 3.check out what you really get at start - print('fps: ',camera.ResultingFrameRate.Value)
4.try to change grab strategies:
camera.StartGrabbing(pylon.GrabStrategy_LatestImages)
5.decrease image size camera.Width.SetValue(640) camera.Height.SetValue(1440)
7.use converter converter = pylon.ImageFormatConverter() //converting to opencv bgr format converter.OutputPixelFormat = pylon.PixelType_BGR8packed converter.OutputBitAlignment = pylon.OutputBitAlignment_MsbAligned ... in your grabbing cycle: image = converter.Convert(grabResult)
Hello everyone, I am working on the synch between a sensor of rotation on a wheel and the basler camera ace 2 a2A1920 160UC BAS. My goal is to synch both so that when the sensor detect a movement of 20mm the camera take a snapshot with the distance in the title of the image.
Despite I am running the program on high performance computer under windows 10, the fps average is 60fps thus the distance between two frames are higher than the 20 mm required : ( Yaxis are the distance in mm, and Xaxis are the frames )
I have 4 threads :
So I am trying to find where is the delay in my loop. Did I reach the limit of the basler camera ? ( supposed to be 150 fps ) How to optimize the code ? Thanks
run of the videostream thread
run of the saving thread