Skip to content

Commit

Permalink
Merge pull request #166 from zivid/2023-08-24-update-python-samples
Browse files Browse the repository at this point in the history
Samples: Automatic updates to public repository
  • Loading branch information
andersfagerli authored Aug 28, 2023
2 parents d3a1147 + 0e90077 commit 0c15b4b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Python samples

This repository contains python code samples for Zivid SDK v2.10.0. For
This repository contains python code samples for Zivid SDK v2.10.1. For
tested compatibility with earlier SDK versions, please check out
[accompanying
releases](https://github.com/zivid/zivid-python-samples/tree/master/../../releases).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,25 +407,25 @@ def perform_hand_eye_calibration(

idata += 1

print(f"\nPerform {mode} calibration")
print(f"\nPerform {mode} calibration")

if mode == "eye-in-hand":
calibration_result = zivid.calibration.calibrate_eye_in_hand(calibration_inputs)
elif mode == "eye-to-hand":
calibration_result = zivid.calibration.calibrate_eye_to_hand(calibration_inputs)
else:
raise ValueError(f"Invalid calibration mode: {mode}")
if mode == "eye-in-hand":
calibration_result = zivid.calibration.calibrate_eye_in_hand(calibration_inputs)
elif mode == "eye-to-hand":
calibration_result = zivid.calibration.calibrate_eye_to_hand(calibration_inputs)
else:
raise ValueError(f"Invalid calibration mode: {mode}")

transform = calibration_result.transform()
residuals = calibration_result.residuals()
transform = calibration_result.transform()
residuals = calibration_result.residuals()

print("\n\nTransform: \n")
np.set_printoptions(precision=5, suppress=True)
print(transform)
print("\n\nTransform: \n")
np.set_printoptions(precision=5, suppress=True)
print(transform)

print("\n\nResiduals: \n")
for res in residuals:
print(f"Rotation: {res.rotation():.6f} Translation: {res.translation():.6f}")
print("\n\nResiduals: \n")
for res in residuals:
print(f"Rotation: {res.rotation():.6f} Translation: {res.translation():.6f}")

return transform, residuals

Expand Down
4 changes: 2 additions & 2 deletions source/camera/advanced/capture_hdr_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ def _settings_folder(camera: zivid.Camera) -> str:
if model == zivid.CameraInfo.Model.zividOnePlusLarge:
return "zividOne"
if model == zivid.CameraInfo.Model.zividTwo:
return "zividTwo"
return "zivid2"
if model == zivid.CameraInfo.Model.zividTwoL100:
return "zividTwo"
return "zivid2"
if model == zivid.CameraInfo.Model.zivid2PlusM130:
return "zivid2Plus"
raise RuntimeError(f"Unhandled enum value {camera.info.model}")
Expand Down
4 changes: 2 additions & 2 deletions source/camera/basic/capture_with_settings_from_yml.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def _settings_folder(camera: zivid.Camera) -> str:
if model == zivid.CameraInfo.Model.zividOnePlusLarge:
return "zividOne"
if model == zivid.CameraInfo.Model.zividTwo:
return "zividTwo"
return "zivid2"
if model == zivid.CameraInfo.Model.zividTwoL100:
return "zividTwo"
return "zivid2"
if model == zivid.CameraInfo.Model.zivid2PlusM130:
return "zivid2Plus"
raise RuntimeError(f"Unhandled enum value {camera.info.model}")
Expand Down
4 changes: 2 additions & 2 deletions source/camera/info_util_other/capture_with_diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ def _settings_folder(camera: zivid.Camera) -> str:
if model == zivid.CameraInfo.Model.zividOnePlusLarge:
return "zividOne"
if model == zivid.CameraInfo.Model.zividTwo:
return "zividTwo"
return "zivid2"
if model == zivid.CameraInfo.Model.zividTwoL100:
return "zividTwo"
return "zivid2"
if model == zivid.CameraInfo.Model.zivid2PlusM130:
return "zivid2Plus"
raise RuntimeError(f"Unhandled enum value {camera.info.model}")
Expand Down

0 comments on commit 0c15b4b

Please sign in to comment.