Skip to content

Commit

Permalink
Samples: Automatic updates to public repository
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
csu-bot-zivid committed Sep 20, 2023
1 parent 0c15b4b commit 3b04aef
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 7 deletions.
20 changes: 20 additions & 0 deletions source/applications/advanced/auto_2d_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

Expand Down
4 changes: 4 additions & 0 deletions source/camera/advanced/capture_hdr_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")


Expand Down
8 changes: 6 additions & 2 deletions source/camera/basic/capture_hdr_complete_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions source/camera/basic/capture_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:")
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions source/camera/basic/capture_with_settings_from_yml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")


Expand Down
4 changes: 4 additions & 0 deletions source/camera/info_util_other/capture_with_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")


Expand Down
2 changes: 0 additions & 2 deletions source/camera/info_util_other/get_camera_intrinsics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()],
Expand Down

0 comments on commit 3b04aef

Please sign in to comment.