From 0949b9b367e036e78c079087f6c5e47969fe112e Mon Sep 17 00:00:00 2001 From: builder Date: Fri, 19 Jun 2026 17:41:59 +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. --- README.md | 5 +- source/applications/README.md | 3 + .../applications/advanced/auto_2d_settings.py | 3 + .../applications/advanced/barcode/README.md | 3 + .../advanced/barcode/barcode_detector.py | 3 + source/applications/advanced/color_balance.py | 3 + source/applications/advanced/downsample.py | 4 + .../applications/advanced/gamma_correction.py | 3 + .../advanced/hand_eye_calibration/README.md | 233 +----------------- .../hand_eye_calibration.py | 3 + .../hand_eye_calibration/hand_eye_gui.py | 3 + .../pose_conversion_gui.py | 3 + .../hand_eye_calibration/pose_conversions.py | 3 + .../robodk_hand_eye_calibration.py | 8 +- .../utilize_hand_eye_calibration.py | 3 + .../verify_hand_eye_with_visualization.py | 3 + .../advanced/multi_camera/README.md | 3 + .../multi_camera/multi_camera_calibration.py | 6 +- .../multi_camera_calibration_from_zdf.py | 6 +- .../multi_camera/stitch_by_transformation.py | 4 + .../stitch_by_transformation_from_zdf.py | 4 + .../projector/project_and_find_marker.py | 5 +- .../read_project_and_capture_image.py | 3 + .../advanced/projector/reproject_points.py | 3 + source/applications/advanced/roi/README.md | 3 + .../advanced/roi/roi_box_via_aruco_marker.py | 3 + .../advanced/roi/roi_box_via_checkerboard.py | 3 + .../applications/advanced/stitching/README.md | 3 + .../stitch_continuously_rotating_object.py | 3 + .../stitch_using_robot_mounted_camera.py | 3 + ...itch_via_local_point_cloud_registration.py | 3 + .../applications/advanced/transform/README.md | 3 + ..._point_cloud_from_millimeters_to_meters.py | 3 + .../transform_point_cloud_via_aruco_marker.py | 163 +++++++++++- .../transform_point_cloud_via_checkerboard.py | 32 ++- .../basic/file_formats/convert_zdf.py | 3 + .../basic/file_formats/read_iterate_zdf.py | 3 + .../basic/visualization/README.md | 3 + .../capture_and_visualize_normals.py | 3 + .../capture_from_file_camera_vis_3d.py | 3 + .../basic/visualization/capture_vis_3d.py | 3 + .../project_image_start_and_stop.py | 3 + .../basic/visualization/read_zdf_vis_3d.py | 3 + source/camera/README.md | 3 + source/camera/advanced/capture_2d_and_3d.py | 3 + .../advanced/capture_and_print_normals.py | 3 + source/camera/basic/README.md | 3 + source/camera/basic/capture.py | 3 + .../camera/basic/capture_from_file_camera.py | 3 + .../basic/capture_hdr_complete_settings.py | 3 + .../basic/capture_with_settings_from_yml.py | 3 + ...t_settings_for_flickering_ambient_light.py | 3 + .../capture_with_diagnostics.py | 3 + .../info_util_other/firmware_updater.py | 3 + .../info_util_other/get_camera_intrinsics.py | 3 + .../measure_scene_conditions.py | 4 + ...matic_network_configuration_for_cameras.py | 4 + .../network/network_configuration.py | 4 + source/camera/info_util_other/warmup.py | 3 + source/camera/maintenance/README.md | 3 + .../maintenance/correct_camera_in_field.py | 3 + .../maintenance/reset_camera_in_field.py | 3 + .../maintenance/verify_camera_in_field.py | 3 + .../verify_camera_in_field_from_zdf.py | 3 + 64 files changed, 373 insertions(+), 259 deletions(-) create mode 100644 source/applications/README.md create mode 100644 source/applications/advanced/barcode/README.md create mode 100644 source/applications/advanced/multi_camera/README.md create mode 100644 source/applications/advanced/roi/README.md create mode 100644 source/applications/advanced/stitching/README.md create mode 100644 source/applications/advanced/transform/README.md create mode 100644 source/applications/basic/visualization/README.md create mode 100644 source/camera/README.md create mode 100644 source/camera/basic/README.md create mode 100644 source/camera/maintenance/README.md diff --git a/README.md b/README.md index b347c22f..6f492c00 100644 --- a/README.md +++ b/README.md @@ -199,10 +199,11 @@ from the camera can be used. - **multi_camera** - [multi_camera_calibration] - Use captures of a calibration object to generate transformation matrices to a single - coordinate frame, from connected cameras. + coordinate frame, from multiple connected cameras. - [multi_camera_calibration_from_zdf] - Use captures of a calibration object to generate transformation matrices to a - single coordinate frame, from ZDF files. + single coordinate frame, from ZDF files captured with multiple + cameras. - [stitch_by_transformation] - Use transformation matrices from Multi-Camera calibration to transform point clouds into a single coordinate frame, from connected cameras. diff --git a/source/applications/README.md b/source/applications/README.md new file mode 100644 index 00000000..ce8f1f3e --- /dev/null +++ b/source/applications/README.md @@ -0,0 +1,3 @@ +# Applications + +> **Tutorials:** Read the [Applications](https://support.zivid.com/en/latest/camera/academy/applications.html) tutorials on Zivid Knowledge Base. diff --git a/source/applications/advanced/auto_2d_settings.py b/source/applications/advanced/auto_2d_settings.py index a2161f71..740c4945 100644 --- a/source/applications/advanced/auto_2d_settings.py +++ b/source/applications/advanced/auto_2d_settings.py @@ -16,6 +16,9 @@ first. If you want to use your own white reference (white wall, piece of paper, etc.) instead of using the calibration board, you can provide your own mask in _main(). Then you will have to specify the lower limit for f-number yourself. +For more information about camera settings, check out this article: +https://support.zivid.com/en/latest/camera/reference-articles/camera-settings.html + """ import argparse diff --git a/source/applications/advanced/barcode/README.md b/source/applications/advanced/barcode/README.md new file mode 100644 index 00000000..a232819e --- /dev/null +++ b/source/applications/advanced/barcode/README.md @@ -0,0 +1,3 @@ +# Barcode Detection + +> **Tutorial:** Read the full [Barcode Detection](https://support.zivid.com/en/latest/camera/academy/applications/barcode-detection.html) tutorial on Zivid Knowledge Base. diff --git a/source/applications/advanced/barcode/barcode_detector.py b/source/applications/advanced/barcode/barcode_detector.py index 39c265f4..7a399c1d 100644 --- a/source/applications/advanced/barcode/barcode_detector.py +++ b/source/applications/advanced/barcode/barcode_detector.py @@ -1,6 +1,9 @@ """ Detect and decode linear and matrix barcodes from a 2D capture. +For more information on how to use the Zivid Barcode Detector, check out the Barcode Detection tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/barcode-detection.html + """ import zivid diff --git a/source/applications/advanced/color_balance.py b/source/applications/advanced/color_balance.py index 34e34c14..9c27445b 100644 --- a/source/applications/advanced/color_balance.py +++ b/source/applications/advanced/color_balance.py @@ -8,6 +8,9 @@ If you want to use your own white reference (white wall, piece of paper, etc.) instead of using the calibration board, you can provide your own mask in _main(). +For more information on color balance, check out this article: +https://support.zivid.com/en/latest/reference-articles/settings/2d-settings/color-balance.html + """ import argparse diff --git a/source/applications/advanced/downsample.py b/source/applications/advanced/downsample.py index 4b65ff10..91628765 100644 --- a/source/applications/advanced/downsample.py +++ b/source/applications/advanced/downsample.py @@ -3,6 +3,9 @@ The ZDF files for this sample can be found under the main instructions for Zivid samples. +For more information on downsampling point clouds, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/downsampling.html + """ import argparse @@ -58,6 +61,7 @@ def _main() -> None: point_cloud = frame.point_cloud() + print(f"Before downsampling: {point_cloud.width * point_cloud.height} point cloud") visualize_point_cloud(point_cloud) diff --git a/source/applications/advanced/gamma_correction.py b/source/applications/advanced/gamma_correction.py index 5bac450d..b64d89d8 100644 --- a/source/applications/advanced/gamma_correction.py +++ b/source/applications/advanced/gamma_correction.py @@ -1,6 +1,9 @@ """ Capture 2D image with gamma correction. +For more information about gamma correction, check out this article: +https://support.zivid.com/en/latest/camera/reference-articles/settings/2d-settings/gamma.html + """ import argparse diff --git a/source/applications/advanced/hand_eye_calibration/README.md b/source/applications/advanced/hand_eye_calibration/README.md index aaf4761f..8dbdfdb5 100644 --- a/source/applications/advanced/hand_eye_calibration/README.md +++ b/source/applications/advanced/hand_eye_calibration/README.md @@ -1,234 +1,3 @@ # Hand-Eye Calibration -This page provides an overview of how to **perform**, **verify**, and **use Hand–Eye Calibration** with Zivid cameras. - -If you are new to Hand–Eye Calibration, start with the [Hand–Eye Calibration – Concept & Theory][HandEyeTutorial-url], explaining: - -- What Hand–Eye Calibration is -- The difference between **eye-in-hand** and **eye-to-hand** -- Best practices for dataset (point clouds and robot poses) acquisition - -If you already know what you’re doing and just want to run calibration or check out our Hand-Eye calibration code, continue reading. - - - -- [Quick Start: Just Calibrate](#quick-start-just-calibrate) -- [Programmatic Hand–Eye Calibration](#programmatic-handeye-calibration) -- [Dataset Acquisition Samples](#dataset-acquisition-samples) -- [After Hand–Eye Calibration](#after-handeye-calibration) -- [Verifying Calibration Accuracy](#verifying-calibration-accuracy) -- [Summary: Which Tool Should I Use?](#summary-which-tool-should-i-use) - ---- - -## Quick Start: Just Calibrate - -If your goal is **only to compute the Hand–Eye Transformation Matrix**, use one of the tools below and follow Zivid’s [best-practice guide for capture poses][ZividHandEyeCalibration-url]. - -### Hand–Eye Calibration GUI (Recommended) - -- Tutorial: [Hand–Eye GUI Tutorial][HandEyeCalibrationGUITutorial-url] -- Application: [HandEyeCalibration GUI][HandEyeCalibrationGUI-url] - -Best choice if you: - -- Want a guided, no-code workflow - ---- - -## Programmatic Hand–Eye Calibration - -The following applications produce a Hand–Eye Transformation Matrix from robot poses and calibration captures. - -### Minimal Hand-Eye Calibration Code Example - -- Sample: [HandEyeCalibration][HandEyeCalibration-url] -- Tutorial: [Integrating Zivid Hand-Eye Calibration][hand-eye-procedure-url] - -Workflow: - -1. User inputs robot pose in the form of a 4x4 transformation matrix (manual entry) -2. Camera captures the calibration object -3. User moves the robot to a new capture pose and enters the command to add a new pose -4. First three steps are repeated (typically 10–20 pose pairs) -5. User enters the command to perform calibration and the application returns a Hand-Eye Transformation Matrix - -Use this if you: - -- Want the simplest integration example -- Are building your own calibration pipeline - ---- - -### Hand Eye Calibration CLI Tool - -- Tutorial: [Zivid CLI Tool for Hand–Eye Calibration][CLI application-url] -- Installed with: - - Windows Zivid installer - - `tools` deb package on Ubuntu - -Use this if you: - -- Already have a dataset (robot poses + point clouds) -- Want a command-line, batch-style workflow - ---- - -## Dataset Acquisition Samples - -The samples below show how to acquire robot poses and point clouds, then compute the Hand–Eye Transformation Matrix. - -### RoboDK-Based (Robot-Agnostic) - -- Sample: [RoboDKHandEyeCalibration][RobodkHandEyeCalibration-url] -- Tutorial: [Any Robot + RoboDK + Python Hand–Eye Tutorial][RoboDKHandEyeTutorial-url] -- Supported robots: [RoboDK robot library][robodk-robot-library-url] - -Features: - -- Works with any RoboDK-supported robot -- Capture poses are manually defined in the `.rdk` file -- Fully automated robot control - ---- - -### Universal Robots (e.g. UR5e) - -- Sample: [UniversalRobotsPerformHandEyeCalibration][URhandeyecalibration-url] -- Tutorial: [UR5e + Python Hand–Eye Tutorial][URHandEyeTutorial-url] - -Features: - -- Designed specifically for UR robots -- Fully automated robot control - ---- - -## After Hand–Eye Calibration - -The following applications assume that a **Hand–Eye Transformation Matrix already exists**. - -### Utilize Hand-Eye Calibration - -- Sample: [UtilizeHandEyeCalibration][UtilizeHandEyeCalibration-url] -- Tutorial: [How To Use The Result Of Hand-Eye Calibration][UtilizeHandEyeCalibrationTutorial-url] - -Demonstrates how to: - -- Transform poses from camera coordinates to robot coordinates -- Use the transform in real applications (e.g., bin picking) - -Example workflow: - -1. Capture a point cloud with a Zivid camera -2. Find an object pick pose in camera coordinate system -3. Transform the pose into robot coordinate system -4. Plan and execute the robot motion - ---- - -### Pose Conversions - -- Sample: [PoseConversions][PoseConversions-url] -- Application: [PoseConversions GUI][PoseConversionsGUI-url] -- Theory: [Conversions Between Common Orientation Representations][PoseConversionsTheory-url] - -Zivid primarily operates with a (4x4) Transformation Matrix (Rotation Matrix + Translation Vector). This example shows how to convert to and from: - -- Axis–Angle -- Rotation Vector -- Roll–Pitch–Yaw -- Quaternion - -Useful for integrating with robot controllers. - ---- - -## Verifying Calibration Accuracy - -### Verify Hand-Eye With Visualization - -- Sample: [VerifyHandEyeWithVisualization][VerifyHandEyeWithVisualization-url] - -Application validation approach: - -- Loads the hand-eye dataset and output (transformation matrix) -- For each dataset pair: - - Transforms the point cloud to common coordinate system - - Finds the checkerboard centroid cartesian coordinates - - Removes the points outside the the checkerboard ROI -- Overlaps transformed point clouds -- Visualizes alignment accuracy - -Best for: - -- Visual verification -- Detecting systematic rotation/translation errors - ---- - -### RoboDK Touch Test Verification - -- Script: [RobodkHandEyeVerification][RobodkHandEyeVerification-url] -- Tutorial: [Verify Hand-Eye Calibration Result Via Touch Test][RobodkHandEyeVerificationTutorial-url] - -Verification steps: - -1. Robot moves to a predefined capture pose -2. User places the calibration object in the FOV -3. Camera estimates a touch point -4. Robot physically touches the calibration object -5. User repeats the test at multiple locations - -Best for: - -- Physical validation -- High-accuracy requirement applications - ---- - -## Summary: Which Tool Should I Use? - -| Goal | Recommended Tool | -|------|------------------| -| Conceptual understanding | [Knowledge Base article][HandEyeTutorial-url] | -| Guided calibration | [Hand–Eye GUI][HandEyeCalibrationGUITutorial-url] | -| Minimal integration example | [HandEyeCalibration][HandEyeCalibration-url] | -| Existing dataset | [Hand–Eye GUI][HandEyeCalibrationGUITutorial-url]| -| UR robots | [Hand–Eye GUI][HandEyeCalibrationGUITutorial-url] or [UR Hand–Eye sample][URHandEyeTutorial-url] | -| Any robot | [Hand–Eye GUI][HandEyeCalibrationGUITutorial-url] or [RoboDK Hand–Eye sample][RoboDKHandEyeTutorial-url] | -| Use calibration result | [UtilizeHandEyeCalibration][UtilizeHandEyeCalibrationTutorial-url] | -| Verify visually | [Hand–Eye GUI][HandEyeCalibrationGUITutorial-url] or [VerifyHandEyeWithVisualization][VerifyHandEyeWithVisualization-url] | -| Verify physically | [Hand–Eye GUI][HandEyeCalibrationGUITutorial-url] or [RoboDK Touch Test][RobodkHandEyeVerification-url] | - - -[HandEyeTutorial-url]: https://support.zivid.com/latest/academy/applications/hand-eye.html - -[HandEyeCalibration-url]: hand_eye_calibration.py - -[HandEyeCalibrationGUI-url]: hand_eye_gui.py -[HandEyeCalibrationGUITutorial-url]: https://support.zivid.com/en/latest/academy/applications/hand-eye/hand-eye-gui.html - -[UtilizeHandEyeCalibration-url]: utilize_hand_eye_calibration.py -[UtilizeHandEyeCalibrationTutorial-url]: https://support.zivid.com/en/latest/academy/applications/hand-eye/how-to-use-the-result-of-hand-eye-calibration.html - -[VerifyHandEyeWithVisualization-url]: verify_hand_eye_with_visualization.py -[ZividHandEyeCalibration-url]: https://support.zivid.com/latest/academy/applications/hand-eye/hand-eye-calibration-process.html -[hand-eye-procedure-url]: https://support.zivid.com/en/latest/academy/applications/hand-eye/hand-eye-calibration-process.html#custom-integration - -[PoseConversions-url]: pose_conversions.py -[PoseConversionsGUI-url]: pose_conversion_gui.py -[PoseConversionsTheory-url]: https://support.zivid.com/en/latest/reference-articles/pose-conversions.html - -[CLI application-url]: https://support.zivid.com/latest/academy/applications/hand-eye/zivid_CLI_tool_for_hand_eye_calibration.html - -[URhandeyecalibration-url]: ur_hand_eye_calibration/universal_robots_perform_hand_eye_calibration.py -[URHandEyeTutorial-url]: https://support.zivid.com/en/latest/academy/applications/hand-eye/ur5-robot-%2B-python-generate-dataset-and-perform-hand-eye-calibration.html - -[RobodkHandEyeCalibration-url]: robodk_hand_eye_calibration/robodk_hand_eye_calibration.py -[RoboDKHandEyeTutorial-url]: https://support.zivid.com/en/latest/academy/applications/hand-eye/robodk-%2B-python-generate-dataset-and-perform-hand-eye-calibration.html - -[RobodkHandEyeVerification-url]: robodk_hand_eye_calibration/robodk_verify_hand_eye_calibration.py -[RobodkHandEyeVerificationTutorial-url]: https://support.zivid.com/en/latest/academy/applications/hand-eye/hand-eye-calibration-verification-via-touch-test.html - -[robodk-robot-library-url]: https://robodk.com/supported-robots +> **Tutorial:** Read the full [Hand-Eye Calibration](https://support.zivid.com/en/latest/camera/academy/applications/hand-eye.html) tutorial on Zivid Knowledge Base. \ No newline at end of file diff --git a/source/applications/advanced/hand_eye_calibration/hand_eye_calibration.py b/source/applications/advanced/hand_eye_calibration/hand_eye_calibration.py index ce251e8a..88abe1ab 100644 --- a/source/applications/advanced/hand_eye_calibration/hand_eye_calibration.py +++ b/source/applications/advanced/hand_eye_calibration/hand_eye_calibration.py @@ -1,6 +1,9 @@ """ Perform Hand-Eye calibration. +For more information on Hand-Eye calibration, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/hand-eye.html + """ import argparse diff --git a/source/applications/advanced/hand_eye_calibration/hand_eye_gui.py b/source/applications/advanced/hand_eye_calibration/hand_eye_gui.py index a7f53d37..eb2fe388 100644 --- a/source/applications/advanced/hand_eye_calibration/hand_eye_gui.py +++ b/source/applications/advanced/hand_eye_calibration/hand_eye_gui.py @@ -19,6 +19,9 @@ The `zividsamples` package is available in the /modules folder in the `zivid-python-samples` repository. `pip install /path/to/zivid-python-samples/modules` +For more information on Hand-Eye GUI, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/hand-eye/hand-eye-gui.html + """ import sys diff --git a/source/applications/advanced/hand_eye_calibration/pose_conversion_gui.py b/source/applications/advanced/hand_eye_calibration/pose_conversion_gui.py index 2abb2692..ce3a6372 100644 --- a/source/applications/advanced/hand_eye_calibration/pose_conversion_gui.py +++ b/source/applications/advanced/hand_eye_calibration/pose_conversion_gui.py @@ -6,6 +6,9 @@ - Roll-Pitch-Yaw (Euler angles) - Quaternion +For more information on pose conversions, check out this article: +https://support.zivid.com/en/latest/camera/reference-articles/pose-conversions.html + """ from PyQt5.QtWidgets import QAction, QHBoxLayout, QMainWindow, QVBoxLayout, QWidget diff --git a/source/applications/advanced/hand_eye_calibration/pose_conversions.py b/source/applications/advanced/hand_eye_calibration/pose_conversions.py index a4478944..257bd161 100644 --- a/source/applications/advanced/hand_eye_calibration/pose_conversions.py +++ b/source/applications/advanced/hand_eye_calibration/pose_conversions.py @@ -10,6 +10,9 @@ The convenience functions from this example can be reused in applicable applications. The YAML files for this sample can be found under the main instructions for Zivid samples. +For more information on pose conversions, check out this article: +https://support.zivid.com/en/latest/camera/reference-articles/pose-conversions.html + """ import enum diff --git a/source/applications/advanced/hand_eye_calibration/robodk_hand_eye_calibration/robodk_hand_eye_calibration.py b/source/applications/advanced/hand_eye_calibration/robodk_hand_eye_calibration/robodk_hand_eye_calibration.py index 12e5342e..b3bb881f 100644 --- a/source/applications/advanced/hand_eye_calibration/robodk_hand_eye_calibration/robodk_hand_eye_calibration.py +++ b/source/applications/advanced/hand_eye_calibration/robodk_hand_eye_calibration/robodk_hand_eye_calibration.py @@ -3,9 +3,6 @@ You must modify each robot pose to your scene using the RoboDK GUI interface. -More information about RoboDK: -https://robodk.com/doc/en/Getting-Started.html - The sample comes with a .rdk sample environment file using a Universal Robots UR5e robot. To use the sample with your robot an rdk file needs to be created using a model of your robot. @@ -14,6 +11,11 @@ https://support.zivid.com/latest/academy/applications/hand-eye/hand-eye-calibration-process.html Make sure to launch your RDK file and connect to robot through Robodk before running this script. +You can find the complete tutorial with a detailed explanation at: +https://support.zivid.com/en/latest/camera/academy/applications/hand-eye/robodk-%2B-python-generate-dataset-and-perform-hand-eye-calibration.html + +More information about RoboDK is available at: https://robodk.com/doc/en/Getting-Started.html + """ import argparse diff --git a/source/applications/advanced/hand_eye_calibration/utilize_hand_eye_calibration.py b/source/applications/advanced/hand_eye_calibration/utilize_hand_eye_calibration.py index 123e65dd..82dc2a34 100644 --- a/source/applications/advanced/hand_eye_calibration/utilize_hand_eye_calibration.py +++ b/source/applications/advanced/hand_eye_calibration/utilize_hand_eye_calibration.py @@ -25,6 +25,9 @@ The YAML files for this sample can be found under the main instructions for Zivid samples. +For more information on how to utilize Hand-Eye calibration results, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/hand-eye/how-to-use-the-result-of-hand-eye-calibration.html + """ import numpy as np diff --git a/source/applications/advanced/hand_eye_calibration/verify_hand_eye_with_visualization.py b/source/applications/advanced/hand_eye_calibration/verify_hand_eye_with_visualization.py index d291e057..f8e9139d 100644 --- a/source/applications/advanced/hand_eye_calibration/verify_hand_eye_with_visualization.py +++ b/source/applications/advanced/hand_eye_calibration/verify_hand_eye_with_visualization.py @@ -17,6 +17,9 @@ directory where this sample is stored. You can open the PLY point clouds in MeshLab for visual inspection. +For more information on verifying Hand-Eye calibration, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/hand-eye/hand-eye-calibration-verification.html + """ import argparse diff --git a/source/applications/advanced/multi_camera/README.md b/source/applications/advanced/multi_camera/README.md new file mode 100644 index 00000000..753e3b4b --- /dev/null +++ b/source/applications/advanced/multi_camera/README.md @@ -0,0 +1,3 @@ +# Multi-Camera Calibration + +> **Tutorial:** Read the full [Multi-Camera Calibration](https://support.zivid.com/en/latest/camera/academy/applications/multi-camera-calibration.html) tutorial on Zivid Knowledge Base. diff --git a/source/applications/advanced/multi_camera/multi_camera_calibration.py b/source/applications/advanced/multi_camera/multi_camera_calibration.py index f6e8383d..3f1095b8 100644 --- a/source/applications/advanced/multi_camera/multi_camera_calibration.py +++ b/source/applications/advanced/multi_camera/multi_camera_calibration.py @@ -1,5 +1,9 @@ """ -Use captures of a calibration object to generate transformation matrices to a single coordinate frame, from connected cameras. +Use captures of a calibration object to generate transformation matrices to a single coordinate frame, from multiple connected cameras. + +For more information on multi-camera calibration, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/multi-camera-calibration.html + """ import argparse diff --git a/source/applications/advanced/multi_camera/multi_camera_calibration_from_zdf.py b/source/applications/advanced/multi_camera/multi_camera_calibration_from_zdf.py index 4355916d..d2e36b22 100644 --- a/source/applications/advanced/multi_camera/multi_camera_calibration_from_zdf.py +++ b/source/applications/advanced/multi_camera/multi_camera_calibration_from_zdf.py @@ -1,5 +1,9 @@ """ -Use captures of a calibration object to generate transformation matrices to a single coordinate frame, from ZDF files. +Use captures of a calibration object to generate transformation matrices to a single coordinate frame, from ZDF files captured with multiple cameras. + +For more information on multi-camera calibration, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/multi-camera-calibration.html + """ import argparse diff --git a/source/applications/advanced/multi_camera/stitch_by_transformation.py b/source/applications/advanced/multi_camera/stitch_by_transformation.py index cb7ae164..f411d75e 100644 --- a/source/applications/advanced/multi_camera/stitch_by_transformation.py +++ b/source/applications/advanced/multi_camera/stitch_by_transformation.py @@ -2,6 +2,10 @@ Use transformation matrices from Multi-Camera calibration to transform point clouds into a single coordinate frame, from connected cameras. Note: This example uses experimental SDK features, which may be modified, moved, or deleted in the future without notice. + +For more information on multi-camera calibration, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/multi-camera-calibration.html + """ import argparse diff --git a/source/applications/advanced/multi_camera/stitch_by_transformation_from_zdf.py b/source/applications/advanced/multi_camera/stitch_by_transformation_from_zdf.py index af85312d..e7f99d72 100644 --- a/source/applications/advanced/multi_camera/stitch_by_transformation_from_zdf.py +++ b/source/applications/advanced/multi_camera/stitch_by_transformation_from_zdf.py @@ -1,5 +1,9 @@ """ Use transformation matrices from Multi-Camera calibration to transform point clouds into single coordinate frame, from a ZDF files. + +For more information on multi-camera calibration, check out the Multi-Camera Calibration tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/multi-camera-calibration.html + """ import argparse diff --git a/source/applications/advanced/projector/project_and_find_marker.py b/source/applications/advanced/projector/project_and_find_marker.py index 60586929..a2ceb141 100644 --- a/source/applications/advanced/projector/project_and_find_marker.py +++ b/source/applications/advanced/projector/project_and_find_marker.py @@ -5,6 +5,9 @@ zero brightness is then used to capture an image with the marker. Finally position of the marker is detected, allowing us to find the 3D coordinates relative to the camera. +For more information on using the projector to project 2D images, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/camera/2d-image-projection.html + """ from datetime import timedelta @@ -401,7 +404,7 @@ def _main() -> None: if not camera_supports_projection_brightness_boost(camera) else settings_2d_projection ) - projected_marker_frame_2d.image_rgba().save("ProjectedMarker.png") + projected_marker_frame_2d.image_rgba_srgb().save("ProjectedMarker.png") print("Capturing a 2D frame of the scene illuminated with the projector") illuminated_scene_frame_2d = camera.capture_2d(settings_2d_max_brightness) diff --git a/source/applications/advanced/projector/read_project_and_capture_image.py b/source/applications/advanced/projector/read_project_and_capture_image.py index c0b0615f..62f1abf7 100644 --- a/source/applications/advanced/projector/read_project_and_capture_image.py +++ b/source/applications/advanced/projector/read_project_and_capture_image.py @@ -11,6 +11,9 @@ The image for this sample can be found under the main instructions for Zivid samples. +For more information on using the projector to project 2D images, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/camera/2d-image-projection.html + """ from datetime import timedelta diff --git a/source/applications/advanced/projector/reproject_points.py b/source/applications/advanced/projector/reproject_points.py index 8b1d3969..24d7f0db 100644 --- a/source/applications/advanced/projector/reproject_points.py +++ b/source/applications/advanced/projector/reproject_points.py @@ -6,6 +6,9 @@ corresponding projector pixels. The projector pixel coordinates are then used to draw markers at the correct locations before displaying the image using the projector. +For more information on using the projector to project 2D images, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/camera/2d-image-projection.html + """ from datetime import timedelta diff --git a/source/applications/advanced/roi/README.md b/source/applications/advanced/roi/README.md new file mode 100644 index 00000000..336e95f4 --- /dev/null +++ b/source/applications/advanced/roi/README.md @@ -0,0 +1,3 @@ +# Region of Interest + +> **Tutorial:** Read the full [Region of Interest](https://support.zivid.com/en/latest/camera/academy/applications/roi.html) tutorial on Zivid Knowledge Base. diff --git a/source/applications/advanced/roi/roi_box_via_aruco_marker.py b/source/applications/advanced/roi/roi_box_via_aruco_marker.py index 4e4172d2..2aa2c95a 100644 --- a/source/applications/advanced/roi/roi_box_via_aruco_marker.py +++ b/source/applications/advanced/roi/roi_box_via_aruco_marker.py @@ -3,6 +3,9 @@ The ZFC file for this sample can be downloaded from https://support.zivid.com/en/latest/api-reference/samples/sample-data.html. +For more information on Region-Of-Interest (ROI) and how to use it, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/roi.html + """ from typing import List diff --git a/source/applications/advanced/roi/roi_box_via_checkerboard.py b/source/applications/advanced/roi/roi_box_via_checkerboard.py index e59abc12..cdb3256f 100644 --- a/source/applications/advanced/roi/roi_box_via_checkerboard.py +++ b/source/applications/advanced/roi/roi_box_via_checkerboard.py @@ -3,6 +3,9 @@ The ZFC file for this sample can be downloaded from https://support.zivid.com/en/latest/api-reference/samples/sample-data.html. +For more information on Region-Of-Interest (ROI) and how to use it, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/roi.html + """ from typing import List diff --git a/source/applications/advanced/stitching/README.md b/source/applications/advanced/stitching/README.md new file mode 100644 index 00000000..bc4e1f0c --- /dev/null +++ b/source/applications/advanced/stitching/README.md @@ -0,0 +1,3 @@ +# Stitching + +> **Tutorial:** Read the full [Stitching](https://support.zivid.com/en/latest/camera/academy/applications/stitching.html) tutorial on Zivid Knowledge Base. diff --git a/source/applications/advanced/stitching/stitch_continuously_rotating_object.py b/source/applications/advanced/stitching/stitch_continuously_rotating_object.py index a485c6ad..be3e91c7 100644 --- a/source/applications/advanced/stitching/stitch_continuously_rotating_object.py +++ b/source/applications/advanced/stitching/stitch_continuously_rotating_object.py @@ -6,6 +6,9 @@ Note: This example uses experimental SDK features, which may be modified, moved, or deleted in the future without notice. +For more information on stitching and point cloud registration, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/stitching.html + """ import argparse diff --git a/source/applications/advanced/stitching/stitch_using_robot_mounted_camera.py b/source/applications/advanced/stitching/stitch_using_robot_mounted_camera.py index a6f97c3d..7ba4cc51 100644 --- a/source/applications/advanced/stitching/stitch_using_robot_mounted_camera.py +++ b/source/applications/advanced/stitching/stitch_using_robot_mounted_camera.py @@ -27,6 +27,9 @@ Note: This example uses experimental SDK features, which may be modified, moved, or deleted in the future without notice. +For more information on stitching and point cloud registration, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/stitching.html + """ import argparse diff --git a/source/applications/advanced/stitching/stitch_via_local_point_cloud_registration.py b/source/applications/advanced/stitching/stitch_via_local_point_cloud_registration.py index 7df4b2d7..048e995c 100644 --- a/source/applications/advanced/stitching/stitch_via_local_point_cloud_registration.py +++ b/source/applications/advanced/stitching/stitch_via_local_point_cloud_registration.py @@ -14,6 +14,9 @@ Note: This example uses experimental SDK features, which may be modified, moved, or deleted in the future without notice. +For more information on stitching and point cloud registration, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/stitching.html + """ import zivid diff --git a/source/applications/advanced/transform/README.md b/source/applications/advanced/transform/README.md new file mode 100644 index 00000000..81f2327e --- /dev/null +++ b/source/applications/advanced/transform/README.md @@ -0,0 +1,3 @@ +# Transformations + +> **Tutorial:** Read the full [Transformations](https://support.zivid.com/en/latest/camera/academy/applications/transformations.html) tutorial on Zivid Knowledge Base. diff --git a/source/applications/advanced/transform/transform_point_cloud_from_millimeters_to_meters.py b/source/applications/advanced/transform/transform_point_cloud_from_millimeters_to_meters.py index 1acf249c..3a711820 100644 --- a/source/applications/advanced/transform/transform_point_cloud_from_millimeters_to_meters.py +++ b/source/applications/advanced/transform/transform_point_cloud_from_millimeters_to_meters.py @@ -3,6 +3,9 @@ The ZDF file for this sample can be found under the main instructions for Zivid samples. +For more information on transforming point clouds, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/transformations.html + """ import numpy as np diff --git a/source/applications/advanced/transform/transform_point_cloud_via_aruco_marker.py b/source/applications/advanced/transform/transform_point_cloud_via_aruco_marker.py index cf3f0ea3..8f4c8a6d 100644 --- a/source/applications/advanced/transform/transform_point_cloud_via_aruco_marker.py +++ b/source/applications/advanced/transform/transform_point_cloud_via_aruco_marker.py @@ -3,13 +3,20 @@ The ZDF file for this sample can be found under the main instructions for Zivid samples. +Note: This example uses experimental SDK features, which may be modified, moved, or deleted in the future without notice. + +For more information on transforming point clouds, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/transformations.html + """ from pathlib import Path +from typing import Dict, Tuple import cv2 import numpy as np import zivid +import zivid.experimental.calibration from zividsamples.display import display_bgr from zividsamples.paths import get_sample_data_path from zividsamples.save_load_matrix import assert_affine_matrix_and_save @@ -37,6 +44,143 @@ def _draw_detected_marker(bgra_image: np.ndarray, detection_result: zivid.calibr return bgr +def _coordinate_system_line( + bgr_image: np.ndarray, + first_point: Tuple[int, int], + second_point: Tuple[int, int], + line_color: Tuple[int, int, int], +) -> None: + """Draw a line on a BGR image. + + Args: + bgr_image: BGR image. + first_point: Pixel coordinates of the first end point. + second_point: Pixel coordinates of the second end point. + line_color: Line color. + """ + + line_thickness = 4 + line_type = cv2.LINE_8 + cv2.line(bgr_image, first_point, second_point, line_color, line_thickness, line_type) + + +def _zivid_camera_matrix_to_opencv_camera_matrix(camera_matrix: zivid.CameraIntrinsics.CameraMatrix) -> np.ndarray: + """Convert camera matrix from Zivid to OpenCV. + + Args: + camera_matrix: Camera matrix in Zivid format. + + Returns: + camera_matrix_opencv: Camera matrix in OpenCV format. + """ + + return np.array( + [[camera_matrix.fx, 0.0, camera_matrix.cx], [0.0, camera_matrix.fy, camera_matrix.cy], [0.0, 0.0, 1.0]] + ) + + +def _zivid_distortion_coefficients_to_opencv_distortion_coefficients( + distortion_coeffs: zivid.CameraIntrinsics.Distortion, +) -> np.ndarray: + """Convert distortion coefficients from Zivid to OpenCV. + + Args: + distortion_coeffs: Camera distortion coefficients in Zivid format. + + Returns: + distortion_coeffs_opencv: Camera distortion coefficients in OpenCV format. + """ + + return np.array( + [distortion_coeffs.k1, distortion_coeffs.k2, distortion_coeffs.p1, distortion_coeffs.p2, distortion_coeffs.k3] + ) + + +def _move_point( + origin_in_camera_frame: np.ndarray, offset_in_marker_frame: np.ndarray, marker_pose: np.ndarray +) -> np.ndarray: + """Move a coordinate system origin point given a direction and an offset to create a coordinate system axis point. + + Args: + origin_in_camera_frame: 3D coordinates of the coordinate system origin point. + offset_in_marker_frame: 3D coordinates of the offset to move the coordinate system origin point to. + marker_pose: Transformation matrix (ArUco marker in camera frame). + + Returns: + translated point: 3D coordinates of coordinate system axis point. + """ + + rotation_matrix = marker_pose[:3, :3] + offset_rotated = np.dot(rotation_matrix, offset_in_marker_frame) + return origin_in_camera_frame + offset_rotated + + +def _get_coordinate_system_points( + frame: zivid.Frame, marker_pose: np.ndarray, size_of_axis: float +) -> Dict[str, Tuple[int, int]]: + """Get pixel coordinates of the coordinate system origin and axes. + + Args: + frame: Zivid frame containing point cloud. + marker_pose: Transformation matrix (ArUco marker in camera frame). + size_of_axis: Coordinate system axis length in mm. + + Returns: + frame_points: Pixel coordinates of the coordinate system origin and axes. + """ + + intrinsics = zivid.experimental.calibration.estimate_intrinsics(frame) + cv_camera_matrix = _zivid_camera_matrix_to_opencv_camera_matrix(intrinsics.camera_matrix) + cv_dist_coeffs = _zivid_distortion_coefficients_to_opencv_distortion_coefficients(intrinsics.distortion) + + origin_position = np.array([marker_pose[0, 3], marker_pose[1, 3], marker_pose[2, 3]]) + x_axis_direction = _move_point(origin_position, np.array([size_of_axis, 0.0, 0.0]), marker_pose) + y_axis_direction = _move_point(origin_position, np.array([0.0, size_of_axis, 0.0]), marker_pose) + z_axis_direction = _move_point(origin_position, np.array([0.0, 0.0, size_of_axis]), marker_pose) + + points_to_project = np.array([origin_position, x_axis_direction, y_axis_direction, z_axis_direction]) + projected_points = cv2.projectPoints(points_to_project, np.zeros(3), np.zeros(3), cv_camera_matrix, cv_dist_coeffs)[ + 0 + ] + + projected_points = projected_points.reshape(-1, 2) + return { + "origin_point": (int(projected_points[0][0]), int(projected_points[0][1])), + "x_axis_point": (int(projected_points[1][0]), int(projected_points[1][1])), + "y_axis_point": (int(projected_points[2][0]), int(projected_points[2][1])), + "z_axis_point": (int(projected_points[3][0]), int(projected_points[3][1])), + } + + +def _draw_coordinate_system(frame: zivid.Frame, marker_pose: np.ndarray, bgr_image: np.ndarray) -> None: + """Draw a coordinate system on a BGR image. + + Args: + frame: Zivid frame containing point cloud. + marker_pose: Transformation matrix (ArUco marker in camera frame). + bgr_image: BGR image. + """ + + size_of_axis = 30.0 # each axis has 30 mm of length + + print("Acquiring frame points") + frame_points = _get_coordinate_system_points(frame, marker_pose, size_of_axis) + + origin_point = frame_points["origin_point"] + z = frame_points["z_axis_point"] + y = frame_points["y_axis_point"] + x = frame_points["x_axis_point"] + + print("Drawing Z axis") + _coordinate_system_line(bgr_image, origin_point, z, (255, 0, 0)) + + print("Drawing Y axis") + _coordinate_system_line(bgr_image, origin_point, y, (0, 255, 0)) + + print("Drawing X axis") + _coordinate_system_line(bgr_image, origin_point, x, (0, 0, 255)) + + def _main() -> None: # Application class must be initialized before using other Zivid classes. app = zivid.Application() # noqa: F841 # pylint: disable=unused-variable @@ -58,7 +202,7 @@ def _main() -> None: raise RuntimeError("No ArUco markers detected") print("Converting to OpenCV image format") - bgra_image = point_cloud.copy_data("bgra") + bgra_image = point_cloud.copy_data("bgra_srgb") print("Displaying detected ArUco marker") bgr = _draw_detected_marker(bgra_image, detection_result) @@ -69,19 +213,24 @@ def _main() -> None: cv2.imwrite(bgr_image_file, bgr) print("Estimating pose of detected ArUco marker") - transform_camera_to_marker = detection_result.detected_markers()[0].pose.to_matrix() + camera_to_marker_transform = detection_result.detected_markers()[0].pose.to_matrix() print("ArUco marker pose in camera frame:") - print(transform_camera_to_marker) + print(camera_to_marker_transform) print("Camera pose in ArUco marker frame:") - transform_marker_to_camera = np.linalg.inv(transform_camera_to_marker) - print(transform_marker_to_camera) + marker_to_camera_transform = np.linalg.inv(camera_to_marker_transform) + print(marker_to_camera_transform) + + print("Visualizing ArUco marker with coordinate system") + bgr_coordinate_system = bgra_image[:, :, 0:3].copy() + _draw_coordinate_system(frame, camera_to_marker_transform, bgr_coordinate_system) + display_bgr(bgr_coordinate_system, "ArUco marker transformation frame") transform_file = Path("ArUcoMarkerToCameraTransform.yaml") print("Saving a YAML file with Inverted ArUco marker pose to file: ") - assert_affine_matrix_and_save(transform_marker_to_camera, transform_file) + assert_affine_matrix_and_save(marker_to_camera_transform, transform_file) print("Transforming point cloud from camera frame to ArUco marker frame") - point_cloud.transform(transform_marker_to_camera) + point_cloud.transform(marker_to_camera_transform) aruco_marker_transformed_file = "CalibrationBoardInArucoMarkerOrigin.zdf" print(f"Saving transformed point cloud to file: {aruco_marker_transformed_file}") diff --git a/source/applications/advanced/transform/transform_point_cloud_via_checkerboard.py b/source/applications/advanced/transform/transform_point_cloud_via_checkerboard.py index acaafa1a..f8430908 100644 --- a/source/applications/advanced/transform/transform_point_cloud_via_checkerboard.py +++ b/source/applications/advanced/transform/transform_point_cloud_via_checkerboard.py @@ -5,6 +5,9 @@ Note: This example uses experimental SDK features, which may be modified, moved, or deleted in the future without notice. +For more information on transforming point clouds, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/transformations.html + """ from pathlib import Path @@ -20,15 +23,15 @@ def _coordinate_system_line( - bgra_image: np.ndarray, + bgr_image: np.ndarray, first_point: Tuple[int, int], second_point: Tuple[int, int], line_color: Tuple[int, int, int], ) -> None: - """Draw a line on a BGRA image. + """Draw a line on a BGR image. Args: - bgra_image: BGRA image. + bgr_image: BGR image. first_point: Pixel coordinates of the first end point. second_point: Pixel coordinates of the second end point. line_color: Line color. @@ -36,7 +39,7 @@ def _coordinate_system_line( line_thickness = 4 line_type = cv2.LINE_8 - cv2.line(bgra_image, first_point, second_point, line_color, line_thickness, line_type) + cv2.line(bgr_image, first_point, second_point, line_color, line_thickness, line_type) def _zivid_camera_matrix_to_opencv_camera_matrix(camera_matrix: zivid.CameraIntrinsics.CameraMatrix) -> np.ndarray: @@ -127,13 +130,13 @@ def _get_coordinate_system_points( } -def _draw_coordinate_system(frame: zivid.Frame, checkerboard_pose: np.ndarray, bgra_image: np.ndarray) -> None: - """Draw a coordinate system on a BGRA image. +def _draw_coordinate_system(frame: zivid.Frame, checkerboard_pose: np.ndarray, bgr_image: np.ndarray) -> None: + """Draw a coordinate system on a BGR image. Args: frame: Zivid frame containing point cloud. checkerboard_pose: Transformation matrix (checkerboard in camera frame). - bgra_image: BGRA image. + bgr_image: BGR image. """ size_of_axis = 30.0 # each axis has 30 mm of length @@ -147,13 +150,13 @@ def _draw_coordinate_system(frame: zivid.Frame, checkerboard_pose: np.ndarray, b x = frame_points["x_axis_point"] print("Drawing Z axis") - _coordinate_system_line(bgra_image, origin_point, z, (255, 0, 0)) + _coordinate_system_line(bgr_image, origin_point, z, (255, 0, 0)) print("Drawing Y axis") - _coordinate_system_line(bgra_image, origin_point, y, (0, 255, 0)) + _coordinate_system_line(bgr_image, origin_point, y, (0, 255, 0)) print("Drawing X axis") - _coordinate_system_line(bgra_image, origin_point, x, (0, 0, 255)) + _coordinate_system_line(bgr_image, origin_point, x, (0, 0, 255)) def _main() -> None: @@ -189,8 +192,13 @@ def _main() -> None: bgra_image = point_cloud.copy_data("bgra_srgb") print("Visualizing checkerboard with coordinate system") - _draw_coordinate_system(frame, camera_to_checkerboard_transform, bgra_image) - display_bgr(bgra_image, "Checkerboard transformation frame") + bgr_coordinate_system = bgra_image[:, :, 0:3].copy() + _draw_coordinate_system(frame, camera_to_checkerboard_transform, bgr_coordinate_system) + display_bgr(bgr_coordinate_system, "Checkerboard transformation frame") + + bgr_image_file = "CheckerboardCoordinateSystem.png" + print(f"Saving 2D color image with coordinate system to file: {bgr_image_file}") + cv2.imwrite(bgr_image_file, bgr_coordinate_system) checkerboard_transformed_file = "CalibrationBoardInCheckerboardOrigin.zdf" print(f"Saving transformed point cloud to file: {checkerboard_transformed_file}") diff --git a/source/applications/basic/file_formats/convert_zdf.py b/source/applications/basic/file_formats/convert_zdf.py index c5b8b6b9..56a87a52 100644 --- a/source/applications/basic/file_formats/convert_zdf.py +++ b/source/applications/basic/file_formats/convert_zdf.py @@ -8,6 +8,9 @@ PLY, PCD, XYZ, CSV, TXT - 3D point cloud PNG, JPG, BMP - 2D RGB image +For more information on supported formats and options, check out this article: +https://support.zivid.com/en/latest/camera/reference-articles/point-cloud-structure-and-output-formats.html + """ import argparse diff --git a/source/applications/basic/file_formats/read_iterate_zdf.py b/source/applications/basic/file_formats/read_iterate_zdf.py index 3dbf2622..e37e3916 100644 --- a/source/applications/basic/file_formats/read_iterate_zdf.py +++ b/source/applications/basic/file_formats/read_iterate_zdf.py @@ -3,6 +3,9 @@ The ZDF file for this sample can be found under the main instructions for Zivid samples. +For more information on supported formats and options, check out this article: +https://support.zivid.com/en/latest/camera/reference-articles/point-cloud-structure-and-output-formats.html + """ import zivid diff --git a/source/applications/basic/visualization/README.md b/source/applications/basic/visualization/README.md new file mode 100644 index 00000000..81a0352a --- /dev/null +++ b/source/applications/basic/visualization/README.md @@ -0,0 +1,3 @@ +# Visualization + +> **Tutorial:** Read the full [Visualization](https://support.zivid.com/en/latest/camera/academy/applications/visualization-tutorial.html) tutorial on Zivid Knowledge Base. diff --git a/source/applications/basic/visualization/capture_and_visualize_normals.py b/source/applications/basic/visualization/capture_and_visualize_normals.py index 8075a98f..38b6a1f6 100644 --- a/source/applications/basic/visualization/capture_and_visualize_normals.py +++ b/source/applications/basic/visualization/capture_and_visualize_normals.py @@ -1,6 +1,9 @@ """ Capture Zivid point clouds, compute normals and convert to color map and display. +For more information on computing point cloud normals, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/normals.html + """ import sys diff --git a/source/applications/basic/visualization/capture_from_file_camera_vis_3d.py b/source/applications/basic/visualization/capture_from_file_camera_vis_3d.py index 015cfc6a..50c66c9d 100644 --- a/source/applications/basic/visualization/capture_from_file_camera_vis_3d.py +++ b/source/applications/basic/visualization/capture_from_file_camera_vis_3d.py @@ -7,6 +7,9 @@ There are five available file cameras to choose from, one for each camera model. The default file camera used in this sample is the Zivid 2 M70 file camera. +For more information about file cameras, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/camera/file-camera.html + """ import argparse diff --git a/source/applications/basic/visualization/capture_vis_3d.py b/source/applications/basic/visualization/capture_vis_3d.py index 7304bf40..3c33eab3 100644 --- a/source/applications/basic/visualization/capture_vis_3d.py +++ b/source/applications/basic/visualization/capture_vis_3d.py @@ -1,6 +1,9 @@ """ Capture point clouds, with color, from the Zivid camera, and visualize it. +For more information on visualization, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/visualization-tutorial.html + """ import zivid diff --git a/source/applications/basic/visualization/project_image_start_and_stop.py b/source/applications/basic/visualization/project_image_start_and_stop.py index 455ab3db..024ac897 100644 --- a/source/applications/basic/visualization/project_image_start_and_stop.py +++ b/source/applications/basic/visualization/project_image_start_and_stop.py @@ -6,6 +6,9 @@ - projected image handle going out of scope - triggering a 3D capture +For more information on using the projector to project 2D images, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/camera/2d-image-projection.html + """ from typing import Tuple diff --git a/source/applications/basic/visualization/read_zdf_vis_3d.py b/source/applications/basic/visualization/read_zdf_vis_3d.py index efcd3bf8..99421d56 100644 --- a/source/applications/basic/visualization/read_zdf_vis_3d.py +++ b/source/applications/basic/visualization/read_zdf_vis_3d.py @@ -3,6 +3,9 @@ The ZDF file for this sample can be found under the main instructions for Zivid samples. +For more information on visualization, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/visualization-tutorial.html + """ import zivid diff --git a/source/camera/README.md b/source/camera/README.md new file mode 100644 index 00000000..6dd7c1e4 --- /dev/null +++ b/source/camera/README.md @@ -0,0 +1,3 @@ +# Camera + +> **Tutorials:** Read the [Camera](https://support.zivid.com/en/latest/camera/academy/camera.html) tutorials on Zivid Knowledge Base. diff --git a/source/camera/advanced/capture_2d_and_3d.py b/source/camera/advanced/capture_2d_and_3d.py index d5004eb7..b215d282 100644 --- a/source/camera/advanced/capture_2d_and_3d.py +++ b/source/camera/advanced/capture_2d_and_3d.py @@ -4,6 +4,9 @@ Capture separate 2D and 3D with different sampling modes based on camera model. Then use color from 2D when visualizing the 3D point cloud. +For more information about capture strategy, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/camera/2d3d-capture-strategy.html + """ import zivid diff --git a/source/camera/advanced/capture_and_print_normals.py b/source/camera/advanced/capture_and_print_normals.py index 6157ae5d..1651489d 100644 --- a/source/camera/advanced/capture_and_print_normals.py +++ b/source/camera/advanced/capture_and_print_normals.py @@ -1,6 +1,9 @@ """ Capture Zivid point clouds, compute normals and print a subset. +For more information on computing point cloud normals, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/applications/normals.html + """ import numpy as np diff --git a/source/camera/basic/README.md b/source/camera/basic/README.md new file mode 100644 index 00000000..c878502c --- /dev/null +++ b/source/camera/basic/README.md @@ -0,0 +1,3 @@ +# Camera + +> **Tutorials:** Read the [Capture Tutorial](https://support.zivid.com/en/latest/camera/academy/camera/capture-tutorial.html) or [Quick Capture Tutorial](https://support.zivid.com/en/latest/camera/getting-started/quick-capture-tutorial.html) on Zivid Knowledge Base. diff --git a/source/camera/basic/capture.py b/source/camera/basic/capture.py index e08d37fe..4e05007a 100644 --- a/source/camera/basic/capture.py +++ b/source/camera/basic/capture.py @@ -1,6 +1,9 @@ """ Capture colored point cloud, save 2D image, save 3D ZDF, and export PLY, using the Zivid camera. +For more information about capturing, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/camera/capture-tutorial.html + """ import zivid diff --git a/source/camera/basic/capture_from_file_camera.py b/source/camera/basic/capture_from_file_camera.py index 05446f47..1b093996 100644 --- a/source/camera/basic/capture_from_file_camera.py +++ b/source/camera/basic/capture_from_file_camera.py @@ -7,6 +7,9 @@ There are five available file cameras to choose from, one for each camera model. The default file camera used in this sample is the Zivid 2+ MR60 file camera. +For more information about file cameras, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/camera/file-camera.html + """ import argparse diff --git a/source/camera/basic/capture_hdr_complete_settings.py b/source/camera/basic/capture_hdr_complete_settings.py index 193633d9..1ad80ca0 100644 --- a/source/camera/basic/capture_hdr_complete_settings.py +++ b/source/camera/basic/capture_hdr_complete_settings.py @@ -8,6 +8,9 @@ Note: This example uses experimental SDK features, which may be modified, moved, or deleted in the future without notice. +For more information about camera settings, check out this article: +https://support.zivid.com/en/latest/camera/reference-articles/camera-settings.html + """ from datetime import timedelta diff --git a/source/camera/basic/capture_with_settings_from_yml.py b/source/camera/basic/capture_with_settings_from_yml.py index 72de98fe..9f85ee9b 100644 --- a/source/camera/basic/capture_with_settings_from_yml.py +++ b/source/camera/basic/capture_with_settings_from_yml.py @@ -5,6 +5,9 @@ The YML files for this sample can be found under the main Zivid sample instructions. +For more information about camera settings, check out this article: +https://support.zivid.com/en/latest/camera/reference-articles/camera-settings.html + """ import argparse diff --git a/source/camera/info_util_other/adapt_settings_for_flickering_ambient_light.py b/source/camera/info_util_other/adapt_settings_for_flickering_ambient_light.py index d82c1c8f..4a928fa4 100644 --- a/source/camera/info_util_other/adapt_settings_for_flickering_ambient_light.py +++ b/source/camera/info_util_other/adapt_settings_for_flickering_ambient_light.py @@ -6,6 +6,9 @@ flickering frequencies based on user input. The output is new .yml files with the adapted settings. +For more information on ambient light flickering, check out this article: +https://support.zivid.com/en/latest/reference-articles/settings/2d-settings/2d-acquisition-settings/exposure-time.html#measuring-ambient-light-flicker-frequency + """ import argparse diff --git a/source/camera/info_util_other/capture_with_diagnostics.py b/source/camera/info_util_other/capture_with_diagnostics.py index 465cccc8..5b137383 100644 --- a/source/camera/info_util_other/capture_with_diagnostics.py +++ b/source/camera/info_util_other/capture_with_diagnostics.py @@ -5,6 +5,9 @@ Send ZDF files with diagnostics enabled to the Zivid support team to allow more thorough troubleshooting. Have in mind that enabling diagnostics increases the capture time and the RAM usage. +For more information on diagnostics, check out this article: +https://support.zivid.com/en/latest/reference-articles/settings/diagnostics.html + """ import zivid diff --git a/source/camera/info_util_other/firmware_updater.py b/source/camera/info_util_other/firmware_updater.py index 838ecd5f..9b941a8a 100644 --- a/source/camera/info_util_other/firmware_updater.py +++ b/source/camera/info_util_other/firmware_updater.py @@ -1,6 +1,9 @@ """ Update firmware on the Zivid camera. +For more information on firmware update, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/camera/firmware-update.html + """ import zivid diff --git a/source/camera/info_util_other/get_camera_intrinsics.py b/source/camera/info_util_other/get_camera_intrinsics.py index 7f108e5d..6a3c40d1 100644 --- a/source/camera/info_util_other/get_camera_intrinsics.py +++ b/source/camera/info_util_other/get_camera_intrinsics.py @@ -3,6 +3,9 @@ Note: This example uses experimental SDK features, which may be modified, moved, or deleted in the future without notice. +For more information on camera intrinsics, check out this article: +https://support.zivid.com/en/latest/camera/reference-articles/camera-intrinsics.html + """ import zivid diff --git a/source/camera/info_util_other/measure_scene_conditions.py b/source/camera/info_util_other/measure_scene_conditions.py index aa219998..eccec9cd 100644 --- a/source/camera/info_util_other/measure_scene_conditions.py +++ b/source/camera/info_util_other/measure_scene_conditions.py @@ -1,5 +1,9 @@ """ Measure ambient light conditions in the scene and output the measured flickering frequency of the ambient light if flickering is detected. + +For more information on measuring scene conditions, check out this article: +https://support.zivid.com/en/latest/reference-articles/settings/2d-settings/2d-acquisition-settings/exposure-time.html#measuring-ambient-light-flicker-frequency + """ import zivid diff --git a/source/camera/info_util_other/network/automatic_network_configuration_for_cameras.py b/source/camera/info_util_other/network/automatic_network_configuration_for_cameras.py index 4e7765b1..e76e06e8 100644 --- a/source/camera/info_util_other/network/automatic_network_configuration_for_cameras.py +++ b/source/camera/info_util_other/network/automatic_network_configuration_for_cameras.py @@ -5,6 +5,10 @@ - By default, the program applies the new configuration directly to the cameras. - Use the [--display-only] argument to simulate the configuration and display the proposed IP addresses without making actual changes. + +For more information on network configuration, check out this tutorial: +https://support.zivid.com/en/latest/camera/getting-started/software-installation/zivid-two-network-configuration.html + """ import argparse diff --git a/source/camera/info_util_other/network/network_configuration.py b/source/camera/info_util_other/network/network_configuration.py index edec9b7f..724f1b78 100644 --- a/source/camera/info_util_other/network/network_configuration.py +++ b/source/camera/info_util_other/network/network_configuration.py @@ -1,5 +1,9 @@ """ Uses Zivid API to change the IP address of the Zivid camera. + +For more information on network configuration, check out this tutorial: +https://support.zivid.com/en/latest/camera/getting-started/software-installation/zivid-two-network-configuration.html + """ import zivid diff --git a/source/camera/info_util_other/warmup.py b/source/camera/info_util_other/warmup.py index 290459d0..d31f9e83 100644 --- a/source/camera/info_util_other/warmup.py +++ b/source/camera/info_util_other/warmup.py @@ -1,6 +1,9 @@ """ Short example of a basic way to warm up the camera with specified time and capture cycle. +For more information on warming up the camera, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/camera/warmup.html + """ import argparse diff --git a/source/camera/maintenance/README.md b/source/camera/maintenance/README.md new file mode 100644 index 00000000..20780aec --- /dev/null +++ b/source/camera/maintenance/README.md @@ -0,0 +1,3 @@ +# Infield Correction + +> **Tutorial:** Read the full [Infield Correction](https://support.zivid.com/en/latest/camera/academy/camera/infield-correction.html) tutorial on Zivid Knowledge Base. diff --git a/source/camera/maintenance/correct_camera_in_field.py b/source/camera/maintenance/correct_camera_in_field.py index da462c18..40633bed 100644 --- a/source/camera/maintenance/correct_camera_in_field.py +++ b/source/camera/maintenance/correct_camera_in_field.py @@ -11,6 +11,9 @@ Note: This example uses experimental SDK features, which may be modified, moved, or deleted in the future without notice. +For more information about in-field correction, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/camera/infield-correction.html + """ from typing import List diff --git a/source/camera/maintenance/reset_camera_in_field.py b/source/camera/maintenance/reset_camera_in_field.py index 327f52e2..9c47713a 100644 --- a/source/camera/maintenance/reset_camera_in_field.py +++ b/source/camera/maintenance/reset_camera_in_field.py @@ -3,6 +3,9 @@ Note: This example uses experimental SDK features, which may be modified, moved, or deleted in the future without notice. +For more information about in-field correction, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/camera/infield-correction.html + """ import zivid diff --git a/source/camera/maintenance/verify_camera_in_field.py b/source/camera/maintenance/verify_camera_in_field.py index 19cd20e1..9f4262bd 100644 --- a/source/camera/maintenance/verify_camera_in_field.py +++ b/source/camera/maintenance/verify_camera_in_field.py @@ -8,6 +8,9 @@ Note: This example uses experimental SDK features, which may be modified, moved, or deleted in the future without notice. +For more information about in-field verification, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/camera/infield-correction.html + """ import zivid diff --git a/source/camera/maintenance/verify_camera_in_field_from_zdf.py b/source/camera/maintenance/verify_camera_in_field_from_zdf.py index 33b4e67b..ec4384a2 100644 --- a/source/camera/maintenance/verify_camera_in_field_from_zdf.py +++ b/source/camera/maintenance/verify_camera_in_field_from_zdf.py @@ -16,6 +16,9 @@ Note: This example uses experimental SDK features, which may be modified, moved, or deleted in the future without notice. +For more information about in-field verification, check out this tutorial: +https://support.zivid.com/en/latest/camera/academy/camera/infield-correction.html + """ import zivid