diff options
| author | morefigs <morefigs@gmail.com> | 2019-03-08 12:38:28 +1100 |
|---|---|---|
| committer | morefigs <morefigs@gmail.com> | 2019-03-08 12:38:28 +1100 |
| commit | bf764e872a4e4abea8d28e4c49b88b64f0bcdaaf (patch) | |
| tree | ed218d638eb76e2b0cc19d27d3df676f7551c0ea /examples/camera/opencv_acquire_image.py | |
| parent | a6bd629cfe0d143c5a159d496fd2e617a590f1e4 (diff) | |
| download | pymba-bf764e872a4e4abea8d28e4c49b88b64f0bcdaaf.tar.gz pymba-bf764e872a4e4abea8d28e4c49b88b64f0bcdaaf.zip | |
Only show 1 image in loop
Diffstat (limited to 'examples/camera/opencv_acquire_image.py')
| -rw-r--r-- | examples/camera/opencv_acquire_image.py | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/examples/camera/opencv_acquire_image.py b/examples/camera/opencv_acquire_image.py index 8925961..741f449 100644 --- a/examples/camera/opencv_acquire_image.py +++ b/examples/camera/opencv_acquire_image.py @@ -1,21 +1,5 @@ -import cv2 -from pymba import Vimba, Frame - - -def process_frame(frame: Frame): - """ - Processes the acquired frame. - """ - print(f'frame {frame.data.frameID} callback') - - # get a copy of the frame data - image = frame.buffer_data_numpy() - - # display image - cv2.imshow('Image', image) - - # wait for user to close window - cv2.waitKey(0) +from pymba import Vimba +from examples.camera.display_frame import display_frame if __name__ == '__main__': @@ -28,8 +12,8 @@ if __name__ == '__main__': # capture a single frame, more than once if desired for i in range(1): - frame_ = camera.acquire_frame() - process_frame(frame_) + frame = camera.acquire_frame() + display_frame(frame, 0) camera.disarm() |
