alliedvision / VimbaPython

Old Allied Vision Vimba Python API. The successor to this API is VmbPy
BSD 2-Clause "Simplified" License
93 stars 40 forks source link

Where does the VimbaPython/Examples/synchronous_grab.py write the frame? #88

Closed lincolnelectric closed 2 years ago

lincolnelectric commented 2 years ago

hello, I want to know that Where does the VimbaPython/Examples/synchronous_grab.py write the frame? I can't find them any space.

nordeh commented 2 years ago

synchronous_grab.py grabs a frame or 10. To write to disc please add something like cv2. imwrite().

lincolnelectric commented 2 years ago

Thanks for your answer! You mean that I can add cv2. imwrite(frame) directly before the print('Got {}'.format(frame), flush=True) ?

Like that for frame in cam.get_frame_generator(limit=10, timeout_ms=3000): cv2. imwrite(frame) print('Got {}'.format(frame), flush=True)

nordeh commented 2 years ago

more precisely: for frame in cam.get_frame_generator(limit=10, timeout_ms=3000): image = frame.as_opencv_image() cv2.imwrite(frame.get_id() + '.png', image)

lincolnelectric commented 2 years ago

Thank you very much! My problem has been solved perfect! but it just a little modification: for frame in cam.get_frame_generator(limit=10, timeout_ms=3000): image = frame.as_opencv_image() cv2.imwrite(str(frame.get_id()) + '.png', image)

nordeh commented 2 years ago

very good. Thank you, Norman