diff options
| author | morefigs <morefigs@gmail.com> | 2019-01-23 14:29:16 +1100 |
|---|---|---|
| committer | morefigs <morefigs@gmail.com> | 2019-01-23 14:29:16 +1100 |
| commit | fc9eaae8105a1a4c1ad1a1a98397ba5c74a54983 (patch) | |
| tree | d6e58acddd146c73c6d2ada512614b48826c612f /tests/opencv_example.py | |
| parent | 12a2808655b8dfb1b1aa40605cb04dc2a59e3e85 (diff) | |
| download | pymba-fc9eaae8105a1a4c1ad1a1a98397ba5c74a54983.tar.gz pymba-fc9eaae8105a1a4c1ad1a1a98397ba5c74a54983.zip | |
untested auto refactor changes to tests
Diffstat (limited to 'tests/opencv_example.py')
| -rw-r--r-- | tests/opencv_example.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/opencv_example.py b/tests/opencv_example.py index 238e8b4..edc6a5d 100644 --- a/tests/opencv_example.py +++ b/tests/opencv_example.py @@ -13,7 +13,7 @@ with Vimba() as vimba: # list available cameras (after enabling discovery for GigE cameras) if system.GeVTLIsPresent: - system.runFeatureCommand("GeVDiscoveryAllOnce") + system.run_feature_command("GeVDiscoveryAllOnce") time.sleep(0.2) cameraIds = vimba.getCameraIds() for cameraId in cameraIds: @@ -21,10 +21,10 @@ with Vimba() as vimba: # get and open a camera camera0 = vimba.getCamera(cameraIds[0]) - camera0.openCamera() + camera0.open() # list camera features - cameraFeatureNames = camera0.getFeatureNames() + cameraFeatureNames = camera0.get_feature_names() for name in cameraFeatureNames: print('Camera feature:', name) @@ -40,25 +40,25 @@ with Vimba() as vimba: camera0.AcquisitionMode = 'SingleFrame' # create new frames for the camera - frame0 = camera0.getFrame() # creates a frame - frame1 = camera0.getFrame() # creates a second frame + frame0 = camera0.create_frame() # creates a frame + frame1 = camera0.create_frame() # creates a second frame # announce frame - frame0.announceFrame() + frame0.announce() # capture a camera image count = 0 while count < 10: - camera0.startCapture() - frame0.queueFrameCapture() - camera0.runFeatureCommand('AcquisitionStart') - camera0.runFeatureCommand('AcquisitionStop') - frame0.waitFrameCapture() + camera0.start_capture() + frame0.queue_capture() + camera0.run_feature_command('AcquisitionStart') + camera0.run_feature_command('AcquisitionStop') + frame0.wait_capture() # get image data... - imgData = frame0.getBufferByteData() + imgData = frame0.get_buffer() - moreUsefulImgData = np.ndarray(buffer = frame0.getBufferByteData(), + moreUsefulImgData = np.ndarray(buffer = frame0.get_buffer(), dtype = np.uint8, shape = (frame0.height, frame0.width, @@ -67,10 +67,10 @@ with Vimba() as vimba: cv2.imwrite('foo{}.png'.format(count), rgb) print("image {} saved".format(count)) count += 1 - camera0.endCapture() + camera0.end_capture() # clean up after capture - camera0.revokeAllFrames() + camera0.revoke_all_frames() # close camera - camera0.closeCamera() + camera0.close() |
