Open ningjingzhiwei opened 4 years ago
@stefanklug
what is not working? You have to use a datastructure that is capable to handle multi-threaded access like a queue. Then you simply push the data ,that you generate in "OnImageGrabbed" into the queue. And in the main-thread you wait/query on image data available and than pop this data out of the queue
In an older issue I demonstrated this strategy in: https://github.com/basler/pypylon/issues/145#issuecomment-516848507
@ningjingzhiwei ... any feedback ?
Hello, everyone, I want to process the image data in Class ImageEventPrinter, and send the data to the main thread, referring to the demo"grabusinggrabloopthread.py", but it did not work. Can anyone help? Thanks in advance. The modified ImageEventPrinter code is as following, and I want to send Images to the main thread.
from pypylon import pylon import time
class ImageEventPrinter(pylon.ImageEventHandler): def OnImagesSkipped(self, camera, countOfSkippedImages): print("OnImagesSkipped event for device ", camera.GetDeviceInfo().GetModelName()) print(countOfSkippedImages, " images have been skipped.") print()