-
Notifications
You must be signed in to change notification settings - Fork 214
Closed
Description
I cannot grab frame from separate python thread. I'm getting the following Error
Error
a.GrabSucceeded()
Traceback (most recent call last):
File "C:\Users\oak\Anaconda2\envs\py36\lib\site-packages\IPython\core\interactiveshell.py", line 2862, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
a.GrabSucceeded()
File "C:\Users\oak\Anaconda2\envs\py36\lib\site-packages\pypylon\pylon.py", line 1719, in GrabSucceeded
return _pylon.GrabResult_GrabSucceeded(self)
_genicam.RuntimeException: No grab result data is referenced. Cannot access NULL pointer. : RuntimeException thrown (file 'grabresultptr.cpp', line 84)
Code
def start(self):
# start the thread to read frames from the video stream
t = Thread(target=self.update, name=self.name, args=(self.frames,))
t.daemon = True
t.start()
return self
def update(self, frames):
# keep looping infinitely until the thread is stopped
while True:
# if the thread indicator variable is set, stop the thread
if self.stopped:
return
grabResult = self.camera.RetrieveResult(5000, pylon.TimeoutHandling_ThrowException)
if grabResult.GrabSucceeded(): ## <---------------------- this throw the error
image = self.converter.Convert(grabResult)
# do something with image.GetArray()
grabResult.Release()
Any idea?
Thanks
Metadata
Metadata
Assignees
Labels
No labels