From ecad6064d0b97a23c6f3b734de130b7a40d5f357 Mon Sep 17 00:00:00 2001 From: builder Date: Fri, 15 Sep 2023 10:49:49 +0000 Subject: [PATCH] Samples: Automatic updates to public repository Remember to do the following: 1. Ensure that modified/deleted/new files are correct 2. Make this commit message relevant for the changes 3. Force push 4. Delete branch after PR is merged If this commit is an update from one SDK version to another, make sure to create a release tag for previous version. --- .../applications/advanced/auto_2d_settings.py | 20 +++++++++++++++++++ source/camera/advanced/capture_hdr_loop.py | 4 ++++ .../basic/capture_hdr_complete_settings.py | 8 ++++++-- source/camera/basic/capture_tutorial.md | 6 +++--- .../basic/capture_with_settings_from_yml.py | 4 ++++ .../capture_with_diagnostics.py | 4 ++++ .../info_util_other/get_camera_intrinsics.py | 2 -- 7 files changed, 41 insertions(+), 7 deletions(-) diff --git a/source/applications/advanced/auto_2d_settings.py b/source/applications/advanced/auto_2d_settings.py index 112988ac..032034b3 100644 --- a/source/applications/advanced/auto_2d_settings.py +++ b/source/applications/advanced/auto_2d_settings.py @@ -235,6 +235,26 @@ def _find_lowest_acceptable_fnum(camera: zivid.Camera, image_distance_near: floa f"WARNING: Closest imaging distance ({image_distance_near:.2f}) or farthest imaging distance" f"({image_distance_far:.2f}) is outside recommended working distance for camera [800, 2000]" ) + elif camera.info.model == zivid.CameraInfo.Model.zivid2PlusM60: + focus_distance = 600 + focal_length = 11 + circle_of_confusion = 0.008 + fnum_min = 2.37 + if image_distance_near < 300 or image_distance_far > 1100: + print( + f"WARNING: Closest imaging distance ({image_distance_near:.2f}) or farthest imaging distance" + f"({image_distance_far:.2f}) is outside recommended working distance for camera [300, 1100]" + ) + elif camera.info.model == zivid.CameraInfo.Model.zivid2PlusL110: + focus_distance = 1100 + focal_length = 11 + circle_of_confusion = 0.008 + fnum_min = 2.37 + if image_distance_near < 800 or image_distance_far > 2000: + print( + f"WARNING: Closest imaging distance ({image_distance_near:.2f}) or farthest imaging distance" + f"({image_distance_far:.2f}) is outside recommended working distance for camera [700, 1700]" + ) else: raise RuntimeError("Unsupported camera model in this sample.") diff --git a/source/camera/advanced/capture_hdr_loop.py b/source/camera/advanced/capture_hdr_loop.py index 0f4b37bc..9b0439fc 100644 --- a/source/camera/advanced/capture_hdr_loop.py +++ b/source/camera/advanced/capture_hdr_loop.py @@ -35,6 +35,10 @@ def _settings_folder(camera: zivid.Camera) -> str: return "zivid2" if model == zivid.CameraInfo.Model.zivid2PlusM130: return "zivid2Plus" + if model == zivid.CameraInfo.Model.zivid2PlusM60: + return "zivid2Plus" + if model == zivid.CameraInfo.Model.zivid2PlusL110: + return "zivid2Plus" raise RuntimeError(f"Unhandled enum value {camera.info.model}") diff --git a/source/camera/basic/capture_hdr_complete_settings.py b/source/camera/basic/capture_hdr_complete_settings.py index 1b595a40..d166ff0c 100644 --- a/source/camera/basic/capture_hdr_complete_settings.py +++ b/source/camera/basic/capture_hdr_complete_settings.py @@ -48,8 +48,12 @@ def _get_exposure_values(camera: zivid.Camera) -> Iterable[Tuple[float, float, t gains = (1.0, 1.0, 1.0) exposure_times = (timedelta(microseconds=1677), timedelta(microseconds=5000), timedelta(microseconds=100000)) brightnesses = (1.8, 1.8, 1.8) - elif camera.info.model is zivid.CameraInfo.Model.zivid2PlusM130: - apertures = (5.66, 2.38, 2.1) + elif ( + camera.info.model is zivid.CameraInfo.Model.zivid2PlusM130 + or camera.info.model is zivid.CameraInfo.Model.zivid2PlusM60 + or camera.info.model is zivid.CameraInfo.Model.zivid2PlusL110 + ): + apertures = (5.66, 2.8, 2.37) gains = (1.0, 1.0, 1.0) exposure_times = (timedelta(microseconds=1677), timedelta(microseconds=5000), timedelta(microseconds=100000)) brightnesses = (2.5, 2.5, 2.5) diff --git a/source/camera/basic/capture_tutorial.md b/source/camera/basic/capture_tutorial.md index 3bf909d7..e06a0c87 100644 --- a/source/camera/basic/capture_tutorial.md +++ b/source/camera/basic/capture_tutorial.md @@ -240,7 +240,7 @@ settings = zivid.Settings(acquisitions=[zivid.Settings.Acquisition(aperture=fnum Fully configured settings are demonstrated below. ([go to -source](https://github.com/zivid/zivid-python-samples/tree/master//source/camera/basic/capture_hdr_complete_settings.py#L68-L119)) +source](https://github.com/zivid/zivid-python-samples/tree/master//source/camera/basic/capture_hdr_complete_settings.py#L72-L123)) ``` sourceCode python print("Configuring settings for capture:") @@ -327,7 +327,7 @@ Presets](https://support.zivid.com/latest/reference-articles/presets-settings.ht for recommended .yml files tuned for your application. ([go to -source](https://github.com/zivid/zivid-python-samples/tree/master//source/camera/basic/capture_hdr_complete_settings.py#L131-L136)) +source](https://github.com/zivid/zivid-python-samples/tree/master//source/camera/basic/capture_hdr_complete_settings.py#L135-L140)) ``` sourceCode python settings_file = "Settings.yml" @@ -340,7 +340,7 @@ settings_from_file = zivid.Settings.load(settings_file) You can also save settings to .yml file. ([go to -source](https://github.com/zivid/zivid-python-samples/tree/master//source/camera/basic/capture_hdr_complete_settings.py#L131-L133)) +source](https://github.com/zivid/zivid-python-samples/tree/master//source/camera/basic/capture_hdr_complete_settings.py#L135-L137)) ``` sourceCode python settings_file = "Settings.yml" diff --git a/source/camera/basic/capture_with_settings_from_yml.py b/source/camera/basic/capture_with_settings_from_yml.py index d64e79de..5f14767f 100644 --- a/source/camera/basic/capture_with_settings_from_yml.py +++ b/source/camera/basic/capture_with_settings_from_yml.py @@ -37,6 +37,10 @@ def _settings_folder(camera: zivid.Camera) -> str: return "zivid2" if model == zivid.CameraInfo.Model.zivid2PlusM130: return "zivid2Plus" + if model == zivid.CameraInfo.Model.zivid2PlusM60: + return "zivid2Plus" + if model == zivid.CameraInfo.Model.zivid2PlusL110: + return "zivid2Plus" raise RuntimeError(f"Unhandled enum value {camera.info.model}") diff --git a/source/camera/info_util_other/capture_with_diagnostics.py b/source/camera/info_util_other/capture_with_diagnostics.py index 481cbf3b..61c78687 100644 --- a/source/camera/info_util_other/capture_with_diagnostics.py +++ b/source/camera/info_util_other/capture_with_diagnostics.py @@ -39,6 +39,10 @@ def _settings_folder(camera: zivid.Camera) -> str: return "zivid2" if model == zivid.CameraInfo.Model.zivid2PlusM130: return "zivid2Plus" + if model == zivid.CameraInfo.Model.zivid2PlusM60: + return "zivid2Plus" + if model == zivid.CameraInfo.Model.zivid2PlusL110: + return "zivid2Plus" raise RuntimeError(f"Unhandled enum value {camera.info.model}") diff --git a/source/camera/info_util_other/get_camera_intrinsics.py b/source/camera/info_util_other/get_camera_intrinsics.py index 3db89cbe..9ee45408 100644 --- a/source/camera/info_util_other/get_camera_intrinsics.py +++ b/source/camera/info_util_other/get_camera_intrinsics.py @@ -59,8 +59,6 @@ def _main(): zivid.CameraInfo().Model().zividOnePlusSmall, zivid.CameraInfo().Model().zividOnePlusMedium, zivid.CameraInfo().Model().zividOnePlusLarge, - zivid.CameraInfo().Model().zividTwo, - zivid.CameraInfo().Model().zividTwoL100, ]: settings_subsampled = zivid.Settings( acquisitions=[zivid.Settings.Acquisition()],